亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ladder logic for pic and avr.mht

?? 用PIC單片機與AVR單片機製作PLC控制的階梯圖程序。
?? MHT
?? 第 1 頁 / 共 5 頁
字號:
              sequencer)=20
              <LI>analog inputs, analog (PWM) outputs=20
              <LI>integer variables and arithmetic instructions=20
              <LI>easy-to-use serial communications, to a PC, LCD, or =
other=20
              device=20
              <LI>shift registers, look-up tables=20
              <LI>EEPROM variables, whose values are not forgotten when =
you lose=20
              power=20
              <LI>simulator, to test your program before you generate =
PIC/AVR=20
              code </LI></UL>
            <P>You can <A href=3D"http://cq.cx/ladder.pl#dl">download it =
for=20
            free.</A> Or, with more background:</P>
            <H3>Introduction</H3>
            <P>PLCs are often programmed in ladder logic. This is =
because PLCs=20
            originally replaced relay control systems, and forty years =
later, we=20
            still haven't quite let go. A PLC, like any microprocessor, =
executes=20
            a list of instructions in sequence. Ladder logic tools =
abstract=20
            this; you can program the PLC by wiring up relay contacts =
and coils=20
            on-screen, and the PLC runtime will simulate the circuit =
that you've=20
            drawn. Some of the relay contacts can be tied to input =
signals from=20
            the real world; some of the coils can be tied to outputs. =
That way=20
            you can make your simulated circuit interact with other =
devices, and=20
            actually control things. That is the point.</P>
            <P>Actually it's more general than that, because you can =
incorporate=20
            timers and counters and arithmetic operations that you =
couldn't=20
            (easily) perform with just relays. The circuit concept is =
still=20
            useful though, partly just because it's intuitive, but also =
because=20
            it abstracts the concurrency issues. It looks like =
