SET_TIME_1 := T#3s ; SET_TIME_2 := T#5s ;
SET_TIME_3 := T#3s ;
SET_TIME_4 := T#5s ;
TON_1( IN := ENABLE_1 , PT := SET_TIME_1 ) ;
OUTPUT_1 := TON_1.Q ;
OUT_TIME_1 := TON_1.ET ;
TON_2( IN := ENABLE_2 , PT := SET_TIME_2 ) ;
OUTPUT_2 := TON_2.Q ;
OUT_TIME_2 := TON_2.ET ;
TON_3( IN := ENABLE_3 , PT := SET_TIME_3 ) ;
OUTPUT_3 := TON_3.Q ;
OUT_TIME_3 := TON_3.ET ;
TON_4( IN := ENABLE_4 , PT := SET_TIME_4 ) ;
OUTPUT_4 := TON_4.Q ;
OUT_TIME_4 := TON_4.ET ;
IF ALARM_TRIGGER_INPUT_1 = TRUE THEN ;
PILOT_LAMP_1 := TRUE ;
PILOT_LAMP_2 := TRUE ;
BEEP_ALARM_1 := TRUE ;
BEEP_ALARM_2 := TRUE ;
END_IF ;
IF ALARM_TRIGGER_INPUT_RRSET_1 = TRUE THEN ;
PILOT_LAMP_1 := FALSE ;
END_IF ;
IF ALARM_TRIGGER_INPUT_RRSET_2 = TRUE THEN ;
PILOT_LAMP_2 := FALSE ;
END_IF ;
IF BEEP_ALARM_1 = TRUE THEN ;
ENABLE_1 := NOT(OUTPUT_2);
ENABLE_2 := OUTPUT_1 ;
IF OUTPUT_1 = TRUE THEN ;
BEEP_1 := TRUE ;
ELSE ;
BEEP_1 := FALSE ;
END_IF ;
IF (ENABLE_1 AND NOT (ENABLE_1_PREV) = TRUE) THEN ;
ACCUMULATOR_1 := ACCUMULATOR_1 + 1 ;
END_IF ;
END_IF ;
IF ACCUMULATOR_1 = 3 THEN ;
BEEP_ALARM_1 := FALSE ;
ACCUMULATOR_1 := 0 ;
END_IF ;
IF BEEP_ALARM_2 = TRUE THEN ;
ENABLE_3:= NOT(OUTPUT_4) ;
ENABLE_4 := OUTPUT_3 ;
IF OUTPUT_3 = TRUE THEN ;
BEEP_2 := TRUE ;
ELSE ;
BEEP_2 := FALSE ;
END_IF ;
IF (ENABLE_3 AND NOT (ENABLE_3_PREV) = TRUE) THEN ;
ACCUMULATOR_2 := ACCUMULATOR_2 + 1 ;
END_IF ;
END_IF ;
IF ACCUMULATOR_2 = 3 THEN ;
BEEP_ALARM_2 := FALSE ;
ACCUMULATOR_2 := 0 ;
END_IF ;
ENABLE_1_PREV := ENABLE_1 ;
ENABLE_3_PREV := ENABLE_3 ;
IF BEEP_ALARM_1 = FALSE THEN ;
ENABLE_1 := FALSE ;
ENABLE_2 := FALSE ;
OUTPUT_1 := FALSE ;
OUTPUT_2 := FALSE ;
END_IF ;
IF BEEP_ALARM_1 = FALSE THEN ;
ENABLE_3 := FALSE ;
ENABLE_4 := FALSE ;
OUTPUT_3 := FALSE ;
OUTPUT_4 := FALSE ;
END_IF ;