《可编程序控制器-5.ppt》由会员分享,可在线阅读,更多相关《可编程序控制器-5.ppt(15页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、7.栈存储器与多重输出指令MPSMPS(Memory Push)(Memory Push)进栈指令进栈指令MRDMRD(Memory Read)(Memory Read)读栈指令读栈指令MPSMPS(Memory Pop)(Memory Pop)出栈指令出栈指令 X1X1X2X2M100M100Y1Y1M102M102Y0Y0X3X3M100M100Y3Y3M105M105Y2Y2LDILDIX1X1MPSMPSANDANDX2X2MPSMPSANIANIM100M100OUTOUTY0Y0MPPMPPANDANDM102M102OUTOUTY1Y1MPPMPPANDANDX3X3MPSMPS
2、ANDANDM100M100OUTOUTY2Y2MPPMPPANDANDM105M105OUTOUTY3Y38.主控与主控复位指令MCMC(Master Control)(Master Control)主控指令主控指令(公共触点串联公共触点串联)MCRMCR(Master Control Reset)(Master Control Reset)主控复位指令主控复位指令说明说明:编程元件编程元件Y Y和和MMX0X0Y1Y1X1X1X3X3Y2Y2MCMCN0N0M100M100MCRMCRN0N0M100M100LDLDX0X0MCMCN0N0SPSPM100M100LDLDX1X1OUTOU
3、TY1Y1LDLDX3X3OUTOUTY2Y2MCRMCRN0N0多重嵌套主控指令多重嵌套主控指令多重嵌套主控指令多重嵌套主控指令X0X0Y0Y0X1X1X4X4Y2Y2M100M100X2X2M101M101X3X3Y1Y1MCMCN0N0M100M100MCMCN1N1M101M101MCRMCRN1N1MCRMCRN0N0Y3Y3X5X5(A(A)(B(B)(C(C)(B(B)(A(A)LDLDX0X0MCMCN0N0SPSPM100M100LDLDX1X1OUTOUTY0Y0.LDLDX2X2MCMCN1N1SPSPM101M101LDLDX3X3OUTOUTY1Y1MCRMCRN1N
4、1LDLDX4X4OUTOUTY2Y2MCRMCRN0N0LDLDX5X5OUTOUTY3Y39.取反指令INVINV(Inverse)(Inverse)该指令前的运算结果取反。该指令前的运算结果取反。0 10 1 1 0 1 0X1X1Y0Y0LDLDX1X1INVINVOUTOUTY0Y010.PLS与PLF指令PLSPLS(Pulse):(Pulse):上升沿微分输出指令上升沿微分输出指令PLFPLF:下降沿微分输出指令下降沿微分输出指令说明说明:只能用于编程元件只能用于编程元件Y Y和和MMPLSPLSM0M0X0X0SETSETY0Y0M0M0PLFPLFM1M1RSTRSTY0Y0
5、M1M1X1X1LDLDX0X0PLSPLSM0M0LDLDM0M0SETSETY0Y0LDLDX1X1PLFPLFM1M1LDLDM1M1RSTRSTY0Y0X0X0X1X1M0M0M1M1Y0Y0一个扫描一个扫描一个扫描一个扫描周期周期周期周期11.SET与RST指令SETSET :置位指令置位指令RSTRST :复位指令复位指令说明说明:SET:SET:编程元件编程元件Y Y、MM和和S SRST:RST:编程元件编程元件Y Y、MM、S S、T T、C C、D DLDLDX0X0SETSETY0Y0LDLDX1X1RSTRSTY0Y0LDLDX2X2RSTRSTD0D0X0X0X1X1
6、Y0Y0SETSETY0Y0X0X0RSTRSTY0Y0X1X1RSTRSTD0D0X2X2计数器、定时器复位计数器、定时器复位 积分定时器和计数器积分定时器和计数器X1X1X0X0T250T250RSTRSTT250T250K1200K1200X2X2M8200M8200X4X4C200C200RSTRSTC200C200K34K34X3X3LDLDX0X0RSTRSTT250T250LDLDX1X1OUTOUTT250T250K K12001200LDLDX2X2OUTOUTM8200M8200LDLDX3X3RSTRSTC200C200LDLDX4X4OUTOUTC200C200SPSP
7、343412.NOP与END指令NOPNOP :空操作指令空操作指令ENDEND :结束指令结束指令LDLDX0X0MCMCN0N0SPSPM100M100LDLDX1X1OUTOUTY0Y0.LDLDX2X2MCMCN1N1SPSPM101M101LDLDX3X3OUTOUTY1Y1MCRMCRN1N1LDLDX4X4OUTOUTY2Y2MCRMCRN0N0LDLDX5X5OUTOUTY3Y3ENDENDENDENDENDEND13.编程注意事项双线圈输出双线圈输出在同一个程序中,同一编程元件的线圈使用了两次或两次以上在同一个程序中,同一编程元件的线圈使用了两次或两次以上X1X1Y0Y0X2
8、X2Y0Y0X4X4Y0Y0X1X1Y0Y0X2X2X4X4程序优化设计程序优化设计l l设计并联电路时,应将单个触点的支路放在下面;设计并联电路时,应将单个触点的支路放在下面;X1X1Y0Y0X2X2X4X4X1X1Y0Y0X2X2X4X4LDLDX2X2LDLDX1X1ANDANDX4X4ORBORBOUTOUTY0Y0LDLDX1X1ANDANDX4X4ORORX2X2OUTOUTY0Y0不好!不好!好!好!l l设计串联电路时,应将单个触点放在右边。设计串联电路时,应将单个触点放在右边。X1X1Y0Y0X2X2X4X4X1X1Y0Y0X2X2X4X4LDLDX2X2LDLDX1X1OR
9、ORX4X4ANBANBOUTOUTY0Y0LDLDX1X1ORORX4X4ANDANDX2X2OUTOUTY0Y0线圈放在最右边线圈放在最右边l l线圈并联电路中,应将单个线圈放在上边。线圈并联电路中,应将单个线圈放在上边。X2X2Y0Y0X1X1Y1Y1X1X1Y0Y0X2X2Y1Y1LDLDX1X1MPSMPSANDANDX2X2OUTOUTY0Y0MPPMPPOUTOUTY1Y1LDLDX1X1OUTOUTY1Y1ANDANDX2X2OUTOUTY0Y0线圈放在最右边线圈放在最右边X2X2Y0Y0X1X1Y1Y1X3X3X1X1X3X3Y1Y1X2X2Y0Y0错误!错误!小小 结结 LDLD、LDILDI、OUTOUT ANDAND、ANIANI OR OR、ORI ORI LDP LDP、LDF LDF、ANDPANDP、ANDFANDF、ORP ORP、ORFORF ORB ORB、ANB ANB MPS MPS、MRD MRD、MPP MPP MC MC、MCR MCRINVINVPLS PLFPLS PLFSET RSTSET RSTNOP ENDNOP ENDTHANK YOU