Specifications

SIMATIC Instructions
9-23
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
9.4 SIMATIC Counter Instructions
Count Up, Count Up/Down, Count Down
The Count Up instruction counts up to the maximum
value on the rising edges of the Count Up (CU) input.
When the current value (Cxxx) is greater than or equal to
the Preset Value (PV), the counter bit (Cxxx) turns on.
The counter is reset when the Reset (R) input turns on.
The Count Up/Down instruction counts up on rising
edges of the Count Up (CU) input. It counts down on the
rising edges of the Count Down (CD) input. When the
current value (Cxxx) is greater than or equal to the
Preset Value (PV), the counter bit (Cxxx) turns on. The
counter is reset when the Reset (R) input turns on.
The Count Down Counter counts down from the preset
value on the rising edges of the Count Down (CD) input .
When the current value is equal to zero, the counter bit
(Cxxx) turns on. The counter resets the counter bit
(Cxxx) and loads the current value with the preset value
(PV) when the load input (LD) turns on. The Down
Counter stops counting when it reaches zero.
Counter ranges: Cxxx=C0 through C255
In STL, the CTU Reset input is the top of the stack value,
while the Count Up input is the value loaded in the
second stack location.
In STL, the CTUD Reset input is the top of the stack
value, the Count Down input is the value loaded in the
second stack location, and the Count Up input is the
value loaded in the third stack location.
In STL, the CTD Load input is the top of stack, and the
Count Down input is the value loaded in the second stack
location.
Inputs/Outputs Operands Data Types
CU, CD (FBD) I, Q, M, SM, T, C, V, S, L, Power Flow BOOL
R, LD (FBD) I, Q, M, SM, T, C, V, S, L, Power Flow BOOL
PV VW, IW, QW, MW, SMW, LW, AIW, AC, T, C, Constant, *VD, *AC,
*LD, SW
INT
L
A
D
S
T
L
CTU Cxxx, PV
CTUD Cxxx, PV
Cxxx
CTU
CU
R
PV
Cxxx
CTUD
CU
R
PV
CD
F
B
D
Cxxx
CD
LD
PV
CTD
CTD Cxxx, PV
222 224
333
221