pls(otomatik, otomatik_high);
IF otomatik_high THEN
dongu1 := TRUE;
dongu2 := FALSE;
cikis_x := TRUE;
END_IF;
TON_1(IN:= dongu1 ,PT:= T#3s);
IF TON_1.Q THEN
dongu1 := FALSE;
dongu2 := TRUE;
cikis_x := FALSE;
END_IF;
TON_2(IN:= dongu2 ,PT:= T#1s);
IF TON_2.Q THEN
IF dongu_bitir = FALSE THEN
dongu2 := FALSE;
dongu1 := TRUE;
cikis_x := TRUE;
ELSE
dongu2 := FALSE;
dongu1 := FALSE;
cikis_x := FALSE;
dongu_bitir := FALSE;
END_IF;
END_IF;
pls(sensor_y, sensor_y_high);
pls(alarm, alarm_high);
SET(sensor_y_high OR alarm_high, dongu_bitir);