Down counter
This is a user-defined function from a system function block. CTD_FUN (count down) allows you to program counting procedures.
Input
count down
the value 1 is subtracted from the current value CV for each rising edge detected at CD, except when Load is set or CV has reached the value zero.
with Load the counter state is reset to PV
Preset value
is the value subjected to subtraction during the first counting procedure
Input/output
Internal memory containing the internal values and states, which corresponds to the instance memory of the associated FB.
Output
signal output
is set if CV = zero
Current value
contains the current subtraction result (CV = current value)
The value can be changed during counting operation by writing to the variable from the programming editor.