Complete the user program
4.2 Turn on an output for 5 seconds
Getting started with S7-1200
46 Getting Started, 11/2009, A5E02486791-01
Use an off-delay timer to turn on an output for 5 seconds
The third network of your user program will use a TOF instruction that turns on and stays
on for 5 seconds after the TON timer (Page 42) turns on.
For the off-delay timer, you use the "Delay_5sec" tag to activate
the timer.
1. Select the third network of your user program.
2. Click the normally open contact in the "Favorites" to insert
the instruction.
3. Select the "Delay_5sec" tag. (You can either type a "d" or
else click the tag icon to display the list of tags.)
The "Delay_5sec" bit turns on 5
seconds after the "Run" output
turns on.
To insert the TOF timer, double-click the TOF timer in the Instruction task card. Just like
with the TON timer, STEP 7 Basic creates a DB for timer data. (Click "OK" to create the
timer and insert the TOF instruction.)
For the preset value of the TOF instruction, enter 5000 (for 5000 ms, or 5 seconds) in the
PT parameter.
Now create a coil to turn on when the TOF instruction is activated. Enter "M0.1" for the
address. Rename the tag to "On_for_5sec".
When the TON timer turns
"Delay_5sec" on, the TOF timer
turns the "On_for_5sec" bit on for 5
seconds.
To complete the user program, create a network with two elements:
Insert a normally open contact. For the address, select the "On_for_5sec" tag.
Insert a coil. Enter "Q0.1" for the address. Rename the tag to "MotorStart".
When the TOF timer is activated,
"On_for_5sec" turns the
"MotorStart" output on for 5
seconds.