S5-95F
STEP 5 Operations
8.1.5
Counter Operations
The programmable controller uses counter operations to handle counting jobs. Counters can count
up and down. The counting range is from 0 to 999 (three decades). Table 8-5 provides an
overview of the counter operations. Examples follow the table.
Table 8-5. Overview of Counter Operations
Operation
Meaning
Parameter
0 to 127
Operand
S
R
ID
Z
CD
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
CU
Set Counter
The counter is set on the leading edge of the RLO.
Reset Counter
The counter is set to zero as long as the RLO is "1".
Count Down
The count is decremented by 1 on the leading edge of the RLO.
When the RLO is "0", the count is not affected.
Count Up
The count is incremented by 1 on the leading edge of the RLO.
When the RLO is "0", the count is not affected.
Loading a Count
Counter operations call internal counters.
When a counter is set, the word in ACCU 1 is used as a count. You must therefore first store
counts in the accumulator.
You can load a count with any of the following data types:
KC
constant count
or
DW
data word
IW
input word
QW
output word
FW
flag word
The data for these words must
be in BCD code.
Loading a Constant Count
The following example shows how the count 38 is loaded.
L KC
38
Operation
Operand
Count (0 to 999)
EWA 4NEB 812 6210-02
8-25