Basic instructions
8.3 Counter operations
S7-1200 Programmable controller
246 System Manual, V4.2, 09/2016, A5E02486680-AK
Table 8- 26 Operation of CTD (count down)
The CTD counter counts down by 1 when the value of parame-
ter CD changes from 0 to 1. The CTD timing diagram shows
the operation for an unsigned integer count value (where PV =
3).
• If the value of parameter CV (current count value) is equal
to or less than 0, the counter output parameter Q = 1.
• If the value of parameter LOAD changes from 0 to 1, the
value at parameter PV (preset value) is loaded to the coun-
ter as the new CV (current count value).
Table 8- 27 Operation of CTUD (count up and down)
The CTUD counter counts up or
down by 1 on the 0 to 1 transi-
tion of the count up (CU) or
count down (CD) inputs. The
CTUD timing diagram shows the
operation for an unsigned inte-
ger count value (where PV = 4).
• If the value of parameter CV
is equal to or greater than the
value of parameter PV, then
the counter output parameter
QU = 1.
• If the value of parameter CV
is less than or equal to zero,
then the counter output pa-
rameter QD = 1.
• If the value of parameter
LOAD changes from 0 to 1,
then the value at parameter
PV is loaded to the counter
as the new CV.
• If the value of the reset pa-
rameter R is changes from 0
to 1, the current count value
is reset to 0.