Technical data

Table Of Contents
IEC Timers and IEC Counters
System Software for S7-300/400 System and Standard Functions - Volume 2/2
25-8
A5E00739858-01
The operating system resets SFB 2 "CTUD" during a cold restart. If you want
SFB 2 "CTUD" to be initialized following a warm restart, you must call SFB 2 in
OB100 as follows:
With R = 1 when using the block to count up
With R = 0 and LOAD = 1 and PV = required initial value for CV when using the
block to count down
If instances of this SFB are located within another block, you can reset these
instances, for example, by initializing the higher-level block.
Parameter Declaration Data Type Memory Area Description
CU INPUT BOOL I, Q, M, D, L,
constant
Count up input.
CD INPUT BOOL I, Q, M, D, L,
constant
Count down input
R INPUT BOOL I, Q, M, D, L,
constant
Reset input. R is dominant over LOAD.
LOAD INPUT BOOL I, Q, M, D, L,
constant
Load input. LOAD is dominant over CU
and CD.
PV INPUT INT I, Q, M, D, L,
constant
Preset value. The counter is set to the
preset value PV when the signal level at
the LOAD input is 1.
QU OUTPUT BOOL I, Q, M, D, L Status of the up counter:
QU has the following value
1, if CV >PV
0 otherwise
QD OUTPUT BOOL I, Q, M, D, L Status of the down counter:
QD has the following value
1, if CV < 0
0 otherwise
CV OUTPUT INT I, Q, M, D, L Current count value
(possible values: -32 768 to 32 767)