How to Use Timers in Structured Text (TON Function Block Explained)
Автор: Hedgetech Systems LLC
Загружено: 2025-08-10
Просмотров: 603
Описание:
Timers are essential for delays, event scheduling, and safety checks in industrial automation — but in Structured Text, they work a little differently than ladder logic.
In this quick tutorial, I’ll show you exactly how to use the TON (On-Delay) function block in Structured Text so you can apply it in your PLC projects.
We’ll cover:
Declaring the TON as a variable
Calling it every scan
Checking .Q when the timer is complete
Chaining timers for more complex sequences
Whether you’re working in CODESYS, Siemens, Rockwell, or any IEC 61131-3 compliant environment, this method works.
🛠 Example Code (from the video)
PROGRAM PLC_PRG
VAR
xStartCondition : BOOL := FALSE; // Start signal
tonDelay : TON; // TON function block
xTimerDone : BOOL := FALSE; // Timer completion flag
END_VAR
tonDelay(IN := xStartCondition, PT := T#5S);
xTimerDone := tonDelay.Q;
If you’re learning timers in ST, check out my Circular Buffer tutorial here
➡️ • PLC Programming Tip: Circular Buffer in St...
and my new SEL Operator tip
➡️ • CODESYS SEL Operator Explained in 41 Secon...
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: