GEFanucPLC90-70指令培训GEFanucAutomationShanghaiOfficeV2.00继电器控制电路R9REV_PBFWD_PBSTOP_PBR1390940MTR_FWDR9MTR_REVR13L1L2PLC工作原理I1I2I3I4I5I6Q1Q2Q3Q4Q5Q6000000010000CPU输出地址%Q输入地址%IQ1()Q2()I1I1I2Q2用户程序数据储存(%M,%R,...)I1I2I3I4I5I6I7I8COM输入模块输出模块Q1Q2Q3Q4Q5Q6Q7Q8COM123输入扫描执行程序输出刷新通讯服务123编程语言1。指令助记符(IL)2。梯形图(LD)3。顺序功能图(SFC)4。“C”语言,“BASIC”语言5。状态逻辑系列90PLC编程语言•指令语句编程•继电器梯形图(RelayLadderLogic)编程•顺序流程图(SFC)编程•状态逻辑语言编程•支持用C语言编程•开发复杂的控制算法•C程序代码比梯形图程序快4-6倍系列90PLC编程与组态•LM90——Windows下DOS窗口•CC90——Windows98/NT•VersaPro——Windows98/NT串行通讯手持式编程器RS485编程口以太网RS232/RS485转换器S90-30PLCS90-70PLC仅支持S90-30341以下CPU计算机+编程软件:外部地址GEPLC地址表示形式%I%Q%AI%AQ位(bit)地址字(word)地址内部地址%M%G%T%R中间继电器—位地址——寄存器—字地址地址数为自然数——例如“%R0326”%P%L%U%UR%S%AI00326表示地址地址类型地址号——程序寄存器—字地址——局部寄存器—字地址——无定义变量——系统变量指令分类——按形式分2.功能块1.继电器触点线圈——()EnableOK输入参数I1I2I3输出参数Q功能数据类型地址%R条件长度指令分类——按功能分1.继电器功能2.定时器/计数器3.算术运算功能4.关系运算功能5.位操作功能6.数据传送功能7.数据表格功能8.转换功能9.控制功能继电器和基本编程RelayandBasicProgrammingSeries90-70指令教程RELAYF1ShiftZCREV_PBFWD_PBSTOP_PBFCMTR_FWDZCMTR_REVL1L2FC|%I0003%I0001%I0002%Q0001+--]/[--+--][--+--]/[-----------------------()--|||||%Q0001||+--][--+||||%I0001%I0002%Q0002|+--]/[--+--][--+-------------------()--|||||%Q0002||+--][--+继电器控制电路ZCREV_PBFWD_PBSTOP_PBFCMTR_FWDZCMTR_REVL1L2FC+——()—(/)—(S)—(R)—+—()—()继电器指令基本元素—(M)—(/M)—(SM)—(RM)触点线圈—[FAULT]——[NOFLT]——[HIALR]——[LOALR]—定时器和计数器TimersandCountersSeries90-70指令教程TMRCTRofdtF2Shift•Watch-DogTimer•ConstantSweepTimer•Time-of-DayClock•ElapsedTimeClock•TimeTickContacts系统时间SystemTimers定时器TMRCTRofdt12345678910RELAYTMRCTRondtrofdttmrtmbaseMATHTABLECONTRLTCONVRTOPNSPPDATAMdnctrBITOPupctrRELATF2Shift保持型延时接通定时器RPVCVONDTR1.00s???????F1延时断开定时器PVCVOFDT1.00s???????F2延时接通定时器PVCVTMR1.00s???????F3延时接通定时器TimerTMR0.1S0.01S0.001SPV%R????Address预置值—()输出端当前值预置值控制字%R%R+1%R+2连续三个R寄存器时基延时时间t=预置值×时基%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONST输入端例如:%R0001,或常数:00050例如:%R0001~%R0003CV当前值延时接通定时器Timer输出端预置值Enable其工作波形图如下:输入端输出端计时值预置值TS延时断开定时器TimerOFDT0.1S0.01S0.001SPV%R????Address预置值—()输出端输入端当前值预置值控制字%R%R+1%R+2连续三个R寄存器时基延时时间t=预置值×时基%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTCV当前值延时断开定时器Timer其工作波形图如下:输入端输出端计时值预置值TS输出端预置值OFDT0.1SPV%R0001输入端ONDTR0.1S0.01S0.001SPV%R????Address预置值—()输出端输入端当前值预置值控制字%R%R+1%R+2连续三个R寄存器时基延时时间t=预置值×时基%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTR复位保持型定时器TimerCV当前值保持型定时器Timer其工作波形图如下:输入端输出端计时值预置值TST1T2TS=T1+T2输出端预置值ONDTR0.1SPV%R0001输入端复位R复位端UpCounterDownCounterUserProgrammedCountersTMRCTRofdtF2Shift12345678910RELAYTMRCTRondtrofdttmrtmbaseMATHTABLECONTRLCONVRTOPNSPDATAMdnctrBITOPupctrRELAT90464F4F5RPVCVUPCTR???????RPVCVDNCTR???????PV%R????Address预置值—()输出端输入端当前值预置值控制字%R%R+1%R+2连续三个R寄存器%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTR复位计数器CounterUPCTRDNCTRCV当前值数学运算指令MathOperationsSeries90-70指令教程MATHmulF3ShiftF3MATHShiftMathGroupAdditionF112345678910RELAYMATHaddsubmulmoretypesabsTMRCTRTABLECONTRLCONVRTOPNSPsqrtDATAMmodBITOPdivRELAT90417SubtractionF2MultiplicationF3DivisionF4MathGroupModuloDivisionSquareRootAbsoluteValue(Continued)F3MATHShiftF59041712345678910RELAYMATHaddsubmulmoretypesabsTMRCTRTABLECONTRLCONVRTOPNSPsqrtDATAMmodBITOPdivRELATF6F7算术运算(1)ArithmeticFunctionEnableADDSUBMULDIVMODINTUINDDINTREALMIXED%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTI2OK%I,%Q,%M,%T,%G不能用于REALQ%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTI1ADD:Q=I1+I2SUB:Q=I1-I2MUL:Q=I1*I2DIV:Q=I1/I2MOD:Q=I1-((I1/I2)*I2)%I,%Q,%M,%T,%G,%R,%AI,%AQ算术运算(2)ArithmeticFunctionEnableSQRTABSINTDINTREALOK%I,%Q,%M,%T,%G,%R,%AI,%AQQ%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTI1SQRT:Q=INABS:Q=|I1|三角函数EnableSINCOSTANASINACOSATANREALOK%R,%AI,%AQ,CONSTINQ%R,%AI,%AQ对数,指数功能EnableLOGLNEXPEXPTREALOK%R,%AI,%AQ,CONSTINQ%R,%AI,%AQEXP:Q=eINLN:Q=ln(IN)LOG:Q=log(IN)TXPT:Q=I1I2指数功能EnableLOGLNEXPREALOK%R,%AI,%AQ,CONSTI2Q%R,%AI,%AQ%R,%AI,%AQ,CONSTI1EXP:Q=I1I2数据转换指令DataOperationsCONVRTF8ShiftSeries90-70指令教程F8CONVRTShiftConvertGroupConvertGroup(Continued)DESTINATIONDATATYPESF3F1F2=MOREIN??????????????QUINT_TO_INTBCD-4F4F5F6F7F8F9BCD-8UINTINTDINTREALINTDINTConvertGroupSTARTINGDATATYPESF2F10F3F4F5F6F7F8F1F9F1F2F3types==BIT=BYTE=WORD=DWORD=UINT=INT=DINT=REAL=MORE=BCD-4=BCD-8=MIXED(Continued)IN??????????????QUINT_TO_INTConvertGroupEndDataTypeStartDataTypeBITBYTEWORDDWORDUINTINTDINTREALBCD-4BCD-8MixedBCD-4BCD-8UINTINTDINTREALINTDINT(Continued)数据转换(1)Enable%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTINTDINTTOBCD4BCD8INOK%I,%Q,%M,%T,%G,%R,%AI,%AQQ数据转换(2)Enable%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTBCD4BCD8TOINTDINTINOK%I,%Q,%M,%T,%G,%R,%AI,%AQQ数据转换(3)Enable%R,%AI,%AQ,CONSTINTUINTDINTINOK%I,%Q,%M,%T,%G,%R,%AI,%AQQREALTO数据转换(4)Enable%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTINTUINTDINTBCD4BCD8INOK%R,%AI,%AQQTOREAL数据转换(5)Enable%R,%AI,%AQ,CONSTREAL_TRUN_INOK%I,%Q,%M,%T,%G,%R,%AI,%AQQ例如:IN=235.85Q=235IN=-53.12Q=-53INTDINT比较指令RelationalOperationsSeries90-70指令教程RELATNF4ShiftF4RELATNGreaterThanorEqualToShiftRelationalGroupEqualF1NotEqualF2GreaterThanF3F4RelationalGroupRangeF4RELATNShiftLessThanorEqualToF6LessThanF5CompareF7F8(Continued)比较功能(1)ComparisonFunctionEnableEQNEGTGELTLEINTUINTDINTREAL%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTI2Q%I,%Q,%M,%T,%G,%R,%AI,%AQ,CONSTI1——()I1=I2I1≠I2I1I2I1≥I2I1I2I1≤I2比较功能(2)ComparisonFunctionEnableRANGEINTUINTDINTREAL%I,%