LEQ — Less Than or Equal

Description
Section titled “Description”LEQ (Less Than or Equal) is true when Source A is less than or equal to Source B. It is LES with the boundary included, and like every compare instruction it writes nothing. Use LEQ when the threshold value itself should trigger: a reorder point, a “reached zero” test on a countdown, a floor that is allowed. When the boundary must not count, use LES. LEQ does not accept STRING operands.
Operands
Section titled “Operands”| Operand | Type | Format | Valid Range | Required | Description |
|---|---|---|---|---|---|
| Source A | Any numeric tag, member, element or bit, or a literal | Tag, Tag.Member, Tag[n], Tag.bit, or a literal |
Any resolvable numeric reference | Yes | The value under test. |
| Source B | Same as Source A | Same | Any resolvable numeric reference; defaults to 0 | Yes | The threshold, inclusive. |
Literals may be whole numbers (25, -3, 0x1F) or decimals (72.5). Mixed INT and REAL operands compare as numbers. A BOOL reads as 0 or 1.
Scan Behavior
Section titled “Scan Behavior”Prescan
Section titled “Prescan”No state. Evaluates from the current values on the first scan.
Rung-condition-in is false
Section titled “Rung-condition-in is false”The instruction does not pass continuity. The block still colours by its own result on the canvas.
Rung-condition-in is true
Section titled “Rung-condition-in is true”Both operands are read. If A is less than or equal to B the instruction conducts; if A is greater than B the rung is false from this point.
Postscan
Section titled “Postscan”Nothing.
Example
Section titled “Example”Scenario: A parts feeder reports how many parts remain. At five or fewer a reorder lamp lights so the operator refills before it runs dry.
Tags:
Parts_Left— Parts remaining, INTReorder— Reorder lamp, BOOL
Rung 1:
—[LEQ Parts_Left 5]———(OTE Reorder)———Scan 1 — Parts_Left = 12. 12 is greater than 5: the block is dark, Reorder = 0.

Scan 2 — Parts_Left = 5. 5 is equal to 5, and equal counts: the block lights, Reorder = 1.

With LES in place of LEQ the lamp would wait for 4.
See Also
Section titled “See Also”- LES — Less Than (boundary excluded)
- GEQ — Greater Than or Equal (the mirror test)
- LIM — Limit Test
- CMP — Compare by expression
- Compare Instructions — Category index
LEQ A B is GEQ B A. Pick whichever reads naturally on the rung; they compile to the same test.
Zero and below. LEQ Count 0 catches a countdown that has reached zero and also one that has gone negative, which a plain EQU Count 0 would miss.
Members as operands. LEQ Batch.ACC 2 is true for the first two counts of a batch.
Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-11 · Screenshots verified 2026-09-11