Instructions

Reference pages for every Ladder Logic instruction available in rungs.dev.

Each page gives the instruction's operands, what it does across scans, and a worked example.

Bit

Timer/Counter

Math

Move/Logical

Compare

Array

BSL and BSR — Bit Shift

BSL and BSR in rungs.dev move every bit of a DINT array one place along on each rising edge, feeding a new bit in at one end. Use them to track parts down a conveyor.

FFL and FFU — FIFO Queue

FFL and FFU in rungs.dev build a first-in first-out queue in an array — load a value at one end, take the oldest out at the other. Use them to track parts waiting their turn.

LFL and LFU — LIFO Stack

LFL and LFU in rungs.dev build a last-in first-out stack in an array — push a value on top, take the newest one back off. Use them for undo histories and nesting.

COP and CPS — Copy

COP and CPS in rungs.dev copy a run of elements from one array into another. Use them to snapshot a buffer, replicate a value, or move a batch of readings in one rung.

FLL — Fill

FLL in rungs.dev writes one value into every element of a run of an array. Use it to clear a buffer, preset a recipe, or zero a structure in one rung.

SIZE — Size In Elements

SIZE in rungs.dev counts the elements of an array and stores the count in a tag, so a rung never has to hardcode how long an array is.

AVE and STD — Average and Spread

AVE and STD in rungs.dev work out the average and the standard deviation of a run of array elements. Use them to smooth a noisy reading or to tell steady from unstable.

SRT — Sort

SRT in rungs.dev sorts a run of array elements into ascending order, in place. Use it to find a median, rank readings, or order a batch before working through it.

FAL and FSC — Loop Over an Array

FAL and FSC in rungs.dev run one expression once per array element. FAL stores each answer; FSC stops at the first element that passes. Use them to scale a batch or find a value.

Program

On this page