Timer in Structured Text (ST) Programming – Schneider PLC EcoStruxure Control Expert

Published on Aug 27, 2025 | Category: counter

Share this Page:

Timers in PLC programming are essential for controlling time-based operations such as delays, pulse generation, or switching events after a specific duration. In Schneider PLC EcoStruxure Control Expert, timers are widely used to automate industrial processes with precise timing. Structured Text (ST), one of the IEC 61131-3 languages, lets you write timer logic using instructions like TON (On-Delay), TOF (Off-Delay), and TP (Pulse). With ST, timer programming is flexible, powerful, and easy to read—ideal for complex automation tasks.

This guide explains how to use timers in Structured Text (ST) with Schneider PLC EcoStruxure Control Expert. You’ll learn the differences between TON, TOF, and TP timers, see practical examples and use cases, and pick up best practices for reliable, real-world industrial automation.

Timers in Structured Text (ST) – Schneider PLC EcoStruxure Control Expert

A timer in PLC programming is a function block used to measure and control time-based events such as delays, pulse generation, or switching outputs after a set period. In Schneider PLC EcoStruxure Control Expert, timers play a key role in automating processes that depend on precise timing, such as motor start delays, valve operations, or alarm handling.

How Timers are Used in Structured Text

In Structured Text (ST), timers are declared and executed as functions. Each timer instance must have a unique name (e.g., TON_0, TOF_1, TP_0) so they can be used independently within a program. A timer function is called with specific input and output parameters that define its behavior and status.

General Syntax Example:

Timer_Name (IN := condition, PT := T#10s, Q => output, ET => elapsed_time);

Timer Parameters in Structured Text

Each timer function block in Structured Text has standard input and output parameters. These parameters control the operation of the timer and provide useful feedback for program logic.

Input Parameters

Output Parameters

How to Add Timers in Structured Text – Schneider PLC

In Schneider PLC EcoStruxure Control Expert, you can use timers and other function blocks directly in your Structured Text (ST) programs by accessing the Types Library Browser. The Types Library contains pre-defined function blocks like TON, TOF, TP, and many other standard timers that can be easily added to your program without manually declaring everything.

Steps to Add a Timer:

  1. Open the Types Library Browser: In your project, navigate to the ST editor and open the Types Library Browser. This displays all available libraries and function blocks.
  2. Select the Library: Choose Base Lib or the library containing standard timer blocks.
  3. Search for the Timer: Use the search box to find the timer you want: TP for Pulse Timer, TON for On-Delay Timer, or TOF for Off-Delay Timer.
  4. Add to Your Program: Drag and drop the timer into the Structured Text editor or use the Copy to Project option to include it in your project.
  5. Configure the Timer: When added, the timer function is automatically given a unique instance name (e.g., TP_0). You can keep this name or change it as needed. Enter all input and output parameters with the proper data types: IN (BOOL), PT (TIME), Q (BOOL), ET (TIME), according to your program logic.

Using the Types Library Browser ensures you are using standard, tested function blocks, which reduces errors and makes your Structured Text program easier to read and maintain. Once added, the timer can be referenced and used just like any other variable or function block in your code.

img/ecostruxurest-timer/how-to-add-timer-in-schneider-plc-structured-text-example.webp

TP (Pulse Timer) in Structured Text – Schneider PLC

In Structured Text (ST) programming of Schneider PLC EcoStruxure Control Expert, timers are declared as function blocks. Each timer must have a unique instance name (for example, TP_0, TP_1) to be used independently in a program. The TP (Pulse Timer) generates a fixed pulse output for the specified duration whenever the input condition changes from FALSE to TRUE.

Example Declaration:

TP_0 (IN := timer_start, PT := T#10s, Q => output_timer, ET => timer_et);

Input Parameters

Output Parameters

TON (On-Delay Timer) in Structured Text – Schneider PLC

The TON (On-Delay Timer) is used when you want a delay before an output turns ON after an input condition becomes TRUE. In other words, when the input signal switches from FALSE to TRUE, the timer begins counting. Only if the input stays TRUE for the entire preset time (PT), the output (Q) will finally turn ON. If the input goes FALSE before the time is completed, the timer resets back to zero and the output remains OFF.

This type of timer is useful in situations where you need to make sure a condition is stable for a certain duration before activating an output. For example, you may not want to start a motor immediately when a button is pressed — instead, you can wait a few seconds to ensure all conditions are safe.

Example in Structured Text:

TON_0 (IN := Start_Button, PT := T#5s, Q => Motor_Output, ET => Timer_ET);

Explanation of Parameters

TOF (Off-Delay Timer) in Structured Text – Schneider PLC

The TOF (Off-Delay Timer) is used when you want an output to remain ON for a certain time after the input condition turns FALSE. Unlike the TON timer, the output in a TOF timer is TRUE immediately when the input is TRUE. Once the input goes FALSE, the timer starts counting the preset time (PT). The output (Q) will stay TRUE during this period and only switch OFF after the elapsed time reaches the preset value. If the input goes TRUE again before the timer finishes, the timer stops and the output remains ON.

This timer is very useful in applications such as keeping a fan running for a few seconds after a machine stops, delaying the shutdown of an alarm, or maintaining a signal for a fixed period after a process ends.

Example in Structured Text:

TOF_0 (IN := Sensor_Input, PT := T#8s, Q => Alarm_Output, ET => Timer_ET);

Explanation of Parameters