版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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、givesthedesiredresults.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 assemblyor countless other industries, you are probably already using them. If
3、you are not, you are wasting money and time. Almost any application that needssome typeof electrical control has needfor PLC.For example, let asssumethat when a 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 do thi
4、s with a simple external timer. What if the processalso neededto count how many times the switch individually turned on? We needa lot of external counters.As you can see,the bigger the process the moreof a need wehave for a PLC. We can simply program the PLC to count its inputs and turn the solenoid
5、s on for the specified time.We will take a look at what is consideredto be the “ top20”PLC instructions. It can be safely estimated that with a firm understandingof there instructions one can solve more than 80%of the applications in existence.Thatsright, more than 80%! Of course we ll learn more th
6、an 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 thousands of separater
7、elays, counters, timer and date storage locations. Do these counters, timers, etc. really exist? No, they dont “ physicall”y exist but rather they are simulated and can be considered software counters, timers, etc. Theseinternal relays are simulatedthrough bit locationsin registers.What does eachpar
8、t 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) Thesedo not receive signals from the outside world nor do the
9、y physically exist. They are simulated relays and are what enablesa PLC to eliminate external relays. There are also some special relays that are dedicatedto performing only one task. Some are always on while some are always off. Some are on only once during power-on and are typically user for initi
10、alizing data what was stored.COUNTERS These again do not physically exist. They are simulated counters and they can be programmedto count pulses. Typically these counters can count up, down or both up and down. Since there are simulated, they are limited in their counting speed. Some manufacturers a
11、lso include high-speed counters that are hardware based. We can think of these as physically existing. Most timers these counterscan count up, down or upand down.TIMERS These also do not physically exist. They come in many varieties and increments.The most common type is an on-delay type. Other incl
12、ude off-delay and both retentive and non-retentive types. Incrementsvary from 1ms through 1s.OUTPUT RELAYS-(coil) These are connected to the outside world. They physically exist and send on/off sig nals to sole no ids, lights, etc They can be transistors,relays, or triacs depending uponthe modelchos
13、en.DATA STORAGE-Typically there are registers assignedto simply store data. There are usually used astemporary 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 convenientand necessary!A PLC works b
14、y continually scanninga program. We can think of this scan cycle as consisting of 3 important steps, as shown in Fig.19.2 There are typically more than 3 but we can focus on the important parts and not worry about the others. Typically the others are checking the system and updating the current and
15、timer values.Step 1-CHECK INPUT STATUS-First the PLC takes a look at each input to determine ifit is on or off. In otherwords, isthesensorconnected tothefirst inputon? How about the sec ond in put? How about the third It records this data into its memory to beusedduring thenextstep.Step 2-EXECUTE PR
16、OGRAM-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 previousstep, it will be able to decidewhether the first output should be turned
17、 on based 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 of outputs. It updatesthe outputs basedon which inputs were on during the first step and the results of executing your prog
18、ram during the second step.Basedon 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 continuously. One scan
19、time is defined as the time is takes toexecutethe 3 steps listed above. Thusa practical system is controlledto perform specified operationsas desired.The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8Kbytes of in-system programmableFlash memory. The device is manufactured
20、 using Atmel shigh-density 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 nonvolatile memory programmer. By combining a versatile 8-bit CPU wit
21、h 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 embeddedcontrol applications.The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lin
22、es, 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 and supports two software
23、 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 Powerdown mode savesthe RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardwarer
24、eset.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-impedanceinputs.Port 0 can also be configured to be the multiplexed lowered address/data bus during accessesto external progr
25、am anddata memory. In this mode, P0 hasinternal 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 port with internal pullups.The
26、 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 (IIL) becauseof the internal pull-ups.In addition, P1.0
27、 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) andthe timer/counter 2 trigger input (P1.1/T2EX).PLC 和 微处理器简介PLC(可编程逻辑控制器)是极限控制中为代替必要的继电器时序电路而发明 的一种设备。PLC工作时通过查询输入端并根据其状 态打开或关闭输出。用户通 常用软件或编程器输入程序,从而或得期望的 结果。很多实际应用都采用PLC。工业生产中应用PLC的可能性很高。如果你正 在进行机械制造,产品包装,材料处理,自动化
28、装配及无数其他工 业生产,你可 能已经用到了 PLC。如果你没有用到,那就是在浪费金钱和时间。几乎所有需要 电气控制的地方都需要 PLC。例如,假定在开关闭合时我们需要一个线圈接通 5 秒然后不管开关接通多 长时间都将线圈断开。我们可以通过一个简单的外部定 时器来实现。但是加入该 过程有十个开关和 线圈呢?我 们就需要十个外部定 时器。如果这个过长分别记 录每个开关开启的次数呢?我 们又需要很多外部 计数器。由此可见,系统越大,我们就越需要PLC。我们可以简单地用PLC编程来对 输入信号 进行技 术,并在规定的 时间 接通线圈。我们考察一下哪些是 PLC 中最常用的 20 条指令。保守地估计一
29、下,如果镇 长地掌握了 这些指令,就能解决 80%以上现存的应用问题。是的, 80%以上!当然,我们要学习的指令比 这些更多,以帮助你解决几乎 所有潜在的 PLC 应用 问题。PLC主要由中央 处理器(CPU),存储器和输入,输出电路构成,我们可以将 PLC 看成是一个装 满了成百上千个独立的 继电器,计数器,定时器,以及数据存 储器的盒子。 这些计数器,定时器,定时器等是不是真的存在呢?不,它 们都是 模拟的,物理上并不存在,但可以将它 们看长是软计数器,软定时器。这些内部 继电器是用寄存器中的 单元模拟出来的。各个部分是如何工作的呢?输入继电器(触点)这些继电器连接外部电路。它们是实际存在
30、的,并接受来 自开关,传感器等的信号,通常是晶体管而非 继电器。内部通用 继电器(触点)它们不从外部 设备接受信号,也非物理上存在的。它 们是模拟的继电器,用以消除 PLC 的外部继电器。此外还有一些特殊继电器,专 门执行一项任务。其中一些是常开的,一些是常 闭的。有一些仅在电源上电时导 通一次,通常用来初始化存 储的数据。计数器 它们也并非物理上存在的,而是模 拟的计数器,可通过编程来对脉 冲进行计数。通常它们可进行加计数,减计数或同 时进行加减 计数。因为它们是 用软件模拟的,计数速度就有限。一些制造商提供了基于硬件的高速 计数器,这 样的计数器可以 认为是物理上存在的。这些计数器多数情
31、况下可以 进行加计数 减计数或同 时进行加减计数。定时器它们也并非物理上存在的,分 为多种类型和定时单 位。最常用的一种 类型是延 时导通型。其他类型还有延时断开型,记忆和非记忆型。定时单位的范 围是IMS到1S输出继电器(线圈) 该部分连接到外围电路。它们是物理上存在的,并 给线圈, 灯等发送开关信号。输出继电器也可以 是晶体管,继电器或可控硅,取决于 选择 的 型号。数据寄存器 它们通常是用来存 储数据的寄存 器,一般作为运算或数据 处理 的暂存器。在 PLC 断电时通常还可以用来存 储数据。再次接通 电源后,其内容与 断电前相同,非常方便且必要。PLC 是通过连续扫 描一个程序来工作的。我 们可以认为扫 描周期是由三个 主要阶段组成的。如图所示。当然有多余三个 阶段的情况,但我们可关注重要 的 环节,忽略其他环节。其他阶段通常正在检查系统及更新内部 计数器和定时器的 当前值。第一步 检查输 入状态首先 PLC 检查每一个输入是否接通。换句说就是,与第一个 输入端 连接的 传感器接通 了吗?第二哥 输入呢?第三个 输入呢? PLC 将这些数据记录到存储器中,以便在下一个 阶段使用。第二步 执行程序 然后 PLC 一次一条地 执行程序。你的程序可能要求第一个 输入接通 时,接接通第一个 输出。因为在上一步已 经知道输入端的开关 状 态,根据上一
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 奢侈品培训汽车
- 专业分包化标准精装修工程管理
- Windows Server网络管理项目教程(Windows Server 2022)(微课版)3.6 DHCP-任务5 DHCP客户端配置
- 语法选修课 高中英语 非谓语动词 A篇
- 江苏省徐州市铜山区2023-2024学年九年级上学期期中英语试卷(含答案解析)
- 第六章质量与密度基础练习题(含解析)2024-2025学年初中物理人教版八年级上册
- 2024至2030年中国干猪膀胱行业投资前景及策略咨询研究报告
- 2024至2030年中国多用途双面黏贴布带行业投资前景及策略咨询研究报告
- 2024至2030年中国保安单元壳数据监测研究报告
- 2024年山东省中考语文试题含解析
- 5个人股东合作协议书
- 轻质陶粒墙板项目立项申请报告
- 化工厂用电安全讲课
- 学术英语写作(本科)智慧树知到期末考试答案2024年
- 粮油质量检验-课件-项目四-小麦粉质量检验
- AQ2059-2016 磷石膏库安全技术规程
- 安全员继续教育考试题库1000道附参考答案(完整版)
- 2024年中储粮集团招聘笔试参考题库附带答案详解
- (2024年)保安培训图文课件
- 2023年《中职音乐》期末考试试卷及参考答案(卷)
- 中建八局项目管理策划方案
评论
0/150
提交评论