In PLC programming a variety of timers is used to ensure real time PLC applications properties. We shall treat only timers of type TON for brevity. Intuitively, a timer is a black box of the Boolean input signal IN is fed and which produces a Boolean output signal Q and possibly an integer output signal ET. There is an additional input PT of integer, that we consider here as a constant. What happens if PT were changed while the timer running is not defined?
In other words: the signal output is true whenever the input signal has been true at least during a length PT period; it becomes false as soon as the input signal becomes false. To allow of using timers we extend our programming language by the following instruction: CALtimer (timer.IN:= var_name,timer. PT:= constant). Such a ‘timer call’, update the results timer.Q and timer.ET.
This ‘timer call’ has to simulate the effect of the aforementioned black box, which means that it will have to approximate specification as closely as possible. The existing approximations, however, do not satisfy the specification of an ideal timer as above. The reason that is timers only start to run resp, update their output, if they are called and the additional error we get is the time distance between two timer calls.
Programs are more flexible than hardware boxes. We must restrict them to forbid that they dynamically ‘change the wiring of the box” or change the timing constant while the timer is running or let the timer ‘die’.
A well-formed PLC program ensures that timer calls are always issued with the same parameters, that the variables timer.IN, timer.Q, and timer.ET are never changed except in the course of a timer call, and that a call is issued during each cycle of the PLC.