Iec Counter Instructions - Siemens SIMATIC S7-200 System Manual

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

S7-200 Programmable Controller System Manual

IEC Counter Instructions

Up Counter
The Count Up instruction (CTU) counts up from the current
value to the preset value (PV) on the rising edges of the
Count Up (CU) input. When the current value (CV) is greater
than or equal to the preset value, the counter output bit (Q)
turns on. The counter resets when the reset input (R) is
enabled. The Up Counter stops counting when it reaches
the preset value.
Down Counter
The Count Down instruction (CTD) counts down from the
preset value (PV) on the rising edges of the Count Down
(CD) input. When the current value (CV) is equal to zero, the
counter output bit (Q) turns on. The counter resets and
loads the current value with the preset value when the load
input (LD) is enabled. The Down Counter stops counting
when it reaches zero.
Up/Down Counter
The Count Up/Down instruction (CTUD) counts up or down
from the current value (CV) on the rising edges of the Count
Up (CU) or Count Down (CD) input. When the current value
is equal to preset, the up output (QU) turns on. When the
current value is equal to zero, the down output (QD) turns
on. The counter loads the current value with the preset
value (PV) when the load (LD) input is enabled. Similarly,
the counter resets and loads the current value with 0 when
the reset (R) is enabled. The counter stops counting when it
reaches preset or 0.
Table 6-24
Valid Operands for the IEC Counter Instructions
Inputs/Outputs
Cxx
CU, CD, LD, R
PV
Q, QU, QD
CV
Tip
Since there is one current value for each counter, do not assign the same number to more than
one counter. (Up Counters, Down Counters, and Up/Down Counters access the same current
value.)
116
Data Types
Operands
CTU, CTD, CTUD
Constant (C0 to C255)
BOOL
I, Q, V, M, SM, S, T, C, L, Power Flow
INT
IW, QW, VW, MW, SMW, SW, LW, AC, AIW, *VD, *LD, *AC,
Constant
BOOL
I, Q, V, M, SM, S, L
INT
IW, QW, VW, MW, SW, LW, AC, *VD, *LD, *AC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents