A motor that starts on a push-button, holds itself on, and stops on a second button is the first circuit every controls person learns. Here it is written four ways. Every program below runs in the browser editor and behaves identically, so what you see is the notation, not the logic.
START and STOP are push-buttons and MOTOR is the contactor output. The motor appears in its own rung as a holding contact in parallel with START. A real stop button is normally wired closed, so on real equipment its input reads on at rest and the stop contact is inverted. The examples use a simple normally open stop so the four forms line up.
Allen-Bradley (Logix)
Ladder, written as text
TAG START I:0/0 BOOL TAG STOP I:0/1 BOOL TAG MOTOR O:0/0 BOOL (XIC START OR XIC MOTOR) AND XIO STOP OTE MOTOR
Tags are named variables. The motor bit is examined in parallel with START as the holding contact.
Siemens (TIA Portal)
Statement list (STL)
VAR
START AT %I0.0 : BOOL;
STOP AT %I0.1 : BOOL;
MOTOR AT %Q0.0 : BOOL;
END_VAR
AN STOP
A(
A START
O MOTOR
)
= MOTORThe stop contact comes first, then A( opens a group so START OR MOTOR is evaluated as one term before it is ANDed in. In LAD or SCL the same logic is drawn or written as MOTOR := (START OR MOTOR) AND NOT STOP;.
Mitsubishi (GX Works)
Instruction list
VAR START AT %I0.0 : BOOL; STOP AT %I0.1 : BOOL; MOTOR AT %Q0.0 : BOOL; END_VAR LD X0 OR Y0 ANI X1 OUT Y0
Devices, not names: X0 is START, X1 is STOP and Y0 is the motor. OR Y0 is the holding contact.
CODESYS and IEC 61131-3
Ladder text or structured text
VAR START AT %I0.0 : BOOL; STOP AT %I0.1 : BOOL; MOTOR AT %Q0.0 : BOOL; END_VAR | (START OR MOTOR) AND NOT STOP | := MOTOR ;
In structured text the same line is MOTOR := (START OR MOTOR) AND NOT STOP;. The ladder form shows the contacts and the coil.
These are general differences only. Exact behaviour depends on the controller series and software version, so confirm each detail in the manufacturer's manual.
| Aspect | Allen-Bradley | Siemens | Mitsubishi | CODESYS and IEC 61131-3 |
|---|---|---|---|---|
| How the program is organised | Tasks own programs, and programs own routines. | Organisation blocks call functions and function blocks; data blocks hold values. | A main program of rungs ending in END, with optional subroutines and interrupt programs. | Tasks run programs, which call functions and function blocks. |
| How data is named | Symbolic tags with scope. | Absolute areas such as I0.0 with symbolic names on top. | Device letters and numbers such as X0, Y0, M0 and D0. | Symbolic variables, with direct %IX style addresses for located variables. |
| When physical inputs are read | Module data is exchanged on its own schedule, not frozen once per scan. | Copied into a process image once per cycle by default. | Refreshed once per scan, before the program runs. | Mapped inputs are read at the start of each task cycle. |
| Where scan or cycle time is shown | Task properties show last and maximum scan time. | Online diagnostics show current, shortest and longest cycle time. | Special registers and a monitor show scan time; the addresses differ by series. | The task configuration monitor shows cycle time and jitter. |
| On-delay timer | A TIMER tag with preset, accumulated time and a done bit. | An IEC TON instance with PT, ET and Q. | A timer coil on a T device with a K value in 100 ms or other units. | An IEC TON instance with PT, ET and Q. |
| Latch and unlatch names | OTL and OTU. | S and R coils or statements. | SET and RST. | S and R coils, or an assignment in structured text. |
Want to measure scan time rather than read about it? Try the PLC scan time calculator or the scan cycle visualizer.
Yes. Each one latches the motor on a start press, holds it through the release, drops it on stop, and lets stop win if both buttons are held. We run all four against the same test steps to check it, so the differences you see are in notation, not in behaviour.
That is the seal-in or holding contact. Once the motor output is on, the rung reads that output as a parallel path around the start button, so the rung stays true after the button is released. Every vendor uses the idea; only the instruction names change.
The idea is the same: read inputs, run the logic, write outputs, repeat. The details differ, such as when inputs are sampled and where scan time is reported. The table on this page states the general differences, and your controller's manual has the exact behaviour for your series.
Real stop buttons are normally wired closed so a broken wire stops the machine. That makes the stop input read on at rest and changes which contact you use. The examples use a simple normally open stop to keep the comparison clear. Emergency stops must never depend on PLC logic alone. Follow your site procedures and the manufacturer's instructions for real equipment.
Training material. Follow your site procedures, local electrical code and the manufacturer's instructions. Lockout/tagout and a qualified person are required for real equipment.