Technical data

Table Of Contents
SFBs for Compact CPUs
System Software for S7-300/400 System and Standard Functions - Volume 2/2
28-26
A5E00739858-01
28.3 Controlling the Counter with SFB 47 "COUNT"
Description
To control the positioning functions via the user program, use SFB COUNT
(SFB 47).
The following operations are available:
Starting/stopping the counter via software gate SW_GATE
Enabling/controlling the output DO
Retrieving the status bits STS_CMP, STS_OFLW, STS_UFLW and STS_ZP
Retrieving the actual counter value COUNTVAL
Jobs for reading/writing the internal counter registers
Parameter
Parameter Declaration Data
type
Address
(Instance
DB)
Range of values Default Description
LADDR
INPUT WORD 0 CPU specific W#16#0300 The I/O
address of
your
submodule,
specified by
you in "HW
Config".
If the E and A
addresses
are not equal,
the lower one
of the two
must be
specified.
CHANNEL
INPUT INT 2
CPU 312C:
0 to 1
CPU 313C:
0 to 2
CPU 314C:
0 to 3
0 Channel
number:
SW_GATE
INPUT BOOL 4.0 TRUE/FALSE FALSE Software gate
for starting/
stopping the
counter
CTRL_DO
INPUT BOOL 4.1 TRUE/FALSE FALSE Enable output
SET_DO
INPUT BOOL 4.2 TRUE/FALSE FALSE Control
output
JOB_REQ
INPUT BOOL 4.3 TRUE/FALSE FALSE Job
initialization
(positive
edge)