PROGRAM PLC_PRG
VAR
TON_IN: TON;
TON_OUT: TON;
Out_PULS: BOOL;
END_VAR
TON_IN(IN := (TON_OUT.Q=0),PT := T#2s);
TON_OUT(IN := (Out_PULS=1), PT := T#2s);
IF (TON_IN.Q=1) AND (TON_OUT.Q=0) THEN
Out_PULS:=1;
ELSIF (TON_OUT.Q =1) THEN
Out_PULS:=0;
END_IF;