Technical data
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
100 Manual, 05/2010, A5E02789666-01
4.2.4.1 Time-of-Day Interrupt Organization Blocks (OB10 to OB17)
The S7 CPUs provide the Time-Of-Day interrupt OBs that can be executed at a specified date or at
certain intervals.
Time-Of-Day interrupts can be triggered as follows:
• Once at a particular time (specified in absolute form with the date)
• Periodically by specifying the start time and the interval at which the interrupt should be
repeated (for example, every minute, every hour, daily).
Rules for Time-of-Day Interrupts
Time-Of-Day interrupts can only be executed when the interrupt has been assigned parameters
and a corresponding organization block exists in the user program. If this is not the case, an error
message is entered in the diagnostic buffer and asynchronous error handling is executed (OB80,
see Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122)).
Periodic Time-Of-Day interrupts must correspond to a real date. Repeating an OB10 monthly
starting on January 31st is not possible. In this case, the OB would only be started in the months
that actually have 31 days (that is, not in February, April, June, etc.).
A Time-Of-Day interrupt activated during startup (restart (warm restart) or hot restart) is only
executed after the startup is completed.
Time-Of-Day interrupt OBs that are deselected by the parameter assignment cannot be started.
The CPU recognizes a programming error and changes to STOP mode.
Following a restart (warm restart), Time-Of-Day interrupts must be set again (for example, using
SFC30 ACT_TINT in the startup program).
Starting the Time-of-Day Interrupt
To allow the CPU to start a Time-Of-Day interrupt, you must first set and then activate the
Time-Of-Day interrupt. There are three ways of starting the interrupt:
• Automatic start of the Time-Of-Day interrupt by assigning appropriate parameters with STEP 7
(parameter block "Time-Of-Day interrupts")
• Setting and activating the Time-Of-Day interrupt with SFC28 SET_TINT and SFC30 ACT_TINT
from within the user program
• Setting the Time-Of-Day interrupt by assigning parameters with STEP 7 and activating the
Time-Of-Day interrupt with SFC30 ACT_TINT in the user program.
Querying the Time-of-Day Interrupt
To query which Time-Of-Day interrupts are set and when they are set to occur, you can do one of
the following:
• Call SFC31 QRY_TINT
• Request the list "interrupt status" of the system status list.