Instructions
Reference pages for every Structured Text instruction available in rungs.dev.
Every instruction below is documented with its operands, behaviour across scans, and worked examples. Use the sidebar to jump to one, or start with the basics.
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.
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.
OSRI / OSFI — One Shot Rising and Falling with Input
OSRI sets OutputBit for one scan when InputBit turns on; OSFI sets it for one scan when InputBit turns off. Both use the FBD_ONESHOT structure in rungs.dev Structured Text.
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.