Ran into quite a baffling situation.
I am able to easily setup and run a TON timer when using the CFC style of graphic code...
However, I find in certain setups the ST version doesn't function
Is this a limitation of the software? Or a Bug? Or is there something I am missing?
(I am running the code in Simulation, as I have no machine to deploy to at this time.
Both run under the Main task in a PRG POU)
ST Attempt 1 (Simple works correctly)
TON_1 : TON;
TimeOut : BOOL;
ValueIN : BOOl;
TON_1( IN:= ValueIN, PT:= T#5S);
TimeOut := TON_1.Q;
ST Attempt 2 (Complex, doesn't work)
TON_2 : TON;
ValueIN : BOOL := TRUE;
OUT : BOOL;
Delay : TIME := T#5S;
TON_2.PT := Delay;
TON_2.IN := ValueIN;
OUT := TON_2.Q;
TON_2.ET doesn't count up at all, despite TON_2.IN Being TRUE.
I decided to place the TON_2.PT in an init IF statement so it only runs once, and still nothing happened with the timer.
I am curious why this is the case?