Skip to content

LEQ — Less Than or Equal

Category
Compare
Type
Input (condition)
Availability
All platforms

LEQ instruction block: Source A Parts_Left reading 12, Source B 5, dark because 12 is above 5


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.


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.


No state. Evaluates from the current values on the first scan.

The instruction does not pass continuity. The block still colours by its own result on the canvas.

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.

Nothing.


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, INT
  • Reorder — 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.

Figure 1 — LEQ false: Parts_Left reads 12 against Source B 5, the block dark, Reorder off

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

Figure 2 — LEQ true at the boundary: Parts_Left reads 5, the block lit, Reorder on

With LES in place of LEQ the lamp would wait for 4.


  • 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