About this simulator

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).

How to create the wiring

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!

Wiring tutorial video

Besides the buttons and lamps in the video, you will wire many other devices such as sensors and solenoid valves.
How to wire each device is explained on each model's page.

How to write ladder logic

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.

Ladder tutorial video

How to enter instructions

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.)

Contact (condition) instructions and symbols

Placed in the middle of a row to decide whether power flows to the right.

InstructionExampleSymbolNameMeaning
LDLD X0N.O. contactWhile the specified device is ON, the condition is satisfied and power flows to the right.
LDBLDB X0N.C. contactThe opposite of an N.O. contact: power flows while the device is OFF.
LDPLDP X0Rising edgePower 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).
LDFLDF X0Falling edgePower 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 3EqualPower flows only while the value of the word device (DM) equals the comparison value.

Output and other instructions and symbols

Execute something when the condition on the left is satisfied.

InstructionExampleSymbolNameMeaning
OUTOUT Y0Coil (output)Turns the device ON while the condition on the left is satisfied, and OFF when it is not.
SETSET MR0SetTurns 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.
RESRES MR0ResetTurns the device OFF when the condition on the left is satisfied. Use it to turn back a device that was turned ON with SET.
TMRTMR T0 10TimerMeasures 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.
INCINC DM0IncrementWhile 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.

Application instructions

Used when writing ladder logic for models with servo motors.
They are explained in detail on the model pages.

InstructionExampleSymbolNameMeaning
U_WRPPNTU_WRPPNT 1 5Write start pointUsed 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_RDAERCU_RDAERC 1 DM10Read axis error codeUsed in equipment with a positioning unit. In the form U_RDAERC axis DM, reads the error code of the specified axis into the DM.
Lowercase input is treated as uppercase (ld x0 → LD X0).
Instructions such as 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.

Available devices

DeviceRangeDescription
XX0〜X15Input relays. Signals from buttons and sensors
YY0〜Y15Output relays. Drive lamps and solenoid valves
MRMR0〜MR99Internal relays. Used to remember ON/OFF states inside the PLC
TT0〜T99Timers. Used with the TMR instruction and can also be read as contacts
DMDM0〜DM99Data 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

Drawing lines and editing

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.

OperationDescription
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
DeleteClear the selected cells
Shift+arrow / Shift+clickExtend the selection
Ctrl+C / X / VCopy / cut / paste the selection
Shift+EnterInsert an empty row above the selected row
Shift+DeleteDelete the selected row
Ctrl+ZUndo the last edit (up to 10 steps)
EscClose 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.

Running

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".