PLC Simulator
Loading…
PLC Simulator Guide
LOGO!Soft Comfort-style ladder & Function Block Diagram editor with a live HMI / process screen — free-place blocks, draw your own wires, bind tags to plant equipment, press Run.
1. Palette & placing blocks
- Palette groups: Contacts, Coils, Latches, Timers (TON / TOF / TP), Counters (CTU / CTD / CTUD / HRS), Messages.
- Drag a tile from the palette onto the canvas to place it. A ghost label follows your finger/cursor during the drag.
- Tags (
I0,Q0,T0,C0,H0,L0…) are auto-assigned; rename via the Configure dialog. - Drag the body of a placed block to move it. Wires re-route automatically.
2. Wiring — two ways to draw a wire
- Press & drag: press a pin, drag to another pin, release to connect. Works identically on mouse, trackpad, touch, and pen.
- Click, then move freely: click a pin without dragging, then move your mouse with no button held — the wire follows the cursor. Click the target pin to connect, or click empty canvas to drop a manual bend point. Press Escape or right-click to cancel.
- Either way, the wire bends automatically at 90° when you change direction, and its tip snaps onto a valid target pin the moment you're close enough — release or click to commit.
- Direction doesn't matter — drag input→output and it auto-flips.
- Feedback loops allowed. Wire from an output back into earlier logic (e.g. RS latch Q feeding an AND interlock) — the engine handles cycles with one-scan lag, same as LOGO! Soft Comfort.
- Ladder: The left rail is a full-height bus — drop a wire anywhere along its vertical line. FBD: Use DI/DO/AI/AO connector blocks for inputs and outputs.
- Unwired input pins evaluate as FALSE (bool) or 0 (numeric).
3. Configuring blocks
- Double-click a block to open its configure dialog.
- Change the tag; set a signal name (e.g. "Start PB"); pick the input widget type (momentary NO/NC, toggle, slider, rotary); choose lamp colour for outputs.
- Signal names follow the tag. Name the
Q0coil "Motor" — any contact you later point atQ0inherits "Motor" automatically. Edit once, re-used everywhere. - Timers & counters: set Preset in the dialog. TON/TOF/TP presets are in milliseconds; CTU/CTD/CTUD presets are counts; HRS preset is hours in ms.
- MSG blocks: type the message text — it appears as a persistent toast while the block is energised.
4. Timer / counter / latch outputs
Traditional LAD convention: these blocks show only their input pins on the left. Read their done/output bit with a contact bearing the same tag. Example: to use the output of T0, drop an NO contact and set its tag to T0. Wire that contact in series with your next logic.
5. Deleting + editing
- Select a block / wire (single-tap) → press Delete or Backspace, or use Edit ▾ → Delete from the toolbar.
- Deleting a block also removes every wire touching it.
- Right-click (desktop) or long-press (iPad / touch) a block or wire to open its context menu: Configure…, Duplicate (clones with a fresh tag + 40 px offset), Delete.
- Cmd/Ctrl+Z undo, Cmd/Ctrl+Shift+Z redo.
6. Run / Pause / Stop
- Run starts the scan. Wires turn red when energised (signal = true) and blue when not energised.
- Pause halts the tick loop but preserves engine state — timer accumulators, counter values, and tag bits are frozen so you can inspect mid-scan. Click Pause again (or Run) to resume.
- Stop clears engine state and returns to edit mode.
- While running, use the I/O panel at the bottom to toggle inputs and watch outputs.
- Edits are blocked during Run/Pause — Stop first.
7. View controls
- + / − in the toolbar: zoom in / out (×1.25 per click, clamped to 0.25×–4×).
- Fit: pan + zoom to show all blocks, including any off-screen.
- ⚙ Settings: grid size, grid visibility, snap-block-to-grid. Toggles are sticky across programs — new programs inherit your current settings.
| Action | Mouse / trackpad | iPad / touch / pen |
|---|---|---|
| Pan canvas | Two-finger drag (trackpad); scroll wheel — Shift + wheel for horizontal (mouse) | Two-finger drag |
| Zoom canvas | ⌘/Ctrl + scroll or wheel | Toolbar +/− (pinch zooms the page) |
| Draw wire | Press pin & drag (auto-bend), or click pin → move freely → click target | Drag pin → pin (change direction for bends) |
| Add wire bend | Automatic on direction change; click empty canvas in free-move mode | Automatic on direction change |
| Cancel wire | Escape / right-click | Release on empty canvas |
| Delete wire | Select + Del, or right-click → Delete | Long-press wire → Delete; or double-tap wire |
| Context menu | Right-click; two-finger tap on trackpad | Long-press (~½ s) |
8. Files
- File → New: fresh program with just a left rail.
- File → Open: native file picker (with a browser-local fallback list).
- File → Save / Save As: native Save File dialog on Chromium; download fallback on Firefox/Safari.
- File → Import / Export JSON: round-trip a program file.
- Export PDF: print the rung; Export PNG: rasterise the canvas to a high-res image for docs or tickets.
- All your programs are stored locally in your browser (Dexie / IndexedDB) — nothing leaves the device.
9. HMI — how to build a process screen
The HMI tab turns your ladder or FBD program into a live operator screen: a simulated plant of tanks, pumps, motors, valves and sensors that reacts to your logic in real time. It is the same idea as an SCADA / HMI faceplate in Rockwell FactoryTalk, Siemens WinCC or Inductive Automation Ignition — bound to tags, animated by the running scan. This section walks the whole build, from an empty canvas to a process you can run, operate and fault.
Step 1 — Start from the tags, not the picture
An HMI screen has nothing to bind to until the program declares some I/O, so write the rung first. Every plant component reads or writes exactly one tag:
Q— things the PLC drives: motor, pump, valve, lamp, horn.I— discrete things that drive the PLC: push-button, selector switch, E-stop, limit switch, float switch, photoeye.AI/AQ— analog: tank level, temperature, flow, pressure, VFD speed setpoint.
Shortcut: Auto-populate scans the active program and drops one already-bound component per tag. It is the fastest way to get a screen up for a rung you have already written — then rearrange and add pipework by hand.
Step 2 — Place the equipment
Drag a palette tile onto the canvas, or tap the tile and then tap where you want it. The palette is ordered along the signal path: Input Devices first (push-buttons, selector switches, level / proximity / temperature sensors), then Actuators (motor, motor-VFD, solenoid, cylinder), Valves (gate, ball, check, 3-way), Fluid System (tank, pump, mixer, drain, source), Conveyors, Electrical (relay, contactor, lamp, tower light, alarm horn) and Infrastructure.
Leave clear space above and below a vessel. Float switches mount there, and each component prints its label and tag underneath.
Step 3 — Pipe the process together
This is the step people skip, and it is why a screen can look finished but do nothing. Equipment is inert until it is connected: fluid only reaches a tank if there is an unbroken pipe path from a source or pump, through open valves, to that tank. The pipework is the circuit.
- Draw a pipe the same way you draw a wire — press a port dot, drag to another port dot, release. It bends once at 90° and meets both nozzles head-on.
- Ports have sides, and the side is physical. A tank takes fluid in on top and discharges from the bottom; a source discharges downward; a drain accepts from above; a pump has a suction and a discharge. Pipes approach each nozzle along its own axis, the way a P&ID is drawn.
- A valve in the run gates it. Closed valve, no flow — which is exactly what makes the logic worth writing.
- A tank empties by gravity through an open outlet valve to a drain. No discharge pump is required; the speed is the tank's Gravity drain rate.
Step 4 — Bind each device to a tag
Double-click a component (or right-click → Configure…) and pick the tag it belongs to. A motor bound to Q0 spins when that coil energises; a float bound to I0 writes that input on every scan; a tank bound to an AI publishes its level as a number your THRESH or ACMP block can compare. Give it a label here too — it prints under the glyph and shows up in the I/O panel.
Step 5 — Set the numbers that decide behaviour
The same dialog carries each device's parameters, and these are what make the process behave like a real one:
- Tank — Capacity (L), Starting level (L), Gravity drain rate (L/min).
- Pump — Flow rate (L/min).
- Float switch — Trip level (% full). The float makes its contact at or above that percentage of the tank it is mounted beside.
Size it so you can watch it. At the catalogue defaults — 100 L tank, 20 L/min pump — one fill takes five minutes. For a demonstration or a lesson, something like a 50 L tank at 120 L/min fills in well under a minute.
Step 6 — Run it and operate it
- Press Run. The physics loop starts: tanks fill and drain, pumps and motors spin, sensors trip their setpoints, alarms and interlocks fire — all feeding back into your logic on the next scan.
- Actuate inputs on the screen itself. Every push-button, selector switch and E-stop bound to an
Itag is live on the canvas while the program runs — a dashed ring appears as you hover it. Hold a push-button to keep it pressed and release to let it spring back; click a selector switch or E-stop to latch it. The INPUTS list on the right does exactly the same thing, so use whichever is closer to hand. - Whether a device is momentary or latching comes from how the tag is declared in the program's Configure dialog — not from which glyph you dropped on the screen. The glyph is a visualisation; the program is the authority.
- Pause freezes the process where it stands so you can read it — levels hold, impellers stop. Stop resets the plant to its starting state.
Step 7 — Prove the interlocks with faults
Inject a fault (jammed valve, seized motor, sensor failure, tank leak) and watch whether your alarm and interlock rungs actually catch it. This is the part of PLC training a logic-only editor cannot teach: a rung that looks correct on the ladder can still fail to protect the plant.
Worked example — two-float tank level control
Load Tank Water Level (Ladder/HMI) from the Examples menu and read it alongside the rungs. It fills a 50 L tank between two float switches:
- Below the low float (20 % = 10 L) the pump and inlet valve start.
- Past the low float the seal-in contact keeps them running. Without it the pump would stop the instant the float made, and the tank would never fill past 10 L — that seal-in is the whole lesson.
- At the high float (80 % = 40 L) the pump and inlet valve stop and the outlet valve opens.
- Draining, the outlet valve seals in too, so it stays open all the way down past the high float; below the low float it shuts and the cycle repeats.
The gap between the two floats is the deadband, and it comes from their physical spacing. Without it the pump would chatter on and off every scan as the level jitters across a single setpoint — which in a real plant destroys contactors. Tank Water Level (FBD/HMI) does the same job from one analog level reading with a THRESH block, where the deadband is the ON/OFF pair instead. Both examples are listed under both languages in the Examples menu.
Why is nothing happening?
Save the result
Export PDF produces a report with the plant screen, the program, the tag bindings and the recorded run — useful as a lab submission or a training record.