Counter instructions
318
Part II IEC Instructions
CTD
Down counter
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
For CTD declare the following:
CD clock generator input
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.
LOAD (LD) Set
with LOAD the counter state is reset to PV
PV preset value
is the value subjected to subtraction during the first counting procedure
Q signal output
is set if CV = zero
CV current value
contains the current subtraction result (CV = current value)
The names in brackets are the valid parameter names of the ST-editor.
PLC types Availability of CTD (see page 1319)
Time chart
Description
The function block CTD (count down) allows you to program counting procedures.