Compare (input instruction)
EQU: Equal
Passes power while A exactly equals B.
Also called: equal contact, compare contact, = test, == test.
EQU(a, b)What it does
EQU tests for one exact value. That makes it the wrong instruction for anything measured and the right instruction for anything your own program wrote.
The place it belongs is a step register. A sequence built as a number, where one rung runs at step 10, the next at step 20 and so on, is the clearest structure a beginner can put on a machine, and every one of those rungs starts with EQU(Step, 20). It can be exact because your own MOV instructions put those numbers there, so they land on the values you test for.
The place it does not belong is a measurement. A position that reads 28, then 31, then 34 never equals 30, and a rung waiting for EQU(Position, 30) waits for ever. Nothing looks wrong: the logic is correct, the value simply steps over the one number you asked about. Use GEQ for anything that arrives from the field.
A rung you can run
A step sequence, the one place EQU is exactly right
EQU(Step,0)XIC(Start_PB)MOV(Step,10)
EQU(Step,10)TON(Dwell,3000)
EQU(Step,10)XIC(Dwell.DN)MOV(Step,20)
EQU(Step,20)OTE(Eject_Sol)
EQU(Step,20)XIC(Eject_Done)MOV(Step,0)Step is 0 at power up, so the machine is idle and waiting. Press Start_PB and it moves to 10, where a timer runs for three seconds; then to 20, where the eject solenoid is on until Eject_Done comes back; then home to 0. Exactly one step is active at a time, and every value in the register was written by a MOV in this program, which is why EQU can be trusted here.
Run this rung in the simulatorWhat it is called on other controllers
| Platform | Equivalent |
|---|---|
| Rockwell (Studio 5000) | EQU |
| Siemens (TIA Portal) | The comparator box, set to CMP == |
| Mitsubishi (GX Works) | LD= / AND= / OR= |
| CODESYS and IEC 61131-3 | EQ, or = in structured text |
Common mistakes
- Testing a measured value for equality. Analog values, encoder counts and anything scaled move in jumps larger than one and can skip your number entirely. This is the classic machine that gets to within a whisker of the target and then just stops. Use GEQ or LIM.
- Writing the step number from more than one place. If two rungs can both move the sequence on, the step register lands somewhere neither of them expected, and every EQU in the routine goes false at once.
Practise it
Interactive exercises that use EQU. Each one checks your ladder against a real scan.
- Step SequenceA two-step batch cycle driven by step coils: press Start → FILL until the high level, then DRAIN until the low level, then done. This is how real machine sequences are structured: one coil per step, with clean hand-offs.
- Mode (Auto / Manual)Two mutually exclusive mode coils selected by momentary buttons: the skeleton behind every Auto/Manual selector. Each mode seals itself in, and pressing the other button switches over cleanly.
