CPM1A的指令系统.ppt
《CPM1A的指令系统.ppt》由会员分享,可在线阅读,更多相关《CPM1A的指令系统.ppt(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 follow
2、ing 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 functionality,inst
3、ruction 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.,discussion about operan
4、ds,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,Operands of indirec
5、t 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.,例如,计数器指令的格式为 CNT000 SV,If SV=200,表明000号计数器的设定值是200通道中的内容。indicate that the value of 000 counter is the content of 200 channel.,if SV=#
6、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、DM6144DM6655,间接寻址的操作数。,For example:t
7、he 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、DM6144DM6655,Operand of indirec
8、t 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 status of 2550325507 flag bit
9、s,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 and stop running.CY(25504):carry b
10、itGR(25505):greater than bitEQ(25506):equal bitLE(25507):less than bit,4.指令的微分、非微分形式,微分型:要在指令的助记符前加标记。,两种指令的区别,4.differential and non-differential form,Differential form:add marker before 助记符,Differences between two forms,非微分型指令:,只要其执行条件为ON,每个扫描周期都执行该指令。,微分型指令:,仅在指令的执行条件由OFF变为ON时才执行一次。,Non-different
11、ial 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:常闭触点与母线相连,不影响标志位,LD、LD NOT只能以位为单位进行操作,功能,3-2-1 常用的基本指令,
12、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 NOT:逻辑运算结果取反后输出,OUT、OUT NOT:只能以位为单位进行操作,不影响标志
13、位,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的输出点,则运算结果输出到PLC外部 若输出位为PLC的内部继电器,则运算结果为中间结果,不输出到PLC外部。if t
14、he 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 parallel,OUT、OUT NOT can be used in series.,说明note,例:,LD 000
15、00OUT 01000OUT NOT 01001LD NOT 00001OUT 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:表示常闭触
16、点与前面的触点电路相串联,或者说AND NOT后面的位取“反”后与前面的状态进行逻辑“与”运算。,AND NOT:denote closing spot connect,that is to say,the bit after AND NOT get reversed and do logic“and”operation with the former status.,例:,LD 00000AND 00001OUT 01000LD 00000AND NOT 01000OUT 01001,说明note,(1).AND、AND NOT只能以位为单位进行操作,且不影响标志。AND、AND NOT c
17、an only be operated in bit,and do not affect flag.,(2).串联的触点数没有限制。No limitation with series-wound spot numbers.,例:两种输出形式,以上两图逻辑功能相同,但是(b)图用语句表编程繁琐,应尽量避免。,(a)连续输出 LD 00000 AND 00001 OUT 01000 AND 00002 OUT 01001,(b)连续输出次序颠倒 LD 00000 AND 00001 AND 00002 OUT 01001 LD 00000 AND 00001 OUT 01000,连续输出,For
18、example:two output forms,(a)连续输出 LD 00000 AND 00001 OUT 01000 AND 00002 OUT 01001,(b)连续输出次序颠倒 LD 00000 AND 00001 AND 00002 OUT 01001 LD 00000 AND 00001 OUT 01000,output in series,The above figures have the same logic functionality,but(b)using sentence table program which is trivial and should be avo
19、ided.,4.OR,OR NOT,function,OR:表示常开触点与前面的触点电路相并联,或者说OR后面的位与前面的状态进行逻辑“或”运算。,IR,SR,HR,AR,LR,TC,TR,OR:denote open spot connected with the anterior spot in parallel,that is to say,the bit after OR do“OR”operation with former status.,OR NOT:表示常闭触点与前面的触点电路相并联,或者说OR NOT后面的位取“反”后与前面的状态进行逻辑“或”运算。,说明(1).OR、OR
20、NOT只能以位为单位进行操作,且不影响标志。(2).并联的触点数没有限制。,note(1).OR、OR NOT can only be operated in bit,and do not affect flag.(2).No limitation with series-wound spot numbers.,OR NOT:denote closing spot connected with the anterior circuit in parallel,that is to say,the bit after OR NOT get reversed and then do logic“O
21、R”operation with the former status.,LD 00000OR 00001OUT 01000LD 00000OR NOT 00003OUT 01001,例:,5.结束指令END(01),功 能,表示程序结束。是程序的最后一条指令。END(01)后面的指令一概不执行。,利用END指令插在各程序段之间,可以进行分段调试。,无执行条件,5.END(01),function,Without execution condition,its the last instruction of a program,denoting the end of a program,inst
22、ructions after END(01)are not executed without exception.,Using END instruction which is inserted between program sentences,to debug section by section.,若程序中没有END指令,则PLC不执行程序,并显示出错信息:“NO END INST”。,执行END指令时,ER、CY、GR、EQ、LE标志置为OFF。,PLC does not execute program without the instruction END,and display t
23、he sentence:“NO END INST”。,When the instruction END executes,ER、CY、GR、EQ、LE flag bits are set OFF,6.空操作指令NOP(00),无梯形图符号、无操作数,功能:用来取消某一步操作。常用于修改梯形图。,改为:,LD 00000AND 00001OUT 01000,LD 00000NOP(00)OUT 01000,使步序号变更更少。,例如:,6.NOP(00),Convert to:,LD 00000AND 00001OUT 01000,LD 00000NOP(00)OUT 01000,Make ste
24、p sequence much less,example:,Function:to cancel a certain operation,commonly used to modify trapezoid diagram.,without trapezoid diagram symbol and operand,1.AND LD,功能:用于逻辑块串联连接,即对逻辑块进行逻辑“与”的操作。,3-2-2 AND LD,OR LD,Function:be used to logic block series connection,that is to do logic“and”operation o
25、n logic blocks.,(1).每个逻辑块都以LD或LD NOT 指令开始。(2).AND LD指令单独使用,后面没有操作数。(3).使用这条指令有两种方法:分置法和后置法。两种方法可以得到相同的运算结果,但使用分置法时触点组数是没有限制的,而采用后置法时触点组数不能超过8。,注 意note,(1).Every logic block starts with LD or LD NOT(2).AND LD is employed solely without operand.(3).two usage of this instruction:分置法and后置法.The same resu
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CPM1A 指令系统
链接地址:https://www.31ppt.com/p-5423601.html