Uploaded October 2026 | Updated November 2026, 3 hours ago
Structured text function blocks: TON, CTU and R_TRIG are the same PLC timers, counters and one-shots you know from ladder, with a text based syntax.
โก QUICK ANSWER
Function blocks are instances that hold their state across scans - which is exactly what a ladder timer or counter does, so you already understand the concept. TON is an on delay timer: declare an instance, call it with IN := X1 and PT := T#2s, then read its Q output. CTU counts up on each rising edge. R_TRIG gives a one scan pulse on a rising edge, which is the one shot you already use in ladder. The simulator also provides TOF for off delay, TP for a pulse, CTD for counting down and F_TRIG for a falling edge. Nothing here is a new idea - it is the same toolbox with a text syntax, which is why structured text is easier to pick up from ladder than most people expect. Full guide on the blog.
๐ FULL WRITTEN GUIDE
accautomation.ca/acc-plc-simulator-how-to-use-structured-text-st-programming
๐ฅ๏ธ OPEN THE SIMULATOR AND PRESS ST
accautomation.ca/simulator
โถ WATCH THE FULL VIDEO
youtu.be/B0UDgJnE3DQ
๐ WHAT YOU'LL LEARN
โ Understand what a function block instance is - a block that holds its own state across scans, exactly like a ladder timer or counter does
โ Use TON as an on delay timer - IN := X1 for the enable, PT := T#2s for the preset, then read the Q output
โ Use CTU to count up on each rising edge, and CTD to count down
โ Use R_TRIG for a one scan pulse on a rising edge, and F_TRIG for a falling edge - the text equivalent of a ladder one shot
โ Map what you already know onto the text syntax, rather than learning the concepts again from scratch
โ FREQUENTLY ASKED
Q: What does T#2s mean in structured text?
A: It is an IEC 61131-3 time literal. T# introduces a duration and 2s is two seconds, so PT := T#2s sets a timer preset of two seconds. You will also see forms like T#500ms and T#1m30s.
Q: Is a function block the same as a ladder timer?
A: Conceptually yes. Both are instances that keep their own state between scans - a TON accumulating elapsed time is doing what a ladder TMR does. The difference is that you call it and read its outputs by name instead of wiring a rung to it.
Q: What is R_TRIG for?
A: A one scan pulse on a rising edge - the structured text version of a one shot. Use it whenever something must happen once per transition rather than every scan the condition stays true.
๐ The full guide, with every statement and function block: accautomation.ca/acc-plc-simulator-how-to-use-structured-text-st-programming
๐ MORE RESOURCES
โถ Try the free simulator: accautomation.ca/simulator
โถ How I learned structured text in the simulator: youtu.be/B0UDgJnE3DQ
โถ PLC Beginners Guide: accautomation.ca/programming/plc-beginners-guide
โถ Free eBooks: accautomation.ca (subscribe for download)
๐ RECOMMENDED HARDWARE
โถ Shop: automationdirect.com
โถ Parts Guide: accautomation.ca/purchase-find-parts
๐ฌ Questions? Drop a comment below.
๐ New tutorials every Monday โ Subscribe and hit the bell!
#PLC #LadderLogic #IndustrialAutomation #PLCProgramming #ACCAutomation #StructuredText #IEC61131 #PLCTimer #PLCCounter #Shorts
Regards,
Garry
ACC Automation
accautomation.ca
Structured text function blocks: TON, CTU and R_TRIG are the same PLC timers, counters and one-shots you know from ladder, with a text based syntax.
โก QUICK ANSWER
Function blocks are instances that hold their state across scans - which is exactly what a ladder timer or counter does, so you already understand the concept. TON is an on delay timer: declare an instance, call it with IN := X1 and PT := T#2s, then read its Q output. CTU counts up on each rising edge. R_TRIG gives a one scan pulse on a rising edge, which is the one shot you already use in ladder. The simulator also provides TOF for off delay, TP for a pulse, CTD for counting down and F_TRIG for a falling edge. Nothing here is a new idea - it is the same toolbox with a text syntax, which is why structured text is easier to pick up from ladder than most people expect. Full guide on the blog.
๐ FULL WRITTEN GUIDE
accautomation.ca/acc-plc-simulator-how-to-use-structured-text-st-programming
๐ฅ๏ธ OPEN THE SIMULATOR AND PRESS ST
accautomation.ca/simulator
โถ WATCH THE FULL VIDEO
youtu.be/B0UDgJnE3DQ
๐ WHAT YOU'LL LEARN
โ Understand what a function block instance is - a block that holds its own state across scans, exactly like a ladder timer or counter does
โ Use TON as an on delay timer - IN := X1 for the enable, PT := T#2s for the preset, then read the Q output
โ Use CTU to count up on each rising edge, and CTD to count down
โ Use R_TRIG for a one scan pulse on a rising edge, and F_TRIG for a falling edge - the text equivalent of a ladder one shot
โ Map what you already know onto the text syntax, rather than learning the concepts again from scratch
โ FREQUENTLY ASKED
Q: What does T#2s mean in structured text?
A: It is an IEC 61131-3 time literal. T# introduces a duration and 2s is two seconds, so PT := T#2s sets a timer preset of two seconds. You will also see forms like T#500ms and T#1m30s.
Q: Is a function block the same as a ladder timer?
A: Conceptually yes. Both are instances that keep their own state between scans - a TON accumulating elapsed time is doing what a ladder TMR does. The difference is that you call it and read its outputs by name instead of wiring a rung to it.
Q: What is R_TRIG for?
A: A one scan pulse on a rising edge - the structured text version of a one shot. Use it whenever something must happen once per transition rather than every scan the condition stays true.
๐ The full guide, with every statement and function block: accautomation.ca/acc-plc-simulator-how-to-use-structured-text-st-programming
๐ MORE RESOURCES
โถ Try the free simulator: accautomation.ca/simulator
โถ How I learned structured text in the simulator: youtu.be/B0UDgJnE3DQ
โถ PLC Beginners Guide: accautomation.ca/programming/plc-beginners-guide
โถ Free eBooks: accautomation.ca (subscribe for download)
๐ RECOMMENDED HARDWARE
โถ Shop: automationdirect.com
โถ Parts Guide: accautomation.ca/purchase-find-parts
๐ฌ Questions? Drop a comment below.
๐ New tutorials every Monday โ Subscribe and hit the bell!
#PLC #LadderLogic #IndustrialAutomation #PLCProgramming #ACCAutomation #StructuredText #IEC61131 #PLCTimer #PLCCounter #Shorts
Regards,
Garry
ACC Automation
accautomation.ca





