Technical data

Table Of Contents
Integrated Functions (for CPUs with integrated I/Os)
System Software for S7-300/400 System and Standard Functions - Volume 2/2
30-4
A5E00739858-01
30.3 SFB 38 (HSC_A_B)
Description
With SFB 38 (HSC_A_B), you can influence the integrated A/B counter function of
a CPU with integrated inputs/outputs, as follows:
Specify and adopt the start value
Specify and set comparison values
Enable counters
Enable digital outputs
Read current counted values and current comparison values
Query the counted value relative to the comparison value
SFB 38 (HSC_A_B) reads or writes data from the user program in the instance DB
of the integrated function. The A/B counter consists of two counters A and B that
can count simultaneously and are independent of each other (counting up and
down is possible).
The counters function identically; count pulses can be registered up to a frequency
of 10 kHz.
Further Information
The precise meaning of the parameters of SFB 38 in conjunction with the
parameters of the integrated function A/B counter and the hardware inputs and
outputs of the CPU is described in detail in the manual S7-300 Programmable
Controller, Integrated Functions CPU 312 IFM/314 IFM.
Parameters
Parameter Declaration Data Type Memory Area Description
PRES_COMP INPUT DINT I, Q, M, D, L,
constant
New comparison value COMP
EN_COUNT INPUT BOOL I, Q, M, D, L
constant
Enable the counter
EN INPUT BOOL I, Q, M, D, L,
constant
Enable the digital output
SET_COMP INPUT BOOL I, Q, M, D, L,
constant
Set input for comparison value COMP
COUNT OUTPUT DINT I, Q, M, D, L Actual value of the counter
COMP OUTPUT DINT I, Q, M, D, L Current comparison value COMP
ENO OUTPUT BOOL I, Q, M, D, L Error handling:
1 : no error in execution
0 : error in execution