Technical data

Table Of Contents
IEC Timers and IEC Counters
System Software for S7-300/400 System and Standard Functions - Volume 2/2
A5E00739858-01
25-3
25.2 Generating an On Delay with SFB 4 "TON"
Description
SFB 4 "TON" delays a rising signal edge by the time PT. The timer runs only in the
STARTUP and RUN modes.
A rising edge at the IN input causes a rising edge at output Q after the time PT has
expired. Q then remains set until the IN input changes to 0 again. If the IN input
changes to 0 before the time PT has expired, output Q remains set to 0.
The ET output provides the time that has passed since the last rising edge at the
IN input. Its maximum value is the value of the PT input. ET is reset when the IN
input changes to 0.
SFB 4 "TON" complies with the IEC 1131-3 standard.
The operating system resets the instances of SFB 4 "TON" during a cold restart. If
you want instances of this SFB to be initialized following a warm restart, you must
call SFB 4 with PT = 0 ms in OB100. If instances of this SFB are located within
another block, you can reset these instances, for example, by initializing the higher-
level block.
Timing Diagram
ET
Q
IN
PT
PT PT
Parameter Declaration Data Type Memory Area Description
IN INPUT BOOL I, Q, M, D, L,
constant
Start input
PT INPUT TIME I, Q, M, D, L,
constant
Time by which the rising edge at the IN
input is delayed. PT must be positive.
(Note: the range of values is fixed by the
TIME data type)
Q OUTPUT BOOL I, Q, M, D, L Status of the time
ET OUTPUT TIME I, Q, M, D, L Expired time