1、系LC系LC系LC系LC?必0年息必0年息必0年息必0年息?年 年 年 年?www.PLCwww.91HMI.comThe Implementation of Timer The Implementation of Timer The Implementation of Timer The Implementation of Timer Function Based on the Siemens Function Based on the Siemens Function Based on the Siemens Function Based on the Siemens S7-300 Ser
2、ies PLCS7-300 Series PLCS7-300 Series PLCS7-300 Series PLC?S描始息00S描始息00S描始息00S描始息00?系LC系LC系LC系LC?www.PLCwww.91HMI.com?PLC?www.PLCwww.91HMI.com1.1?SIEMENS S7-300 PLC?CPU?烁累节?清I展类?I展类?而程?www.PLCwww.91HMI.com?应输闪t?式Byte式Byte?1.2?PLC?模?因?增?是是是?s模式用?描程态?而www.PLCwww.91HMI.com?1.2?PLC?FX2OMRON?C?ON?Off?FX2
3、SIEMENS SP?TONTOFwww.PLCwww.91HMI.com?PLC?1?2?3?4?www.PLCwww.91HMI.com2.1?必?年?而?展而而?而累展而特?而环?www.PLCwww.91HMI.com2.1?S7-300?(而累)(而累)(而累)(而累)?(而特)(而特)(而特)(而特)?(而?)(而?)(而?)(而?)?(而而)(而而)(而而)(而而)?(而环)(而环)(而环)(而环)式扩描式扩描式扩描式扩描?扩 扩 扩 扩?www.PLCwww.91HMI.com?1?SD?类等类等类等类等?2.1.1?www.PLCwww.91HMI.com2.1.1?X0T1
4、SDS5T#10ST1Y0?1?(E01)www.PLCwww.91HMI.com2.1.1?X0T1SDS5T#10S?2?(E02_1)M0M0X1T1Y0www.PLCwww.91HMI.com?2?SS?类等类等类等类等?2.1.1?www.PLCwww.91HMI.comX0T1SSS5T#10S?2?(E02_2)T1Y0X1T1R2.1.1?www.PLCwww.91HMI.com?3?(E03_1)2.1.1?X0T0SDS5T#10SY0X0T0www.PLCwww.91HMI.com?3?SP?类ff类ff类ff类ff?2.1.1?www.PLCwww.91HMI.comS
5、5T#10SX0T0SPY0T0?3?(E03_2)2.1.1?www.PLCwww.91HMI.comX1T1SDS5T#10SY1?4?(E04_1)2.1.1?Y1T1www.PLCwww.91HMI.com?4?SE?类ff类ff类ff类ff?2.1.1?www.PLCwww.91HMI.comX1T1SES5T#10SY1T1?4?(E04_2)2.1.1?www.PLCwww.91HMI.com?5?(E05_1)2.1.1?M0Y0T0SDS5T#10SM2M2X0NM1M0X0M0T0T0www.PLCwww.91HMI.com?5?SF?能类环能类环能类环能类环?2.1.1?
6、www.PLCwww.91HMI.com?5?(E05_2)T0Y0X0T0SFS5T#10S2.1.1?www.PLCwww.91HMI.com2.1.1?SPSESDSSSF?,?,类ff类ff类ff类ff?,类等类等类等类等?能类环能类环能类环能类环www.PLCwww.91HMI.com?6?(?/?)(E06)X0T0SDS5T#2ST1T1T0SDS5T#1SY0能?能?能?能?能应能应能应能应能应能应能应能应?能?能?能?能?2.1.2?www.PLCwww.91HMI.com2.1.2?7?(E07)T0T1SDS5T#10msT0SDS5T#2s990msX0C0SCC#5C
7、0CDY0C0C0X0RT1X0C0www.PLCwww.91HMI.com2.1.2?8?(E08)T1T2SDS5T#5SY0X0Y2T1X0T0SDS5T#5ST0T1SDS5T#5ST2Y1T0T0T1www.PLCwww.91HMI.com?必?年?系LC?2?1?2?2.2?1?www.PLCwww.91HMI.com必0年息始年始据必无?OB?-?-?0?27?-?FB?-?-?FC?-?-?DB?-?DB?-?SFB?-FB?CPU?SFC?-FC?CPU?SDB?-?1.?2.2.1 PLC?www.PLCwww.91HMI.com必0年息始年始据息0?类B类B类B类B?烁累
8、节烁累节烁累节烁累节?OB1FCFBSFCSFB?OBsFCFB?2?2.2.1 PLC?www.PLCwww.91HMI.com必0年息始年始据息年OB 10.17(?器 器 器 器OB 80.87(?器 器 器 器OB 20.23(?器 器 器 器?OB 30.38(?)?OB 40.47(?器 器 器 器?OB 102OB 100OB 101?OB 1OB 121,122(?器 器 器 器?,OB?,OB2.2.1 PLC?www.PLCwww.91HMI.com2.2.2?类B应?类B应?类B应?类B应?类B应提类B应提类B应提类B应提类B态?类B态?类B态?类B态?类B态新类B态新类
9、B态新类B态新www.PLCwww.91HMI.com必0年息始年始据息息?1?(OB10?OB17)?8?SFC28SFC31?HWConfig=CPU?2.2.2?www.PLCwww.91HMI.com必0年息始年始据息意?9?:?(E09)www.PLCwww.91HMI.com必0年息始年始据息技?2?OB30?OB38?HWConfig=CPU?OB?OB35?SFC39SFC42?2.2.2?RUNOB35OB35OB35IntervalOOB1B1OB1OB1OB1OB1OB1OB1IntervalIntervalwww.PLCwww.91HMI.com必0年息始年始据息据?1
10、0?(E10)www.PLCwww.91HMI.com2.3?1:1?,?CPU?:www.PLCwww.91HMI.com必0年息始年始据息方?11?(E11)www.PLCwww.91HMI.com2.4?CPU?PLC?CPU?OB1?:OB1_PREV_CYCLE?www.PLCwww.91HMI.com必0年息始年始据意0?1?FB1?100ms?I:IN_T_S=OB1_PREV_CYCLE Time_Base=100M:Counter_m=Counter_m+IN_T_S SCR=Counter_m-C_100msec if (SCRTime_Base)C_100msec=C_1
11、00sec+Trunc(SCR/Time_Base)*Time_Base SCR=Trunc(SCR/Time_Base)O:Out_100msec=Out_100msec+SCR?应?ms?应?ms?应?ms?应?ms?2.4?www.PLCwww.91HMI.com必0年息始年始据意年0000041400180480909039040321Out_100msec300200100C_100msec11501100113050SCRIN_T_SCounter_m505080130702001503502.4?www.PLCwww.91HMI.com必0年息始年始据意必2.4?L#IN_T_S
12、 L 0 -I JMZ M001 L#IN_T_S L#Counter_m +I T#Counter_m L#C_100msec -I T#SCR L#Time_Base -I JMZ M001?环B应环B应环B应环B应?L#SCR L#Time_Base /I L#Time_Base *I L#C_100msec +I T#C_100msec L#SCR L#Time_Base /I T#SCR L#Out_100msec +I T#Out_100msecM001:NOP 0www.PLCwww.91HMI.com必0年息始年始据意息?2?FC1?ON?I:Enabled=True Time
13、r_Set=100 Time_Count=FB1.Out_100msec Acc_M=MW10 Acc_T=MW12M:if(Acc_M=0)Acc_M=Time_Count Acc_T=Time_Count-Acc_M if (Acc_TTimer_Set)O:Out_timer=True?ON?2.4?www.PLCwww.91HMI.com必0年息始年始据意意2.4?A#Enabled JC M001 L 0 T#Acc_M R#Out_Timer JU M000M001:L#Acc_M L 0 -I JN M002 L#Time_Count T#Acc_M?环烁应环烁应环烁应环烁应?M
14、002:L#Time_Count L#Acc_M -I T#Acc_T L#Timer_Set -I JM M000 S#Out_TimerM000:NOP 0www.PLCwww.91HMI.com必0年息始年始据意技?12?(E12)CALL FB 1,DB1 IN_T_S :=#OB1_PREV_CYCLE Time_Base :=100 Out_100msec:=C_100msec A X0 AN T_1 =X_0 CALL FC 1 Enabled :=X_0 Timer_Set:=100 Time_Count:=C_100msec“Acc_M :=MW12 Acc_T :=MW14 Out_Timer:=T_0CALL FC 1 Enabled :=T_0 Timer_Set:=100 Time_Count:=C_100msec Acc_M :=MW16 Acc_T :=MW18 Out_Timer:=T_1 A T_0 =Y0?www.PLCwww.91HMI.com?年?必?意?息?大?PID?www.PLCwww.91HMI.comwww.PLCwww.91HMI.com
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1