Bit Instructions Overview
Bit instructions are the core of Ladder Logic. They examine or control a single BOOL value — a contact on the input side, a coil on the output side.
XIC — Examine If Closed
Passes power along the rung when the referenced bit is 1. Equivalent to a normally-open contact.
XIO — Examine If Open
Passes power along the rung when the referenced bit is 0. Equivalent to a normally-closed contact and the closest thing to a NOT in ladder logic.
OTE — Output Energize
Sets a bit to 1 while the rung is true and back to 0 when the rung goes false. The standard output coil.
OTL / OTU — Latch and Unlatch
Latches a bit to 1 and leaves it on, even after the rung goes false. Pair with OTU to clear.
ONS — One Shot
Makes a rung true for exactly one scan on each rising edge of its input. Requires a dedicated storage bit per instance.
Timers Overview
Timers measure elapsed time. A timer instruction references a TIMER tag, which is a structure with a preset, an accumulator, and three status bits.
TON — On-Delay Timer
On-delay timer. Starts timing when the rung goes true; sets .DN when .ACC reaches .PRE. Resets the moment the rung goes false.
TOF — Off-Delay Timer
Off-delay timer. Starts timing when the rung goes false; holds .DN at 1 for the preset duration after the rung drops.
RTO — Retentive Timer On
Retentive on-delay timer. Like TON, but the accumulator survives rung transitions. Must be cleared explicitly with RES.
Counters Overview
Counters track discrete events. A counter instruction references a COUNTER tag, which is a structure with a preset, an accumulator, and status bits.
CTU — Count Up
Increments .ACC by 1 on each rising edge of the rung. Sets .DN when .ACC reaches .PRE; keeps counting past the preset.
CTD — Count Down
Decrements .ACC by 1 on each rising edge of the rung. Typically paired with CTU on the same COUNTER tag.
RES — Reset
Clears the accumulator and status bits of a TIMER or COUNTER tag back to zero.
MOVE — Copy a Value
Copies a source value (literal or tag) into a destination tag.
Compare — EQ / NE / GT / GE / LT / LE
Compare two numeric values and pass power along the rung if the relationship holds. Compare instructions act like contacts — place them on the left side of a rung.
LIMIT — Range Check
Passes power when test is inside the inclusive range [lowLimit, highLimit]; bounds reverse to outside-the-band when lowLimit > highLimit.
Math — ADD / SUB / MUL / DIV
Perform arithmetic on two numeric sources and write the result to a destination tag. Math instructions act like coils — place them on the right side of a rung.