Normally open contact -] [-
Passes power when its bit is ON. Use it to ask "is this input on?"
Start_PB Lamp |----] [-------------( )----|
While the Start button is held, the lamp is on. Let go and the lamp goes off.
Ladder logic is the most common way to program a PLC, the industrial computer that runs a machine. It is drawn like a relay control diagram: each rung checks its input conditions on the left and turns an output on or off on the right.
Written by Paul. The rung below runs in your browser. No account, nothing to install.
This is the rung that starts and stops most motors. It is live. Change the inputs, run a scan, and watch what the PLC does.
Change a physical input, then advance one PLC phase at a time. The input image only changes during Read inputs.
The PLC copies the physical input terminals into its input image table.
The ladder is solved from the frozen input image and the previous output image.
The solved output image is copied to the physical output terminals.
These can change at any moment.
START
Input image
STOP_OK
Input image
OL_OK
Input image
Series path TRUE × Start/seal branch FALSE = solved MOTOR FALSE
MOTOR OFF
Changes only at Write outputs
Ready
Press Start, then read the physical inputs to begin.
Here you change the inputs. In the guided lab you place the contacts and the coil yourself. No signup.
If you can read a relay drawing, you can already read most of a ladder program. These six ideas cover the rest.
Want to watch the three steps one at a time? Use the first button under the live rung above to step one phase at a time, or open the PLC scan cycle visualizer.
Most ladder programs are built from these five instructions. Each one is shown with a small example.
-] [-Passes power when its bit is ON. Use it to ask "is this input on?"
Start_PB Lamp |----] [-------------( )----|
While the Start button is held, the lamp is on. Let go and the lamp goes off.
-]/[-Passes power when its bit is OFF. Use it to ask "is this input off?"
Fill_PB Tank_Full Fill_Valve |----] [-------]/[---------( )----|
The valve opens while Fill is pressed and the tank is not full. When Tank_Full turns on, the rung breaks and the valve closes.
-( )-The result of the rung. The coil turns its bit ON when power reaches it and OFF when it does not.
Pump_Request Pump |----] [-------------( )----|
Pump follows Pump_Request on every scan. A coil can drive a real output or an internal bit that other rungs read.
TONAn on-delay timer counts time while its rung is true. Its done bit turns on when the time reaches the preset.
Start_PB +--TON-----------+ |----] [---------| Delay 5 sec |----| Delay.DN Motor |----] [-------------( )----|
Hold Start for five seconds and the motor starts. Release early and the timer resets to zero.
CTUAn up counter adds one each time its rung goes from false to true. Its done bit turns on when the count reaches the preset.
Box_Sensor +--CTU-----------+ |----] [---------| Boxes 10 |----| Boxes.DN Full_Lamp |----] [-------------( )----|
Each box that passes the sensor adds one. On the tenth box the Full lamp turns on, and it stays on until the counter is reset.
Normally open and normally closed describe the contact in the program, not how the switch is wired. The full list, with every symbol and name, is on the ladder logic symbols page.
This is the same rung as the live one at the top of the page. It replaces the three-wire motor starter circuit that electricians already know.
STOP_OK OL_OK START MOTOR
|----] [-------] [----+-----] [-----+------( )----|
| MOTOR |
+-----] [-----+The stop button is wired normally closed, so its input is on while nobody is pressing it. The program checks "is the stop circuit healthy?" with a normally open contact. If a wire breaks or comes loose, the input goes off and the motor stops. Wiring the stop button normally open and using a normally closed contact would also work on paper, but a broken wire would then leave you with a stop button that does nothing.
This example shows how the logic works. A PLC rung is not a safety function. Emergency stops and guards on real machines need their own safety-rated circuits.
The shapes on the screen are nearly the same on every brand. The names are not. Allen-Bradley software uses its own short instruction names. Siemens and most other brands follow the IEC 61131-3 naming more closely.
| What it is | Allen-Bradley | Siemens and IEC 61131-3 |
|---|---|---|
| Name of the language | Ladder logic, Ladder Diagram | Ladder Diagram (LD) in IEC 61131-3. Siemens calls it LAD. |
| Normally open contact | XIC (Examine If Closed) | Normally open contact |
| Normally closed contact | XIO (Examine If Open) | Normally closed contact |
| Output coil | OTE (Output Energize) | Coil. Siemens calls it an assignment. |
| Latch and unlatch | OTL and OTU | Set coil (S) and reset coil (R) |
| On-delay timer | TON with .PRE, .ACC and .DN | TON with PT, ET and Q |
| Up counter | CTU with .PRE, .ACC and .DN | CTU with PV, CV and Q |
| Addresses | Tag names such as Start_PB. Older SLC 500 and MicroLogix use I:1/0 and O:2/0. | Named variables. Siemens also shows %I0.0 and %Q0.0. |
Our simulator teaches these naming styles as learning dialects. It is not Rockwell or Siemens software, it does not emulate controller firmware, and it does not open or export vendor project files.
A free account includes the first 6 of 12 core lessons in each of 9 PLC dialects and 32 practice scenarios. No card needed.