![Fastest Way to Access Instructions! #PLCProgramming #Automation #Tutorial
Master Productivity PLC Boost Use Favorites Feature! [Tutorial] ๐ญ๐ช on the Productivity PLC. Step-by-step tutorial with real-world examples.
โก QUICK ANSWER
Modbus on the Productivity PLC maps remote coils and registers into local memory. Choose the port (Modbus RTU over RS-485 or Modbus TCP over Ethernet), match baud/parity/slave-ID on both ends, then use a read/write instruction to move holding registers and coils between devices.
๐ FULL STEP-BY-STEP + DOWNLOADS (project file, wiring diagrams, screenshots)
https://accautomation.ca/p1-m622-16dr-mini-plc-contact-and-coil-instructions/
๐ WHAT YOULL LEARN
โ
Productivity PLC Boost Use Favorites Feature! [Tutorial] ๐ญ๐ช step by step on the Productivity PLC
โ
Math instructions for calculations
โ
Data move and transfer instructions
โ
Real-world tips from manufacturing experience
โ FREQUENTLY ASKED
Q: RTU or TCP โ which do I use?
A: RTU runs over RS-485 serial; TCP runs over Ethernet. Pick whichever your device supports. Both are shown in the full guide.
Q: Why wonโt my Modbus device respond?
A: Confirm baud rate, parity, and slave ID match exactly, and check A/B wiring polarity on RS-485.
๐ Full step-by-step, code & wiring diagrams: https://accautomation.ca/p1-m622-16dr-mini-plc-contact-and-coil-instructions/
๐ MORE RESOURCES
โถ Series: https://accautomation.ca/series/productivity-plc/
โถ PLC Beginners Guide: https://accautomation.ca/programming/plc-beginners-guide/
โถ Free eBooks: https://accautomation.ca (subscribe for download)
๐ RECOMMENDED HARDWARE
โถ Shop: https://www.automationdirect.com/
โถ Parts Guide: https://www.accautomation.ca/purchase-find-parts/
๐ฌ Questions? Drop a comment below.
๐ New tutorials every Monday โ Subscribe and hit the bell!
#PLC #LadderLogic #IndustrialAutomation #PLCProgramming #ACCAutomation #ProductivityPLC #AutomationDirect #PLCTutorial #LearnPLC
Regards,
Garry
ACC Automation
http://www.accautomation.ca Fastest Way to Access Instructions! #PLCProgramming #Automation #Tutorial](https://i.ytimg.com/vi/J36YyCylIrI/mqdefault.jpg)




