← All Posts

PLC Simulator for macOS: Write, Compile, and Test Without Hardware

PLC programming has always required hardware — a PLC on your desk, connected via Ethernet or USB, with real I/O wired up. That's a barrier for learning, prototyping, and testing. A PLC simulator removes that barrier entirely. You write your program, compile it, and run it on a virtual PLC that behaves like the real thing — cyclic scan, timers, counters, I/O mapping — all in software.

This guide covers what PLC simulators do, how they work, and the native macOS option: Voltrus PLC — a full IEC 61131-3 Structured Text editor with a built-in softPLC runtime.

What Is a PLC Simulator?

A PLC simulator (also called a softPLC or virtual PLC) is software that executes PLC programs without physical hardware. It mimics the behavior of a real PLC controller:

  • Cyclic scan execution — reads inputs, executes logic, writes outputs, repeats. Just like a real PLC's scan cycle.
  • Timer and counter function blocks — TON, TOF, TP, CTU, CTD, CTUD all work as specified by IEC 61131-3.
  • Variable monitoring — watch tables show live values updating in real time as the program executes.
  • I/O simulation — force input values, observe output changes, test edge cases without physical signals.
  • Debugging — breakpoints, single-step execution, call stack inspection — the same tools you'd use in a real PLC.

The key difference between a simulator and an emulator: a simulator runs your PLC program in a software runtime, while an emulator mimics a specific hardware PLC's firmware. Simulators are faster and more portable; emulators are more accurate to a specific vendor's hardware.

Why You Need a PLC Simulator

Whether you're learning PLC programming or a seasoned engineer, a simulator changes your workflow:

Learning PLC Programming

A physical training PLC costs $200-2,000. Plus power supplies, wiring, switches, and indicators. A simulator is free and instant — write code, hit run, see results. The feedback loop is seconds instead of hours of hardware setup.

Prototyping Control Logic

Before deploying to a $5,000 PLC on a production line, test your logic. Catch timer bugs, verify counter reset conditions, confirm state machine transitions. A simulator catches logic errors that could damage equipment if deployed untested.

Field Commissioning

On-site with a client, debugging a PLC issue. Pull out your MacBook, load the program into the simulator, reproduce the issue, test fixes, deploy to the real PLC. No need to carry a spare PLC for testing.

Education and Training

Classrooms can't equip every student with a PLC. A simulator lets 30 students each run their own PLC program simultaneously on their laptops. Standardized environment, zero hardware cost.

PLC Simulators Available for macOS

Most PLC simulators are Windows-only. Here's what actually runs on macOS:

Tool
macOS Native
IEC 61131-3 ST
Debug Tools
Voltrus PLC
Yes — Apple Silicon + Intel
Full ST editor + compiler
Breakpoints, step, watch, trends
CODESYS
No — Windows + Wine only
All 5 IEC languages
Full online debug
OpenPLC
Partial — browser-based editor
ST + LD
Basic watch table
TIA Portal PLCSIM
No — Windows only
SCL (Siemens ST dialect)
Full Siemens debug
TwinCAT PLC
No — Windows only
All IEC + C++
Full Beckhoff debug
IronPLC
VS Code extension
ST only, early
Limited
The reality: Before Voltrus PLC, there was no native macOS application that combined an IEC 61131-3 Structured Text editor, compiler, and softPLC runtime. Your options were Windows VMs, browser-based tools, or VS Code extensions without a runtime.

How Voltrus PLC's Simulator Works

Voltrus PLC is a desktop app for macOS (and Windows/Linux) that includes the full PLC development pipeline in one ~30 MB download:

1. Write Structured Text

The editor is built on CodeMirror 6 with IEC ST syntax highlighting, autocomplete for keywords and standard functions, and inline error squiggles. Multi-file tabs, project tree sidebar, dark and light themes.

2. Compile to Bytecode

The ST compiler (mt-stc) parses your IEC 61131-3 Structured Text and emits bytecode for the VM runtime. Compile errors show inline in the editor with source location. Typical compile times are under 100ms for programs with hundreds of lines.

3. Run on the SoftPLC Runtime

The runtime (mt-plc-runtime) is a stack-based bytecode VM that executes your program in cyclic scan mode. You control the scan cycle: run continuously, single-step, or pause at breakpoints. The runtime supports:

  • Timer function blocks: TON (on-delay), TOF (off-delay), TP (pulse)
  • Counter function blocks: CTU (count up), CTD (count down), CTUD (bidirectional)
  • Edge detection: R_TRIG (rising edge), F_TRIG (falling edge)
  • Standard functions: math, comparison, string, type conversion
  • Arrays: ARRAY [1..10] OF INT with full index access

4. Monitor and Debug

While the program runs, you get real-time visibility:

  • Watch table — add variables, see values update live every scan cycle
  • Trend chart — plot variable values over time with multi-series, pan, and zoom
  • Breakpoints — pause execution at specific ST lines, inspect variables, resume
  • Single-step — advance one line at a time, watch state changes
  • Force/unforce — override variable values from the watch table to test specific scenarios
  • Scan timing — real-time graph of cycle times with min/max/avg/p99 statistics

