的指令系统

上传人:aa****6 文档编号:54282575 上传时间:2018-09-10 格式:PPT 页数:351 大小:5.35MB
返回 下载 相关 举报
的指令系统_第1页
第1页 / 共351页
的指令系统_第2页
第2页 / 共351页
的指令系统_第3页
第3页 / 共351页
的指令系统_第4页
第4页 / 共351页
的指令系统_第5页
第5页 / 共351页
点击查看更多>>
资源描述

《的指令系统》由会员分享,可在线阅读,更多相关《的指令系统(351页珍藏版)》请在金锄头文库上搜索。

1、回到主目录,Instruction set of CPM1A serials PLC,掌握PLC的基本指令、编制梯形图的注意事项;掌握分支程序的处理方法;掌握定时器/计数器指令;数据比较CMP指令; 数据传送MOV等指令。能够读懂梯形图程序和语句表程序,并能够互相转换;能够编写简单的梯形图程序。,3-1 概述 outline,1. CPM1A指令分类,直接对输入、输出进行操作。,进行数据处理、运算和程序控制等操作。,基本指令,应用指令,1. CPM1A Instruction classification,Operate input and output directly,do the fol

2、lowing operations :data processing, operation and program control,Basic instructions,Application instructions,2. CPM1A指令格式,助记符(指令码) 操作数1 操作数2 操作数3,助记符:表示指令的功能,指令码:是指令的代码,操作数:提供指令执行的对象或数据,2. CPM1A instruction format,助记符(instruction code) operand 1 operand 2 operand 3,助记符:specify instruction functiona

3、lity,instruction code:the codes of instruction,Operand: supply the object or data that instruction executes,操作数可以是通道号、继电器号或常数。,操作数的个数,取决于各种指令的需要。, 关于操作数的讨论,操作数设为常数时,在数据前面要加#号。,operand can be channel number, relay number, or constant,the number of operand lies on all kinds of instructions., discussio

4、n about operands,When operand is set to be constant, a # should be added before the data.,操作数采用哪种进制,取决于指令的需要。,间接寻址的操作数用*DM来表示。,间接寻址的操作数,是以DM中的数据为地址的另一个DM通道中的数据。,DM中 的 内容 必须是BCD码,且不得超出 DM区的范围。,which system the operand use, lies on the instructions.,operands of indirect addressing is denoted with *DM,

5、Operands of indirect addressing is the data in another DM channel of whose address is the data in DM.,The content of DM must be BCD code, and should not exceeds the range of DM section.,例如,计数器指令的格式为 CNT000SV,If SV = 200,表明000号计数器的设定值是200通道中的内容。 indicate that the value of 000 counter is the content o

6、f 200 channel.,if SV= # 0200,表明000号计数器的设定值是常数200。 Indicate the value of 000 counter is constant 200.,For example, the format of counter instruction is,例如:计数器的指令格式为 CNT000*DM1000,设DM1000的内容为0010,则 000号计数器的设定值是2500,设DM0010的内容为2500,如果设DM1000的内容为9990,如果设DM1000的内容08FA,超出DM范围,非BCD码,DM0000DM1023、DM6144DM66

7、55,间接寻址的操作数。,For example:the counter instruction format is CNT000*DM1000,suppose the content of DM1000 is 0010,then the value of 000 counter is 2500,suppose the content of DM0010 is 2500,if the content of DM1000 is 9990,is the content of DM1000 is 08FA,Exceed DM range,Non BCD code,DM0000DM1023、DM614

8、4DM6655,Operand of indirect addressing,3. 执行指令对标志位的影响,SR区的2550325507是指令执行结果的标志位。,某些指令的执行结果影响标志位2550325507的状态。,标志位25503 25507的状态表示的意义要牢记。,p.30,3. influence on flag bit,2550325507 in SR section is the flag bits of instruction execution results,Certain instruction execution results have effect on the s

9、tatus of 2550325507 flag bits,Keep in mind the meaning of 25503 25507 flag bits,p.30,ER(25503): 出错标志位。 25503 ON时,表示当前执行的程序出错且停止执行。 CY(25504):进位标志位 GR(25505):大于标志 EQ(25506):等于标志 LE(25507):小于标志,当执行指令END(01)时,以上标志均置为OFF,ER(25503): error bit。When 25503 is ON,indicate the program being executing go error

10、 and stop running. CY(25504):carry bit GR(25505):greater than bit EQ(25506):equal bit LE(25507):less than bit,4. 指令的微分、非微分形式,微分型:要在指令的助记符前加标记。,两种指令的区别,4. differential and non-differential form,Differential form:add marker before 助记符,Differences between two forms,非微分型指令:,只要其执行条件为ON,每个扫描周期都执行该指令。,微分型指

11、令:,仅在指令的执行条件由OFF变为ON时才执行一次。,Non-differential instructions:,As long as execution condition is ON, this instruction is executed every scanning period.,differential instructions:,Only execute once when the executing condition turn from OFF to ON,3-2 基本指令,LD 和 LD NOT 指令,LD: 常开触点与母线相连,LD NOT:常闭触点与母线相连,不影

12、响标志位,LD、LD NOT只能以位为单位进行操作,功能,3-2-1 常用的基本指令,LD and LD NOT,LD: opening spot connected with generatrix,LD NOT:closing spot connected with generatrix,Do not affect flag bits,LD、LD NOT can only be operated in bit,function,3-2-1 frequently used basic instructions,2. OUT 和 OUT NOT 指令,功能,OUT:指令输出逻辑运算结果,OUT

13、NOT:逻辑运算结果取反后输出,OUT 、 OUT NOT: 只能以位为单位进行操作,不影响标志位,IR,SR,HR,AR,LR,TC,TR,2. OUT and OUT NOT,function,OUT:output logic calculation results,OUT NOT:output logic calculation results after reversed,OUT 、 OUT NOT: can only do operation in bit,Do not affect flag bits,IR,SR,HR,AR,LR,TC,TR,(1). 若输出位为PLC的输出点,则

14、运算结果输出到PLC外部若输出位为PLC的内部继电器,则运算结果为中间结果,不输出到PLC外部。if the output bit is PLC output point, calculation result output to PLC exterior. If output bit is PLC internal relay, calculation result is midway result without being output to the exterior.,(2).线圈并联输出时,可以连续使用OUT、OUT NOT。when the loop output in paral

15、lel ,OUT、OUT NOT can be used in series.,说明note,例:,LD 00000 OUT 01000 OUT NOT 01001 LD NOT 00001 OUT 01002,连续使用,3. AND , AND NOT,function,AND:表示常开触点与前面的触点电路相串联,或者说AND后面的位与前面的状态进行逻辑“与”运算。,IR,SR,HR,AR,LR,TC,TR,AND:denote opening spot connected with anterior spot in series,that is to say, the bit after AND does logic “and” operation with anterior status.,AND NOT:表示常闭触点与前面的触点电路相串联,或者说AND NOT后面的位取“反”后与前面的状态进行逻辑“与”运算。,

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > PPT模板库 > PPT素材/模板

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号