版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Introductions of PLC and MCUA PLC is a device that was invented to replace the necessarysequential relay circuits for machine control. The PLC works by looking at its inputs and depending upon their state, turning on/off its outputs .The user enters a program, usually via software or programmer that
2、 gives the desired results.PLC are used in many “ realworld ”applications. If there is industry present, chances are good that there is a PLC present. If you are involved in machining, packaging, material handling, automated assembly or countless other industries, you are probably already using them
3、. If you are not, you are wasting money and time. Almost any application that needs some type of electrical control has need for PLC.For example, let s assumewhenthat switch turns on we want to turn a solenoid on for 5 seconds and then turn it off regardless of how long the switch is on for. We can
4、do this with a simple external timer. What if the process also needed to count how many times the switch individually turned on? We need a lot of external counters.As you can see, the bigger the process the more of a need we have for a PLC. We can simply program the PLC to count its inputs and turn
5、the solenoids on for the specified time.We will take a look at what i s considered to be the “ top 20 ” PLC instructions. It can be safely estimated that with a firm understanding of there instructions one can solve more than 80% of the applications in existence.That right,s more than 80%! Of course
6、 we ll learn more than just these instructions to help you solve almost ALL your potential PLC applications.The PLC mainly consists of a CPU, memory areas, and appropriate circuits to receive input/output data, as shown in Fig. 19.1 We can actually consider the PLC to be a box full of hundreds or th
7、ousands of separate relays, counters, timer and date storage locations. Do these counters, timers, etc. really exist? No, they don t“ physically exist” but rather they are simulated and can be considered softwarecounters, timers, etc. These internal relays are simulated through bit locations in regi
8、sters.What does each part do?INPUT RELAYS-(contacts) These are connected to the outside world. They physically exist and receive signals from switches, sensors, etc. Typically they are not relays but rather they are transistors.INTERNAL UTILITY RELAYS-(contacts)These do not receive signals fromthe o
9、utside world nor do they physically exist. They are simulated relays and are what enables a PLC to eliminate external relays. There are also some special relays that are dedicated to performing only one task. Some are always on while some are always off. Some are on only once during power-on and are
10、 typically user for initializing data what was stored.COUNTERS These again do not physically exist. They are simulated counters and they can be programmed to count pulses. Typically these counters can count up, down or both up and down. Since there are simulated, they are limited in their counting s
11、peed. Some manufacturers also include high-speed counters that are hardware based. We can think of these as physically existing. Most timers these counters can count up, down or up and down.TIMERS These also do not physically exist. They come in many varieties and increments. The most common type is
12、 an on-delay type. Other include off-delay and both retentive and non-retentive types. Increments vary from 1ms through 1s.OUTPUT RELAYS-(coil) These are connected to the outside world. They physically exist and send on/off signals to solenoids, lights, etc They can be transistors, relays, or triacs
13、 depending upon the model chosen.DATA STORAGE-Typically there are registers assigned to simply store data. There are usually used as temporary storage for math or data manipulation. They can also typically be user power-up they will still have the same contents as before power war removed. Very conv
14、enient and necessary!Step 1-CHECK INPUT STATUS-First the PLC takes a look at each input to determine if it is on or off. In other words, is the sensor connected to the first input on? How about the second input? How about the third Itrecords this data into its memory to be used during the next step.
15、Step 2-EXECUTE PROGRAM-Next the PLC executes your program one instruction at a time. Maybe your program said that if the first input was on then it should turn on the first output. Since is already knows which inputs are on/off from the previous step, it will be able to decide whether the first outp
16、ut should be turned onbased on the state of the first input. It will store the execution results for use later during the next step.Step 3-UPDATE OUTPUT STSTUS-Finally the PLC updates the status ofoutputs. It updates the outputs based on which inputs were on during the first step and the results of
17、executing your program during the second step. Based on the example in step 2 it would now turn on the first output because the first input was on and your program said to turn on the first output when this condition is true.After the third step the PLC goes back to step one and repeats the steps co
18、ntinuously. One scan time is defined as the time is takes to execute the 3 steps listed above. Thus a practical system is controlled to perform specified operations as desired.The AT89S52 is a low-power, high-performance CMOS 8-bit microcontrollerwith 8Kbytes of in-system programmable Flash memory.
19、The device is manufacturedusing Atmel s highdensity- nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin-out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatilememory programmer. By combining
20、a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.The AT89S52 provides the following standard features: 8K bytes of Flash, 25
21、6 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port,on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency
22、and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM,timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the n
23、ext interrupt or hardware reset.Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When is written to port 0 pins, the pins can be used as high-impedance inputs.Port 0 can also be configured to be the multiplexed lowered address/data bus duri
24、ng accesses to external program and data memory. In this mode, P0 has internal pull-ups.Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification.Port 1 is an 8-bit bidirectional I/O
25、 port with internal pullups.The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (I IL) because of the in
26、ternal pull-ups.In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX).PLC 和微处理器简介PLC(可编程逻辑控制器 )是极限控制中为代替必要的继电器时序电路而发明的一种设备。 PLC 工作时通过查询输入端并根据其状态打开或关闭输出。 用户通常用软件或编程器输入程序,从而或得期望的结果。很多实际应用都采用PLC。工业生产中应用PLC
27、 的可能性很高。如果你正在进行机械制造,产品包装,材料处理,自动化装配及无数其他工业生产,你可能已经用到了 PLC。如果你没有用到, 那就是在浪费金钱和时间。 几乎所有需要电气控制的地方都需要PLC。例如,假定在开关闭合时我们需要一个线圈接通 5 秒然后不管开关接通多长时间都将线圈断开。 我们可以通过一个简单的外部定时器来实现。 但是加入该过程有十个开关和线圈呢?我们就需要十个外部定时器。 如果这个过长分别记录每个开关开启的次数呢?我们又需要很多外部计数器。由此可见,系统越大,我们就越需要 PLC。我们可以简单地用 PLC 编程来对输入信号进行技术,并在规定的时间接通线圈。我们考察一下哪些是
28、PLC 中最常用的 20 条指令。保守地估计一下,如果镇长地掌握了这些指令,就能解决 80%以上现存的应用问题。是的, 80%以上!当然,我们要学习的指令比这些更多,以帮助你解决几乎所有潜在的 PLC 应用问题。PLC 主要由中央处理器 (CPU),存储器和输入,输出电路构成,我们可以将 PLC 看成是一个装满了成百上千个独立的继电器, 计数器,定时器,以及数据存储器的盒子。这些计数器,定时器,定时器等是不是真的存在呢?不,它们都是模拟的,物理上并不存在,但可以将它们看长是软计数器,软定时器。这些内部继电器是用寄存器中的单元模拟出来的。各个部分是如何工作的呢?输入继电器 (触点 )这些继电器连
29、接外部电路。它们是实际存在的,并接受来自开关,传感器等的信号,通常是晶体管而非继电器。内部通用继电器 (触点 )它们不从外部设备接受信号,也非物理上存在的。它们是模拟的继电器,用以消除 PLC 的外部继电器。此外还有一些特殊继电器,专门执行一项任务。 其中一些是常开的, 一些是常闭的。 有一些仅在电源上电时导通一次,通常用来初始化存储的数据。计数器它们也并非物理上存在的,而是模拟的计数器,可通过编程来对脉冲进行计数。 通常它们可进行加计数, 减计数或同时进行加减计数。因为它们是用软件模拟的, 计数速度就有限。 一些制造商提供了基于硬件的高速计数器,这样的计数器可以认为是物理上存在的。 这些计数
30、器多数情况下可以进行加计数减计数或同时进行加减计数。定时器它们也并非物理上存在的,分为多种类型和定时单位。 最常用的一种类型是延时导通型。 其他类型还有延时断开型, 记忆和非记忆型。 定时单位的范围是 1MS 到 1S输出继电器 (线圈 ) 该部分连接到外围电路。它们是物理上存在的,并给线圈,灯等发送开关信号。输出继电器也可以是晶体管,继电器或可控硅,取决于选择的型号。数据寄存器它们通常是用来存储数据的寄存器,一般作为运算或数据处理的暂存器。在 PLC 断电时通常还可以用来存储数据。再次接通电源后,其内容与断电前相同,非常方便且必要。PLC 是通过连续扫描一个程序来工作的。我们可以认为扫描周期
31、是由三个主要阶段组成的。 如图所示。当然有多余三个阶段的情况, 但我们可关注重要的环节,忽略其他环节。 其他阶段通常正在检查系统及更新内部计数器和定时器的当前值。第一步 -检查输入状态 -首先 PLC 检查每一个输入是否接通。换句说就是,与第一个输入端连接的传感器接通了吗?第二哥输入呢?第三个输入呢?PLC 将这些数据记录到存储器中,以便在下一个阶段使用。第二步 -执行程序 -然后 PLC 一次一条地执行程序。你的程序可能要求第一个输入接通时, 接接通第一个输出。 因为在上一步已经知道输入端的开关状态,根据上一步输入端的状态, 就可以确定是否应该接通第一个输出。 PLC 将执行结果存储起来,以供下一步使用。第三步 -更新输出状
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年西藏自治区中小学教师招聘考试模拟试题及答案详解
- 2026年宜昌市点军区街道办人员招聘笔试参考题库及答案详解
- 2026年宜宾市翠屏区中小学教师招聘考试模拟试题及答案详解
- 2026年江西省九江市街道办人员招聘考试备考试题及答案详解
- 2025年西安市临潼区中小学教师招聘考试试题及答案详解
- 2026年徐州市泉山区中小学教师招聘笔试参考题库及答案详解
- 2026年唐山市开平区街道办人员招聘考试参考试题及答案详解
- 2026青海省烟草专卖局(公司)高校毕业生招聘(第二批)11人考试模拟试题及答案详解
- 2026年职业卫生检测仪器维护与保养考试试题及答案
- 2026年反兴奋剂知识参考题库附答案
- 塔顶钢架结构施工方案(3篇)
- 水利水电工程单元工程施工质量检验表与验收表(SLT631.6-2025)
- 2026年高考(湖北卷)语文试题及答案
- 餐厅施工项目组织方案范本
- 上海松江污水处理厂有限公司招聘笔试题库2026
- (正式版)DB51∕T 5070-2016 《四川省先张法预应力高强混凝土管桩基础技术规程》
- 黑龙江省哈尔滨市香坊区2025-2026学年七年级上学期期末语文试题(含答案)
- 患者走失的应急预案演练脚本范文
- 2026年TCL-TAS-人才测评校招专项评估备考题及答案解析
- 2025年大连辅警协警招聘考试备考题库及答案详解一套
- ESC心血管疾病和妊娠管理指南(2025版)课件
评论
0/150
提交评论