Instructions
Reference pages for every Structured Text instruction available in rungs.dev.
Each page gives the instruction's operands, what it does across scans, and a worked example.
Timer/Counter
TONR — On-Delay Timer
TONR is the Structured Text on-delay timer function block in rungs.dev. It uses FBD_TIMER and mirrors the behavior of the ladder TON instruction.
TOFR — Off-Delay Timer
TOFR is the Structured Text off-delay timer function block in rungs.dev. It uses FBD_TIMER and mirrors the behavior of the ladder TOF instruction.
RTOR — Retentive Timer
RTOR is the Structured Text retentive timer function block in rungs.dev. It uses FBD_TIMER and mirrors the behavior of the ladder RTO instruction.
CTUD — Count Up / Down
CTUD is the Structured Text up/down counter function block in rungs.dev. It uses FBD_COUNTER and combines the roles of ladder CTU and CTD instructions.
Bit
Array
COP and CPS — Copy
COP and CPS are the Structured Text instructions in rungs.dev that copy a run of elements from one array into another, clamped to whichever array runs out first.
SIZE — Size In Elements
SIZE is the Structured Text instruction in rungs.dev that counts the elements of an array tag and stores the count in a DINT tag, so loops never hardcode an array's length.
SRT — Sort
SRT is the Structured Text instruction in rungs.dev that sorts a run of array elements into ascending order in place, using the length and position on its CONTROL tag.
Comments and Documentation
Document Structured Text in rungs.dev with single-line and multi-line comments. Learn syntax, conventions, and patterns that make PLC programs maintainable.
TONR — On-Delay Timer
TONR is the Structured Text on-delay timer function block in rungs.dev. It uses FBD_TIMER and mirrors the behavior of the ladder TON instruction.