TIME-ON and TIME_OFF synchronisation

I was setting up a simple test using TIME-ON and TIME-OFF to cycle a digital output and noticed some strange behaviour. Note sure if this is a serious problem, but it
may catch me out at some stage.

Attached are 2 short program listings and a trend display.
Note that the ONLY difference between the OUT9 and OUT10 code is which one comes first/second in the listing.
Uploading: PRG10A.txt…
Uploading: PRG10B.txt…

Attached is a TREND screenshot.

PRG10a ran from 15:37 to 15:45, PRG10b ran from 15:52 to 16:00

From trend graphic it is apparent that running PRG10a both outputs are synchronised, but running PRG10b there is a significant time-shift between them - OUT9 started “ON” only after OUT10 stopped “ON”.

Is there an explanation? Is there a way to be sure that the TIME-ON and time-OFF timers start consistently?

The trend logs and time-on, time-off are not synchronized to that level. Try your test again with the time base on the order of say, 5 seconds or so.

I’m not worried about time-offset between outputs and trend graph. Trend updating is slow/semi-random so it will not represent real-time

When I look at the Output (blue) indicators there is a significant time/phase shift between the 2 outputs depending on what order the timers appear in the code - which supports what the Trend shows.

My concern is if there are multiple TIME-ON and TIME-OFF functions in a program, will they work properly?

If its important to syncronize timers and outputs you can use a variable:

10 PUMPTIMER = TIME-ON( PUMP )

Then use PUMPTIMER in your logic and coordinate the actions there. They will be in sync perfectly.