
10-3
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
10.2 Up-Down Counter
A positive edge (i.e. a change in signal state from 0 to 1) at input S of the
Up-Down Counter instruction sets the counter with the value at the Preset
Value (PV) input. A signal state of 1 at input R resets the counter. Resetting
the counter places the value of the count at 0. The counter is incremented by
1 if the signal state at input CU changes from 0 to 1 (that is, there is a
positive edge) and the value of the counter is less than 999. The counter is
decremented by 1 if the signal state at input CD changes from 0 to 1 (that is,
there is a positive edge) and the value of the counter is more than 0. If there
is a positive edge at both count inputs, both operations are executed and the
count remains the same. A signal state check for 1 at output Q produces a
result of 1 when the count is greater than 0; the check produces a result of 0
when the count is equal to 0.
Certain restrictions apply to the placement of the counter boxes (see
Section 6.1).
Table 10-1 Up-Down Counter Box and Parameters, with International Short Name
LAD Box Parameter Data Type Memory Area Description
no. COUNTER C
Counter identification number. The range
depends on the CPU.
CU BOOL I, Q, M, D, L Count up input CU
no.
CD BOOL I, Q, M, D, L Count down input CD
_
QCU
S BOOL I, Q, M, D, L Set input for presetting counter
CV
CD
S
PV
PV WORD I, Q, M, D, L Value in the range of 0 to 999 for
presetting counter (entered as
C#<value> to indicate BCD format)
CV_BCD
R BOOL I, Q, M, D, L Reset input
Q BOOL I, Q, M, D, L Status of the counter
CV WORD I, Q, M, D, L Current counter value (integer format)
CV_BCD WORD I, Q, M, D, L Current counter value (BCD format)
Description
Counter Instructions
Comentarios a estos manuales