With the simulator on this site, you can create wiring and ladder programs in your browser and actually run 3D equipment models.
Choose a piece of equipment from the list to open its page, and switch between "Equipment", "Wiring", and "Ladder" from the menu at the top.
This page explains how to create the wiring and how to write ladder logic (how to enter instructions and what the symbols mean).
Place the parts needed to run the equipment model on the wiring panel and wire them. Once you learn device wiring with the wiring model, you will be able to read equipment electrical drawings!
Let's learn through the simulator!
Press the "Ladder" button at the top of the equipment page to open the ladder editor in a separate window.
This video briefly explains how to write ladder logic. Please watch it first.
Select the cell you want to edit and enter an instruction.
Below are the instructions available in this simulator.
(Real PLCs have hundreds of instructions, but only a limited number are used in practice. This simulator provides the most frequently used ones.)
Placed in the middle of a row to decide whether power flows to the right.
| Instruction | Example | Symbol | Name | Meaning |
|---|---|---|---|---|
LD | LD X0 | N.O. contact | While the specified device is ON, the condition is satisfied and power flows to the right. | |
LDB | LDB X0 | N.C. contact | The opposite of an N.O. contact: power flows while the device is OFF. | |
LDP | LDP X0 | Rising edge | Power flows for only one scan at the moment the device changes from OFF to ON. Use it when you want a single response even if the button is held (e.g. counting). | |
LDF | LDF X0 | Falling edge | Power flows for only one scan at the moment the device changes from ON to OFF. Use it for things like "when the button is released". | |
= | = DM0 3 | Equal | Power flows only while the value of the word device (DM) equals the comparison value. |
Execute something when the condition on the left is satisfied.
| Instruction | Example | Symbol | Name | Meaning |
|---|---|---|---|---|
OUT | OUT Y0 | Coil (output) | Turns the device ON while the condition on the left is satisfied, and OFF when it is not. | |
SET | SET MR0 | Set | Turns the device ON when the condition on the left is satisfied. It stays ON even after the condition is no longer satisfied, until it is turned OFF with RES. | |
RES | RES MR0 | Reset | Turns the device OFF when the condition on the left is satisfied. Use it to turn back a device that was turned ON with SET. | |
TMR | TMR T0 10 | Timer | Measures time only while the input is ON, and turns the timer (T0) ON when the preset time is reached (in units of 100 ms; 10 = 1 second). The count resets when the input turns OFF. Like OUT, it is placed in the last column of the ladder, and in RUN mode the remaining time (black) and preset value (red) are shown below the cell. Use the timer result as a contact, such as LD T0. Only T devices can be specified. | |
INC | INC DM0 | Increment | While the input is ON, adds 1 to the DM value every scan (after 65535 it wraps to 0). To add only once, place a rising edge (LDP) before it. |
Used when writing ladder logic for models with servo motors.
They are explained in detail on the model pages.
| Instruction | Example | Symbol | Name | Meaning |
|---|---|---|---|---|
U_WRPPNT | U_WRPPNT 1 5 | Write start point | Used in equipment with a positioning unit. In the form U_WRPPNT axis point, writes the start point number of the specified axis. A DM can be specified instead of a number for the point (e.g. U_WRPPNT 1 DM0). | |
U_RDAERC | U_RDAERC 1 DM10 | Read axis error code | Used in equipment with a positioning unit. In the form U_RDAERC axis DM, reads the error code of the specified axis into the DM. |
ld x0 → LD X0).OUT, SET, RES, and INC are automatically placed at the right end of the row no matter which cell you enter them in, and the gap is filled with a horizontal line.| Device | Range | Description |
|---|---|---|
X | X0〜X15 | Input relays. Signals from buttons and sensors |
Y | Y0〜Y15 | Output relays. Drive lamps and solenoid valves |
MR | MR0〜MR99 | Internal relays. Used to remember ON/OFF states inside the PLC |
T | T0〜T99 | Timers. Used with the TMR instruction and can also be read as contacts |
DM | DM0〜DM99 | Data memory (word devices). Holds a number from 0 to 65535 |
CR2002 / CR2003 | — | Always ON / Always OFF. Can be used only as contacts, not with OUT, SET, or RES |
CR2008 | — | First scan ON. ON only for the first scan after RUN starts. Can be used only as a contact, not with OUT, SET, or RES |
Ctrl+←/→ moves the selection while drawing a horizontal line in the selected cell.Ctrl+↑/↓ draws a vertical line connecting the rows above/below at the left edge of the selected cell (press again to erase it). An OR (parallel) circuit is made by drawing a vertical line in the cell of the column where the branched rows should merge.
| Operation | Description |
|---|---|
| Ctrl+← / → | Move left/right while drawing a horizontal line |
| Ctrl+↑ / ↓ | Draw (or erase) a vertical line to the row above/below at the left edge of the cell |
| Delete | Clear the selected cells |
| Shift+arrow / Shift+click | Extend the selection |
| Ctrl+C / X / V | Copy / cut / paste the selection |
| Shift+Enter | Insert an empty row above the selected row |
| Shift+Delete | Delete the selected row |
| Ctrl+Z | Undo the last edit (up to 10 steps) |
| Esc | Close the input window |
Use "Insert row comment" on the toolbar to add a row that describes a circuit, and "Show comments" to give each device a comment (e.g. X0 = start button). Device comments are shown under the symbols in the ladder. "Save ladder" and "Load ladder" save to and load from a file.
Press "▶ Run" in the menu to start the ladder. If there is a cell not connected to the left bus bar (unconnected), a compile error occurs, and the row and column of the error are shown at the top of the ladder window.
Also, if the same device is written by multiple OUTs (or by OUT and SET/RES), a double coil warning is shown at the top of the ladder window and the cells turn yellow. A double coil is overwritten by the result of the instruction executed later and causes unintended behavior, so keep the output to each device in one place.
While running, contacts and coils that are ON are shown in blue, and you can also check the current values of DMs. To rewrite the ladder, press "■ Back to edit".