How to Generate a Daily Boolean Trigger at Midnight in a Siemens PLC
For an S7-300/400 CPU that supports time-of-day interrupts, configure OB10 for daily execution at 00:00 and place the required Boolean action in that OB. Siemens' APL V9.0 also provides the TimeTrig block: set its periodic mode to Daily, set the time to midnight, enable the trigger and configure its pulse duration. Choose according to the installed CPU/library and whether the application needs a persistent event bit or a timed pulse.
Table of Contents
- Choose the Trigger Method
- Method 1: Configure a Daily Time-of-Day OB
- Choose Latch or Pulse Behavior for OB10
- Method 2: Configure APL TimeTrig
- Prerequisites and Time Base
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Choose the Trigger Method
Use a CPU time-of-day interrupt when the CPU supports OB10 and the event belongs in the PLC program. On S7-300/400, Siemens documents time-of-day interrupt OBs OB10 to OB17, with CPU-specific availability and configuration. Use the APL TimeTrig block when the installed APL version includes it and a configurable daily/weekly/monthly or single trigger and pulse duration are useful. The source identifies the APL block as FB1802; verify that block number/version in the library installed on the target system.
Method 1: Configure a Daily Time-of-Day OB
This method applies only to the CPU models and STEP 7 versions that support the selected time-of-day OB. 1. Check the CPU manual for OB10 availability and time-interrupt constraints. 2. In STEP 7/HW Config, assign the interrupt start date/time and periodic execution, or use Siemens' documented SET_TINT/ACT_TINT method in the user program for a supported S7-300/400 CPU. 3. Set the start time to 00:00 and period to daily. 4. Ensure OB10 exists in the CPU program and implement the required Boolean action there. 5. Ensure the interrupt is activated, not deselected, and CPU time is set and synchronized to the intended time base. The exact HW Config fields and available OBs vary by CPU.
Choose Latch or Pulse Behavior for OB10
A time-of-day OB is an execution event; a Boolean tag set TRUE in OB10 remains true until program logic resets it. If consumers need a latched event, define how it is acknowledged or cleared. If they need a pulse, add a documented pulse/reset design appropriate to the application and prove the pulse width and scan behavior; do not assume an OB call automatically resets a Boolean output.
Method 2: Configure APL TimeTrig
In an installation with the applicable APL and TimeTrig block, configure its periodic trigger as Daily, enter 00:00 for Time, set Pulse duration, and enable the periodic trigger and block's operating mode under the project's operator permissions. Siemens' APL Operator Guide V9.0 documents daily/weekly/monthly periodic modes, the Time setting, trigger enable/disable controls and a Pulse duration parameter. Connect the block's trigger signal to the intended Boolean consumer using the matching block interface documentation. The guide's TimeTrig faceplate also exposes whether local time is used; select the intended time basis deliberately.
Prerequisites and Time Base
Confirm the PLC's real-time clock is valid and that plant time synchronization agrees with the chosen time basis. Confirm CPU model, firmware and STEP 7 version support the configured interrupt, or confirm that the installed APL library contains the required TimeTrig block. A CPU clock correction, restart or daylight-saving transition can affect when a wall-clock event occurs; determine how the exact CPU and chosen time mode handle those conditions before operational use.
Verification
In an approved offline or commissioning test, observe the CPU clock, scheduled time and Boolean signal at the intended midnight boundary. For OB10, confirm the block executes at the configured interval and that the Boolean is cleared or latched as designed. For TimeTrig, confirm the daily operating mode, next trigger time, actual PLC time, trigger state and configured pulse duration in the faceplate/diagnostics. Verify the downstream consumer sees one event at the required time; do not infer this from configuration acceptance alone.
Limitations and Operational Precautions
The original question does not name the CPU, firmware, STEP 7 version, local-time policy or required output pulse width. OB10 availability and time-of-day features vary by CPU. The APL guide cited is V9.0; a different installed library may have different interfaces or behavior. Do not download a revised schedule or change the CPU clock in a running process without the site's operational review; missing, duplicated or shifted triggers can affect the controlled sequence.
Engineer FAQ
Is OB10 the daily interrupt? OB10 is one of the S7-300/400 time-of-day interrupt OBs, but availability and parameterization depend on the CPU.
Can a time-of-day OB execute daily? Siemens documents daily periodic execution for supported time-of-day interrupts; parameterize start time and activation for the exact CPU.
Does setting a Boolean in OB10 create a pulse? No. The Boolean remains in its assigned state until logic resets it.
Can APL TimeTrig generate a timed trigger? The V9.0 Operator Guide documents a periodic trigger with Daily mode, Time and Pulse duration parameters.
Should midnight mean local time or CPU time? Specify the intended time basis, verify synchronization and check the selected block/CPU behavior for clock corrections and DST.
Technical References
- Siemens, Time-of-day interrupt organization blocks (OB 10 to OB 17) (S7-300, S7-400), STEP 7 V21 online help: https://docs.tia.siemens.cloud/r/en-us/v21/organization-blocks-s7-300-s7-400/time-of-day-interrupt-organization-blocks-ob-10-to-ob-17-s7-300-s7-400
- Siemens, SET_TINT: Set time-of-day interrupt (S7-300, S7-400), STEP 7 V20 online help, daily period and activation parameters: https://docs.tia.siemens.cloud/r/en-us/v20/extended-instructions-s7-300-s7-400/interrupts-s7-300-s7-400/time-of-day-interrupt-s7-300-s7-400/set_tint-set-time-of-day-interrupt-s7-300-s7-400
- Siemens, APL Operator Guide (V9.0), §10.1 “TimeTrig,” especially the standard and parameter views, pp. 397–403: https://cache.industry.siemens.com/dl/files/748/109748748/att_924322/v1/AplOpG_b_en-US.pdf?download=true