ORGANIZATION_BLOCK OB 1 TITLE = "Main Program Sweep (Cycle)" VERSION : 0.1 VAR_TEMP OB1_EV_CLASS : BYTE ; //Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1) OB1_SCAN_1 : BYTE ; //1 (Cold restart scan 1 of OB 1), 3 (Scan 2-n of OB 1) OB1_PRIORITY : BYTE ; //Priority of OB Execution OB1_OB_NUMBR : BYTE ; //1 (Organization block 1, OB1) OB1_RESERVED_1 : BYTE ; //Reserved for system OB1_RESERVED_2 : BYTE ; //Reserved for system OB1_PREV_CYCLE : INT ; //Cycle time of previous OB1 scan (milliseconds) OB1_MIN_CYCLE : INT ; //Minimum cycle time of OB1 (milliseconds) OB1_MAX_CYCLE : INT ; //Maximum cycle time of OB1 (milliseconds) OB1_DATE_TIME : DATE_AND_TIME ; //Date and time OB1 started END_VAR BEGIN NETWORK TITLE = A I 0.0; FP M 0.0; JNB _001; CALL SFC 32 ( OB_NR := 20, DTIME := T#7S, SIGN := MW 2, RET_VAL := MW 4); _001: NOP 0; NETWORK TITLE = CALL SFC 33 ( OB_NR := 20, RET_VAL := MW 6); NOP 0; NETWORK TITLE = CALL SFC 34 ( OB_NR := 20, RET_VAL := MW 8, STATUS := MW 10); NOP 0; END_ORGANIZATION_BLOCK ORGANIZATION_BLOCK OB 20 TITLE = "Time Delay Interrupt" VERSION : 0.1 VAR_TEMP OB20_EV_CLASS : BYTE ; //Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1) OB20_STRT_INF : BYTE ; //16#21 (OB 20 has started) OB20_PRIORITY : BYTE ; //Priority of OB Execution OB20_OB_NUMBR : BYTE ; //20 (Organization block 20, OB20) OB20_RESERVED_1 : BYTE ; //Reserved for system OB20_RESERVED_2 : BYTE ; //Reserved for system OB20_SIGN : WORD ; //Identifier input (SIGN) attached to SRT_DINT OB20_DTIME : TIME ; //Delay time (DTIME) input to SRT_DINT instruction OB20_DATE_TIME : DATE_AND_TIME ; //Date and time OB20 started END_VAR BEGIN NETWORK TITLE = AN Q 4.0; = Q 4.0; END_ORGANIZATION_BLOCK