Technical data

Appendix
27.6 Sample Programs
Programming with STEP 7
654 Manual, 05/2010, A5E02789666-01
27.6.3 Example of Handling Time-of-Day Interrupts
Structure of the User Program "Time-of-Day Interrupts"
FC12
OB10
OB1 and OB80
27.6.3.1 Structure of the User Program "Time-of-Day Interrupts"
Task
Output Q 4.0 should be set in the time from Monday, 5.00 am to Friday, 8.00 pm. In the time from
Friday, 8.00 pm to Monday, 5.00 am the output Q 4.0 should be reset.
Translating into a User Program
The following table shows the sub-tasks of the blocks used.
Block Sub-Task
OB1 Calls the function FC12
FC12 Depending on the state of the output Q 4.0, the time-of-day interrupt status, and the
inputs I 0.0 and I 0.1
Specify the starting time
Set the time-of-day interrupt
Activate the time-of-day interrupt
CAN_TINT
OB10 Depending on the current day of the week
Specify the starting time
Set or reset output Q 4.0
Set next time-of-day interrupt
Activate next time-of-day interrupt
OB80 Set output Q 4.1
Store start event information of OB80 in bit memory area