Good day,
Thank you very much. I was able to put up a decent ST program just today and this will be the beginning of more complex programs to make. Here is my improved simple "TON" program:
dev_down := NOT dev_up;
IF NOT start THEN
t1(IN:=FALSE , PT:= , Q=> , ET=> );
t2(IN:=FALSE , PT:=, Q=> , ET=> );
dev_up:=FALSE;
END_IF
IF start AND NOT t2.IN THEN
t1(IN:=TRUE , PT:=t#1s , Q=>dev_up , ET=> );
END_IF
IF start AND dev_up THEN
t1(IN:=FALSE , PT:= , Q=> , ET=> );
t2(IN:=TRUE , PT:=t#1s, Q=> , ET=> );
IF t2.Q THEN
t2(IN:=FALSE , PT:=, Q=> , ET=> );
dev_up:=FALSE;
END_IF
END_IF
You must always make the call of ton. Now if start is not true you wont call the ton.
Code:
dev_down := NOT dev_up;
IF start THEN
t1(IN:=TRUE , PT:=t#1s , Q=>, ET=> ); //this one will execute the ton, if start is not true, it wont execute, also when call is made u assign true to in so it will always be true when call is made.
IF t1.Q THEN
dev_up:=TRUE;
[COLOR=Red]t1.IN:=FALSE;[/COLOR]
END_IF
END_IF