PLC Programming · Lab Manual

PLC Timers in TIA Portal: TON, TOF and TP Lab Manual with Live Timing Diagram

TON, TOF and TP look alike on screen and behave very differently on a machine. This lab manual puts all three to real work on one conveyor – jam confirmation, fan run-on, horn pulse – through all six stages, and lets you watch IN, ET and Q in a live timing diagram.

2,500+ engineers trained 4.9/5 Google rating 21+ years, Chinchwad, Pune Next batch: contact for dates
Quick answer

TON delays an output turning ON, TOF delays it turning OFF, and TP produces a fixed pulse on a rising edge. Each IEC timer needs its own instance, a Bool IN, a TIME preset PT, and gives Q and ET. Map the sensors into DB_IO, use the timers in an FB as multi-instances, and publish ET and Q to the HMI.

  • TON = confirm a signal, TOF = keep something running, TP = fixed pulse.
  • One instance per timer, never shared.
  • Publish ET and PT so the operator can see how long is left.

How IEC Timers Work

TimerQ behaviourTypical use
TONQ = 1 after IN has been 1 for PT; resets when IN = 0Debounce, jam confirmation, delayed start
TOFQ = 1 with IN; stays 1 for PT after IN fallsFan run-on, conveyor run-out
TPQ = 1 for exactly PT after a rising edgeHorn, pulse to a valve, one-shot actions

Lab Flow: Three Timers at Work on One Conveyor

Every lesson in the Softwell PLC lab manual series follows the same six stages and the same address rule, so the code you write here plugs straight into the HMI lessons.

Lab manual flow: field input to tested HMI screenSix stages: field device and PLC tag, input mapping to DB_IO, PLC logic, HMI tags, graphics linking, and perform and test.1Field + tags%I6.7 %I7.0jam, running2Input mappingFC_InputMapping→ DB_IO3LogicFB_ConveyorTimersTON, TOF, TP4HMI tagsDB_Conv_*ET, Q5GraphicsTimer screenET bar, lamps6Perform + testSimulatortiming diagramAddress rule for every lesson: %I only in FC_InputMapping, %Q only in FC_OutputMapping, symbolic DB members everywhere else – including the HMI.
Figure 1 – Six-stage lab flow for this lesson.

Stage 1Field Signals and PLC Tags

PLC tagAddressTypeDevice / comment
B50_Jam%I6.7BoolPhoto-eye at the transfer point, 1 = blocked
M50_Running%I7.0BoolConveyor contactor feedback
M51_Fan%Q3.4BoolMotor cooling fan
H50_Horn%Q3.5BoolWarning horn

Stage 2Input Mapping into DB_IO

// FC_InputMapping
"DB_IO".B50_Jam          := "B50_Jam";
"DB_IO".M50_Running      := "M50_Running";

Stage 3Logic: FB_ConveyorTimers with Multi-Instances

// FB_ConveyorTimers – STAT: T_Jam, T_FanRunOn : TON_TIME / TOF_TIME; T_Horn : TP_TIME;
#T_Jam(IN := "DB_IO".B50_Jam AND "DB_IO".M50_Running, PT := T#3S);   // blocked 3 s = jam
"DB_Conv".Jam := #T_Jam.Q;

#T_FanRunOn(IN := "DB_IO".M50_Running, PT := T#4S);                  // fan keeps running 4 s
"DB_Conv".Fan_Cmd := #T_FanRunOn.Q;

#T_Horn(IN := "DB_Conv".StartRequest, PT := T#2S);                    // 2 s warning before start
"DB_Conv".Horn_Cmd := #T_Horn.Q;