this:</P><PRE style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: =
13px; PADDING-BOTTOM: 10px; PADDING-TOP: 3px; font-face: Lucida =
Console">         ||       Xa               Xb              Yout       =
||
       1 ||-------] [------+-------] [------+-------( )-------||
         ||                |                |                 ||
         ||                |       Xc       |                 ||
         ||                +-------]/[------+                 ||
</PRE>
            <P>This is a simple piece of combinational logic. There are =
three=20
            input terms, Xa, Xb, and Xc. There is one output term, Yout. =
The=20
            expression is Yout :=3D Xa and (Xb or (not Xc)). This makes =
sense if=20
            you think of Xa and Xb as normally open relay contacts, Xc =
as=20
            normally closed relay contacts, and Yout as a relay coil. Of =
course=20
            it gets more complicated than that:</P><PRE =
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 13px; =
PADDING-BOTTOM: 10px; PADDING-TOP: 3px; font-face: Lucida Console">      =
   ||                                                   ||
         ||                                      Asetpoint    ||
       1 ||-------------------------------------{READ ADC}----||
         ||                                                   ||
         ||                                    Atemperature   ||
         ||-------------------------------------{READ ADC}----||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||                        {SUB  min_temp  :=3D}        ||
       2 ||------------------------{ Asetpoint - 20  }--------||
         ||                                                   ||
         ||                        {ADD  max_temp  :=3D}        ||
         ||------------------------{ Asetpoint + 20  }--------||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||[Atemperature &gt;]                       Yheater     ||
       3 ||[ max_temp     ]+------------------------(R)-------||
         ||                |                                  ||
         ||     Xenable    |                                  ||
         ||-------]/[------+                                  ||
         ||                                                   ||
         ||[Atemperature &lt;]      Xenable          Yheater     ||
         ||[ min_temp     ]--------] [--------------(S)-------||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||                       {SUB  check_temp  :=3D}       ||
       4 ||-----------------------{ Asetpoint - 30    }-------||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||[Atemperature &gt;]                       Yis_hot     ||
       5 ||[ check_temp   ]-------------------------( )-------||
         ||                                                   ||
         ||                                                   ||
         ||                                                   ||
         ||------[END]----------------------------------------||
         ||                                                   ||
         ||                                                   ||
</PRE>
            <P>This is for a simple thermostat. There are two analog =
inputs; one=20
            of them is for the setpoint, so that it might, for example, =
be=20
            connected to a pot that the user turns to select the desired =

            temperature. The other provides the temperature measurement; =
it=20
            might be a semiconductor temperature sensor, or a platinum =
RTD with=20
            suitable interfacing circuitry. There is a digital output, =
Yheater.=20
            That might control a heating element, through a suitable =
switch (a=20
            TRIAC, or a relay, or a solid-state relay, or whatever). =
</P>
            <P>We close the loop with a simple hysteretic (bang-bang)=20
            controller. We have selected plus or minus 20 ADC units of=20
            hysteresis. That means that when the temperature falls below =

            (setpoint - 20), we turn on the heater, and when it climbs =
above=20
            (setpoint + 20), we turn the heater off.</P>
            <P>I chose to add a few small frills. First, there is an =
enable=20
            input: the heater is forced off when Xenable is low. I also =
added an=20
            indicator light, Yis_hot, to indicate that the temperature =
is within=20
            regulation. This compares against a threshold slightly =
colder than=20
            (setpoint - 20), so that the light does not flicker with the =
normal=20
            cycling of the thermostat.</P>
            <P>This is a trivial example, but it should be clear that =
the=20
            language is quite expressive. Ladder logic is not a =
general-purpose=20
            programming language, but it is Turing-complete, accepted in =

            industry, and, for a limited class of (mostly =
control-oriented)=20
            problems, surprisingly convenient.</P>
            <H3>A Ladder Logic Compiler for PIC16 and AVR</H3>
            <P>Modern sub-3.00 USD microcontrollers probably have about =
the=20
            computing power of a PLC circa 1975. They therefore provide =
more=20
            than enough MIPS to run reasonably complex ladder logic with =
a cycle=20
            time of a few milliseconds. I think PLCs usually have some =
sort of=20
            runtime that's kind of like an interpreter or a virtual =
machine, but=20
            if we're doing simple logic on a processor without much =
memory then=20
            a compiler might be a better idea.</P>
            <P>So I wrote a compiler. You start with an empty rung. You =
can add=20
            contacts (inputs) and coils (outputs) and more complicated=20
            structures to build up your program. Timers (TON, TOF, RTO) =
are=20
            supported. The max/min durations depend on the cycle time of =
the=20
            =91PLC,=92 which is configurable; timers can count from =
milliseconds to=20
            tens of minutes. There are counters and arithmetic =
operations (plus,=20
            minus, times, div).</P>
            <P>Circuit elements may be added in series or in parallel =
with=20
            existing elements. An I/O list is built from the ladder =
logic drawn.=20
            You can have internal relays (Rfoo), for which memory is=20
            automatically allocated, or inputs (Xfoo) and outputs =
(Yfoo), to=20
            which you must assign a pin on the microcontroller. The =
selection of=20
            pins available depends on the microcontroller. I have tried =
to=20
            support the most popular PICs and AVRs (see <A=20
            href=3D"http://cq.cx/ladder.pl#dl">below</A>).</P>
            <P>You can edit the program in graphical form:</P>
            <P><IMG src=3D"http://cq.cx/pics/ladder-sample.png"></P>
            <P>Then you can test the program by simulating it in real =
time. The=20
            program appears on screen with the energized (true) branches =

            highlighted, which makes it easy to debug. The state of all=20
            variables is shown at the bottom of the screen in the I/O =
list.</P>
            <P><IMG src=3D"http://cq.cx/pics/ladder-sim.png"></P>
            <P>Once the program works in simulation you can assign pins =
to the=20
            inputs and outputs and generate PIC or AVR code. The code =
generator=20
            isn't all that difficult. If you realize that a parallel =
circuit is=20
            an OR and a series circuit is an AND, it's a second-year CS=20
            assignment, and not a very long one. The editor is actually =
much=20
            more challenging. It would take some work to make a smart =
compiler,=20
            though. For the AVR a good register allocator would provide =
a major=20
            speedup. If you wanted to get very fancy then you could =
apply=20
            standard logic reduction algorithms, and maybe state =
reduction too.=20
            That would be much more difficult. The timers screw things =
up=20
            anyways.</P>
            <P>Even ignoring all that, my code generator for the AVR is =
very=20
            poor. The AVR back end still generates PIC code...for =
example, it=20
            does not really take advantage of the fact that the AVR has =
more=20
            than one register. Some of the code that it generates is =
just=20
            embarrassingly bad. The PIC back end is better, but not =

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品日韩成人| 狠狠色狠狠色综合| 久久色在线观看| 欧美日韩国产综合一区二区| 色婷婷亚洲综合| 色综合久久中文字幕| 欧美成人精品高清在线播放| 欧美大片一区二区| 久久亚洲综合av| 天堂资源在线中文精品| 国产精品久久久久永久免费观看 | 亚洲日本一区二区| 国产精品区一区二区三区| 日韩在线一区二区| 欧美综合久久久| 欧美精品色一区二区三区| 制服丝袜av成人在线看| 精品国产91乱码一区二区三区| 久久人人爽爽爽人久久久| 欧美激情一区二区三区蜜桃视频 | 在线观看日韩毛片| 欧美高清一级片在线观看| 激情欧美一区二区三区在线观看| 91.com视频| 午夜欧美2019年伦理| 91国偷自产一区二区三区成为亚洲经典| 91在线免费播放| 欧美日韩精品一区二区天天拍小说| 中文字幕在线不卡视频| 天天综合色天天综合色h| 色噜噜狠狠色综合欧洲selulu| 国产精品国产三级国产普通话99 | 免费美女久久99| 成人黄色在线网站| 欧美人动与zoxxxx乱| 性做久久久久久| 成人免费视频网站在线观看| 欧美午夜精品理论片a级按摩| 精品1区2区在线观看| 精品一区二区综合| 欧美在线制服丝袜| 日韩精品久久久久久| 欧美一区二区三区免费观看视频 | 91精品啪在线观看国产60岁| 男女男精品网站| 久久综合九色综合欧美就去吻| 国产精品自拍网站| 91精品在线麻豆| 国产在线一区二区| 国产精品黄色在线观看| 91成人在线观看喷潮| 男女男精品网站| 国产欧美日韩综合精品一区二区| 日韩国产精品久久久| 色综合久久综合网欧美综合网| 伊人夜夜躁av伊人久久| 成人一道本在线| 亚洲在线观看免费视频| av一区二区三区在线| 国产日韩欧美精品综合| 91在线观看地址| 国产欧美一区二区精品性色超碰 | 亚洲欧洲精品天堂一级| 91国在线观看| 国内精品在线播放| 亚洲欧美激情在线| 91在线无精精品入口| 日韩精品成人一区二区三区| 久久久久久亚洲综合| 91国偷自产一区二区使用方法| 蜜桃av一区二区| 欧美大片一区二区| 色老头久久综合| 国产乱人伦精品一区二区在线观看| 亚洲欧美日韩成人高清在线一区| 欧美一卡二卡三卡| 色综合天天性综合| 亚洲欧美一区二区久久| 精品成人a区在线观看| 97se亚洲国产综合自在线| 久久国产剧场电影| 久久九九久久九九| 成人激情图片网| 久久成人羞羞网站| 亚洲成人免费影院| 亚洲三级免费电影| 国产丝袜在线精品| 精品国产乱码久久久久久浪潮| 日本韩国精品在线| av在线播放成人| 国产激情视频一区二区在线观看| 国产精品视频一二三| 777奇米成人网| 在线亚洲欧美专区二区| av一二三不卡影片| 岛国精品在线观看| 国产综合色在线| 另类小说综合欧美亚洲| 五月激情综合婷婷| 亚洲成人黄色小说| 亚洲一级二级在线| 亚洲福利视频一区| 精品国产免费久久| 日韩情涩欧美日韩视频| 国产成人在线影院 | 国产精品综合二区| 久久福利资源站| 久久成人精品无人区| 日韩影院在线观看| 日日夜夜精品视频天天综合网| 亚洲一区在线视频观看| 亚洲一线二线三线久久久| 亚洲一区二区av电影| 一区二区三区四区五区视频在线观看 | 99国产欧美久久久精品| 国产a视频精品免费观看| 一区二区日韩电影| 亚洲国产中文字幕在线视频综合| 亚洲三级视频在线观看| 亚洲视频精选在线| 亚洲精品乱码久久久久| 亚洲欧美另类综合偷拍| 亚洲va国产天堂va久久en| 亚洲第一在线综合网站| 日韩高清不卡一区二区| 美国av一区二区| 国产一区二区伦理片| 日韩精彩视频在线观看| 捆绑调教美女网站视频一区| 韩国v欧美v日本v亚洲v| 风间由美性色一区二区三区| 成人sese在线| 色先锋资源久久综合| 欧美日韩久久一区| 精品国产在天天线2019| 国产精品美女久久久久aⅴ| 亚洲人一二三区| 肉肉av福利一精品导航| 国产美女视频91| 色噜噜狠狠一区二区三区果冻| 777a∨成人精品桃花网| 久久精品视频网| 一个色综合网站| 蜜桃精品在线观看| 91色在线porny| 欧美一区二区三区在线观看视频| 久久人人超碰精品| 亚洲国产三级在线| 国产在线一区二区综合免费视频| 91亚洲大成网污www| 欧美不卡一区二区三区| 综合在线观看色| 日本美女视频一区二区| av不卡在线观看| 日韩欧美一区二区免费| 日韩美女啊v在线免费观看| 日韩成人伦理电影在线观看| 成人av免费网站| 欧美va亚洲va国产综合| 一区二区高清视频在线观看| 久久99国产精品免费网站| 色婷婷久久久久swag精品 | 国产欧美一区二区三区在线看蜜臀 | 久久亚洲捆绑美女| 亚洲香肠在线观看| 成人综合日日夜夜| 日韩欧美一区电影| 亚洲国产精品一区二区www | 日韩av中文在线观看| 99综合影院在线| 久久久久久久久99精品| 午夜精品123| 91久久久免费一区二区| 国产欧美一区二区三区网站| 美腿丝袜一区二区三区| 欧美午夜精品免费| 亚洲色图第一区| av网站免费线看精品| 国产丝袜欧美中文另类| 国产在线精品免费| 日韩欧美中文一区| 天天色天天操综合| 欧美日韩视频第一区| 日韩亚洲欧美一区二区三区| 一个色在线综合| 91啪九色porn原创视频在线观看| 久久精品在线免费观看| 久久国内精品自在自线400部| 91精品国产免费久久综合| 亚洲国产一区视频| 欧美视频三区在线播放| 玉米视频成人免费看| 91国产丝袜在线播放| 一区二区三区四区亚洲| 91久久精品网| 洋洋av久久久久久久一区| 在线视频一区二区三区| 亚洲最新在线观看| 日本黄色一区二区| 亚洲成人一区在线|