The timers in the PLC are placed in a specific PRG task unit, and the PRG unit needs to be placed in a specific periodic cycle task in order to be executed, and this cycle cycle task cycle T; The timing time of the timer T0; T and T0 The order of magnitude, or size determines the accuracy of the timer.
Ttest:ton;
Uicount:uint;
TTest (in: = Not ttest.q, PT: = t#2s);
IF TTEST.Q Then
Uicount: = uicount+10;
End_if
Situation one: T0 > > t (Timer T0 (seconds) time, greater than the task cycle time T (millisecond level)).
Because the task cycle is much smaller than the timer timing, the impact of the task cycle can be negligible for the timer.
Scenario Two: T0 < = T
Each of the 3 task cycles, the timer output once Q: = TRUE; it is not allowed to use timers to perform periodic tasks. The cause of this is that the timer is refreshed when the task is executed.
This is necessary to use the timer service is clear, so the short-term periodic task, or directly with the task cycle time interval is relatively accurate.
Industrial plc, about the timer ton,tof, a little new cognition, or wake up!