Counter Instructions
SIMATIC Counter Instructions
Count Up Counter
The Count Up instruction (CTU) counts up from the current
value each time the count up (CU) input makes the
transition from off to on. When the current value Cxx is
greater than or equal to the preset value PV, the counter bit
Cxx turns on. The counter is reset when the Reset (R) input
turns on, or when the Reset instruction is executed. The
counter stops counting when it reaches the maximum value
(32,767).
STL operation :
H Reset input: Top of stack
H Count Up input: Value loaded in the second stack location
Count Down Counter
The Count Down instruction (CTD) counts down from the
current value of that counter each time the count down (CD)
input makes the transition from off to on. When the current
value Cxx is equal to 0, the counter bit Cxx turns on. The
counter resets the counter bit Cxx and loads the current
value with the preset value PV when the load input LD turns
on. The counter stops upon reaching zero, and the counter
bit Cxx turns on.
STL operation:
H Load input: Top of stack
H Count Down input: Value loaded in the second stack location.
S7-200 Instruction Set
Chapter 6
113