TOF (Functionblock) |
Top Previous Next |
The TOF function block is an OFF delay timer that disables the "q" output a specified number of milliseconds after the trig input is disabled.
When the trig input is set TRUE, the elapsed time counter (et) is reset to zero and the "q" output is set TRUE. When the trig input is switched to FALSE, the "et" counter is incremented until it reaches the preset timer value (pt), after which the "q" output is set FALSE. If the trig input is set TRUE before the et counter reaches the pt value, the timer is stopped, and the et counter is reset to zero.
This image shows the TON function block timing:
Input: trig : BOOL (true/false) On the leading edge of this input, the output "q" will go high. On the falling edge, the timer will start. When the timer reaches "pt", the "q" output will go low.
pt : DINT (0..2147483648) Specifies the delay in ms. from "trig" going low to "q" going low.
Output: et : DINT (0..2147483648) The current value of the timer.
q : BOOL (true/false) Output from the timer. See description for "trig".
Declaration: FUNCTION_BLOCK TOF;
Example: INCLUDE rtcu.inc |