NEQ — Not Equal

Description
Section titled “Description”NEQ (Not Equal) is true when Source A and Source B differ. It is the inverse of EQU and, like it, a condition that writes nothing. Use NEQ to detect a mismatch: a feedback value that has not caught up with a command, a mode word that is anything but idle, a checksum that does not match. Do not use NEQ to detect a change over time; it compares two values on the same scan, not one value against its previous scan.
Operands
Section titled “Operands”| Operand | Type | Format | Valid Range | Required | Description |
|---|---|---|---|---|---|
| Source A | Any numeric tag, member, element or bit; a STRING tag; or a literal | Tag, Tag.Member, Tag[n], Tag.bit, or a literal |
Any resolvable reference | Yes | The first value. |
| Source B | Same as Source A | Same | Any resolvable reference; defaults to 0 | Yes | The value to compare against. |
Literals may be whole numbers (25, -3, 0x1F), decimals (72.5), or quoted strings ("RUN"). A BOOL reads as 0 or 1. STRING operands compare by content, case-sensitively.
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 they differ the instruction conducts; if they are equal the rung is false from this point.
Postscan
Section titled “Postscan”Nothing.
Example
Section titled “Example”Scenario: A stepper sequence is commanded to a step number and reports the step it is actually on. While the two differ, the sequence is in motion and a “busy” lamp is lit.
Tags:
Cmd_Step— Commanded step, INTActual_Step— Reported step, INTBusy— Busy lamp, BOOL
Rung 1:
—[NEQ Actual_Step Cmd_Step]———(OTE Busy)———Scan 1 — both read 3. The sequence is parked on the step it was sent to. The values match: the block is dark, the rung is false, Busy = 0. Both operands are tags, so each shows its live value beneath it.

Scan 2 — Actual_Step reads 0. The sequence has been reset to home while Cmd_Step still calls for step 3. 0 is not 3: the block lights, the rung is true, Busy = 1, and it stays lit until Actual_Step climbs back to 3.

See Also
Section titled “See Also”- EQU — Equal (the inverse test)
- CMP — Compare by expression
- XIO — Examine If Open (the same idea for a single bit)
- Compare Instructions — Category index
NEQ against zero. NEQ Word 0 is true when any bit of Word is set, a quick “anything active?” test on a status word.
REAL values. Two REALs that were computed separately will almost always be “not equal” by a rounding error. Compare REALs with LIM, or with a GRT on the absolute difference from CPT.
Not a change detector. To act once when a value changes, keep a copy with MOV and compare against the copy, or use an ONS on the NEQ result.
Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-11 · Screenshots verified 2026-09-11