Example: Motor Control with Soft Start

Here's a real PLC program you can write and run in the simulator. A motor starter with a TON timer for soft-start ramp-up:

PROGRAM MotorControl VAR StartBtn : BOOL; (* Start push button *) StopBtn : BOOL; (* Stop push button *) Motor : BOOL; (* Motor contactor output *) RampTimer : TON; (* Soft start timer *) FaultReset : BOOL; (* Reset after fault *) Overload : BOOL; (* Overload trip input *) MotorReady : BOOL; (* Interlock ready signal *) END_VAR (* Motor ready when no overload *) MotorReady := NOT Overload OR FaultReset; (* Self-holding circuit with soft start *) IF StartBtn AND MotorReady AND NOT Motor THEN RampTimer(IN := TRUE, PT := T#5S); IF RampTimer.Q THEN Motor := TRUE; END_IF; ELSIF StopBtn OR Overload THEN Motor := FALSE; RampTimer(IN := FALSE, PT := T#5S); END_IF;

Run this in the simulator. Set StartBtn := TRUE in the watch table, wait 5 seconds, see Motor go TRUE. Set Overload := TRUE and watch the motor trip immediately. No hardware needed. v1.0 available now — $29.99 one-time.

Connecting to Real I/O

When you're ready to move from simulation to real devices, Voltrus PLC supports multiple I/O drivers:

  • Modbus TCP — read/write holding registers, coils, inputs from any Modbus device
  • Modbus RTU — serial RS-485 Modbus communication
  • OPC-UA — connect to any OPC-UA server for vendor-neutral data access
  • Siemens S7 — read/write data blocks on S7-1200/1500 PLCs
  • EtherNet/IP — connect to Allen-Bradley ControlLogix/CompactLogix PLCs
  • MQTT — bridge to IoT platforms and cloud services

The I/O mapping panel lets you bind ST variables to physical register addresses. When the runtime is in "Run" mode with I/O enabled, variable reads and writes go to real devices instead of simulated values. Same code, same debugger — just connected to real hardware.

PLC Simulator vs Physical PLC: When Each Wins

Scenario
Simulator
Physical PLC
Winner
Learning ST syntax
Instant feedback, free
$200+ hardware
Simulator
Testing timer logic
Watch table, trends
Works but slower to iterate
Simulator
State machine debugging
Breakpoints, single-step
Limited online debug
Simulator
Real-time performance
Not deterministic
Guaranteed scan times
Physical
Safety validation
Cannot certify
Safety-rated controllers
Physical
Field commissioning
Quick logic fixes
Final validation
Both

FAQ

Can you simulate PLC programs on macOS?
Yes. Voltrus PLC includes a built-in softPLC runtime that runs IEC 61131-3 Structured Text programs directly on macOS. You can write, compile, and execute PLC logic with live variable monitoring, breakpoints, and single-step debugging — all without any physical PLC hardware. The runtime executes in cyclic scan mode just like a real PLC.
What is the best PLC simulator for macOS?
Voltrus PLC is the only native macOS PLC IDE with a built-in simulator. It includes a CodeMirror 6 ST editor, IEC 61131-3 compiler, softPLC VM runtime, watch table, breakpoints, trend charts, and I/O drivers for Modbus, OPC-UA, Siemens S7, EtherNet/IP, and MQTT. $29.99 one-time, Apple Silicon native.
Do I need hardware to learn PLC programming?
No. A softPLC simulator lets you learn IEC 61131-3 Structured Text, write programs, and test them entirely in software. The built-in runtime executes your code in cyclic scan mode with real timer and counter behavior. You only need physical hardware when you want to connect to actual field devices.
How is a PLC simulator different from CODESYS?
CODESYS includes a simulator but only runs on Windows. Voltrus PLC is macOS native and includes a comparable simulator — ST editor, compiler, cyclic scan runtime, watch table, breakpoints. CODESYS supports all 5 IEC languages and has 400+ hardware vendor integrations; Voltrus PLC focuses on ST with multi-protocol I/O drivers (Modbus, OPC-UA, S7, EIP, MQTT).
Can I deploy simulator-tested code to a real PLC?
Voltrus PLC runs standard IEC 61131-3 Structured Text, which is portable across vendors. Code tested in the simulator uses standard timer/counter blocks and types that translate to any PLC supporting ST (Siemens SCL, Codesys ST, Beckhoff ST). Vendor-specific libraries and hardware addresses need adaptation, but the core logic is portable.

PLC Simulator for macOS

Write, compile, and run IEC 61131-3 Structured Text on your Mac. Built-in softPLC runtime, watch table, breakpoints, and trend charts. No hardware needed. v1.0 available now — $29.99 one-time.

Download for Mac →