"DB_Conv".JamET_s := DINT_TO_REAL(TIME_TO_DINT(#T_Jam.ET)) / 1000.0;  // for the HMI

// FC_OutputMapping
"M51_Fan"  := "DB_Conv".Fan_Cmd;
"H50_Horn" := "DB_Conv".Horn_Cmd;

A latched jam becomes one bit in the alarm word from HMI alarm configuration; a timer used as a step watchdog appears in PLC step sequences.

Stage 4Link PLC Tags to the HMI

HMI tagPLC memberUsed by
DB_Conv_JamET_s"DB_Conv".JamET_sET field / bar
DB_Conv_Jam"DB_Conv".JamJam lamp and alarm
DB_Conv_Fan_Cmd"DB_Conv".Fan_CmdFan lamp

Stage 5Link the Graphics

#ObjectPropertiesTag / event
①Output field ETFormat 9.9 sDB_Conv_JamET_s
②BarProcess value ET, maximum PTDB_Conv_JamET_s
③Lamps Jam / Fan / HornAppearance 0/1 with textStatus bits

The same ET-against-limit bar is the step watchdog on the sequence status screen.

Stage 6Perform and Test: TON, TOF and TP Live

Three real uses on one conveyor: a TON confirms a jam only when B50 stays blocked for PT, a TOF keeps the cooling fan running after the motor stops, and a TP sounds the horn for a fixed time on a rising edge. Hold the buttons and read the timing diagram.

Field and PLC
HMI · Timer screen
TimersET / PT
PTETQ
PTETQ
PTETQ

Troubleshooting

SymptomLikely causeFirst check
Timer never finishesIN drops every scanMonitor IN online
Two timers interfereShared instanceOne instance per call
TP restarts unexpectedlyEdge logic wrong upstreamIN of the TP
HMI ET always 0ET not copied to a DB memberFB code / HMI tag

Hands-On Lab: Jam Detection, Fan Run-On and Horn Pulse

Hands-on
Before you start
  • TIA Portal with an S7-1200 or PLCSIM
  • Estimated time: 60 minutes
1

Wire and declare the signals

Declare B50_Jam, M50_Running, H50_Horn and M51_Fan.

Signals are declared.
2

Map into DB_IO

Copy B50 and M50 into DB_IO.

DB_IO follows the sensors.
3

Write FB_ConveyorTimers

Add T_Jam (TON 3 s), T_FanRunOn (TOF 4 s) and T_Horn (TP 2 s) as multi-instances.

Each timer has its own instance and the right preset.
4

Link HMI tags

Publish ET in seconds and Q for each timer.

ET and Q reach the HMI.
5

Build the timer screen

Show ET/PT fields and status lamps.

The screen shows ET against PT.
6

Test each timer

Hold and release each input and compare with the timing diagram.

Each timer behaves as in the timing diagram.
Checkpoint—how to know you did it right

You can predict Q from IN and PT for all three timers and see it confirmed online and on the panel.

Frequently asked questions

Does a PLC timer stop the program scan?

No. The CPU continues scanning the complete program while the timer function block updates its state each cycle.

Can multiple timer calls use the same instance?

Unrelated timers should not share an instance because the stored state will be overwritten. Assign a unique instance or a dedicated multi-instance member to every timer.

Which timer should I use for sensor debounce?

A short TON is commonly used when the signal must remain continuously true before it is accepted. Confirm the delay is compatible with the machine speed and safety requirements.

What is the difference between TON, TOF and TP?

TON delays switching ON, TOF delays switching OFF, and TP produces a fixed-length pulse on a rising edge regardless of how long the input stays true.

How do I show a timer on the HMI?

Copy ET and PT into a DB as Real seconds and display them as output fields or a bar, as in the step time bar of the sequence status screen.

Where should the timer instances live?

As multi-instances in the static area of the FB that uses them, or in a dedicated global DB. Never reuse one instance in two places.

Reviewed by Bhawesh Kumar SinghIndustrial Automation Trainer and Industry 4.0 Consultant · Softwell Automation · 21+ years industry experience

Get the full syllabus + free demo class

Share your details—a Softwell training advisor will contact you with batch dates, fees and hardware-practice options.

No spam. Used only to share course details for this enquiry.

Learn with practical industrial examples

Join live online, Pune classroom or corporate in-plant automation training.

Request Course Details
Verified learning pathway

Discuss PLC Timers TON, TOF and TP

Explore practical curriculum, software, hardware and batch options for this technology.

Content reviewed: 16 October 2026

Siemens PLC & TIA Portal Learning Path

Continue with the related Siemens PLC tutorials in this practical learning series.

  1. SCL vs Ladder Logic
  2. Upload PLC Program
  3. TIA Selection Tool
  4. Analog Input Scaling
  5. PLC Counters
  6. PLC Timers
  7. Addressing & Data Types
  8. Hardware & PLC Tags
  9. OB, FB, FC & DB
☎ Call WhatsApp ✉ Email Enquire Now