PLCSim
Simulate PLC programs in Structured Text (IEC 61131-3) directly in VS Code — no hardware needed.
PLCSim runs your Structured Text programs inside VS Code with a real-time I/O simulator. Toggle boolean inputs, set integer values and watch outputs update live — without a physical PLC.
Features
Core simulation
- Real-time scan cycle — configurable cycle time with drift compensation (stable ±1ms at 10ms cycles)
- I/O panel — editable inputs (toggle BOOL, numeric INT/REAL); read-only outputs updated live
- Scan metrics — cycle time, jitter and overrun indicator in the simulator panel
Full IEC 61131-3 ST support
| Feature |
Status |
BOOL, INT, REAL variables |
✅ |
:= assignment |
✅ |
IF / ELSIF / ELSE / END_IF |
✅ |
AND, OR, NOT, comparison operators |
✅ |
FOR, WHILE, REPEAT, CASE |
✅ |
TON, TOF timers · CTU counter |
✅ |
Custom FUNCTION_BLOCK declarations |
✅ Pro |
| Syntax highlighting (IEC 61131-3) |
✅ |
OPC-UA server (built-in)
- Starts automatically on port 4840 when the simulator opens
- Exposes all runtime variables as OPC-UA nodes (namespace
ns=2)
- Configurable NodeId format per manufacturer (
siemens-s7, rockwell, beckhoff, generic)
- Optional username/password authentication via
opcua.config.json
- PLCSim: Configure OPC-UA — creates or opens
opcua.config.json directly from the Command Palette
- Copy the OPC-UA URL to clipboard with PLCSim: Copy OPC-UA URL ✅ Pro
PLC dialect support ✅ Pro
Automatically detects and normalises vendor-specific syntax to standard IEC ST before execution:
- Siemens SCL —
#localVar, "SymbolicName", typed constants (INT#5), REGION...END_REGION
- Beckhoff TwinCAT — direct addresses (
%IX0.0, %QX0.0, %IW, %MW)
- Schneider Unity Pro — direct addresses (
%I0.0, %Q0.0, %MW, %M)
TIA Portal export ✅ Pro
Export any .st file as .scl for direct import into Siemens TIA Portal via External Sources.
License status bar
While a .st file is active, the status bar shows your current tier at a glance:
| Indicator |
Meaning |
$(shield) Free |
Free tier — Pro features are gated |
$(star) Early Adopter |
Full Pro access (installed before 2026-07-01) |
$(verified) Pro |
Active Pro license key |
Click the indicator to run PLCSim: Show License Info.
Commands
| Command |
Description |
PLCSim: Open Simulator |
Open the I/O simulator panel for the active .st file |
PLCSim: Open Example |
Copy a starter example into the workspace |
PLCSim: Export as .scl |
Export the active .st file for TIA Portal import ✅ Pro |
PLCSim: Configure OPC-UA |
Create or open opcua.config.json |
PLCSim: Copy OPC-UA URL |
Copy opc.tcp://localhost:port to clipboard ✅ Pro |
PLCSim: Show License Info |
Show current tier, install date and key status |
PLCSim: Show Upgrade Info |
Open the upgrade page at plcsim.appscat.cat |
Free vs Pro
| Feature |
Free |
Pro |
Basic ST simulation (IF, FOR, WHILE, CASE, TON/TOF/CTU) |
✅ |
✅ |
| I/O simulator panel (inputs + outputs, live updates) |
✅ |
✅ |
| Real-time scan metrics (cycle time, jitter, overrun) |
✅ |
✅ |
| Syntax highlighting (IEC 61131-3) |
✅ |
✅ |
| OPC-UA server — auto-start, read/write nodes |
✅ |
✅ |
OPC-UA configuration (PLCSim: Configure OPC-UA) |
✅ |
✅ |
| Examples 01–05, 07–08 |
✅ |
✅ |
Custom FUNCTION_BLOCK declarations |
— |
✅ |
| Copy OPC-UA URL to clipboard |
— |
✅ |
| Dialect support (Siemens SCL / Beckhoff TwinCAT / Schneider Unity) |
— |
✅ |
| TIA Portal export (.scl) |
— |
✅ |
| Examples 06, 09 (FUNCTION_BLOCK) |
— |
✅ |
Early Adopters (installed before 2026-07-01) receive full Pro access automatically — no key needed.
Activate Pro by entering your license key in VS Code Settings → plcsim.licenseKey.
Purchase at plcsim.appscat.cat.
Getting Started
1. Install the extension
Search for PLCSim in the VS Code Extensions panel and click Install.
2. Open the example
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run:
PLCSim: Open Example
This copies 01-conveyor-belt.st into your workspace folder.
3. Open the simulator
With the .st file active in the editor, run:
PLCSim: Open Simulator
The simulator panel opens beside your code. Toggle bSensorIn to TRUE and watch bMotorBelt activate.
Example
(* Conveyor belt — PLCSim example *)
VAR
bSensorIn : BOOL; (* Input sensor *)
bSensorOut : BOOL; (* Output sensor *)
bMotorBelt : BOOL; (* Belt motor *)
iCount : INT; (* Parts produced *)
iTarget : INT; (* Lot target *)
bLotDone : BOOL; (* Lot complete flag *)
END_VAR
IF iTarget > 0 AND iCount >= iTarget THEN
bLotDone := TRUE;
bMotorBelt := FALSE;
ELSIF bSensorIn AND NOT bLotDone THEN
bMotorBelt := TRUE;
END_IF;
IF bSensorOut THEN
iCount := iCount + 1;
END_IF;
Try it: set iTarget to 3, toggle bSensorIn ON, then toggle bSensorOut ON/OFF three times. Watch iCount increment and bLotDone activate.
OPC-UA Configuration
Create opcua.config.json in your workspace root to customise the server:
{
"port": 4840,
"nodeIdFormat": "siemens-s7",
"plcName": "PLC",
"dialect": "auto"
}
| Field |
Default |
Description |
port |
4840 |
OPC-UA server port |
nodeIdFormat |
generic |
siemens-s7, rockwell, beckhoff, or generic |
plcName |
PLC |
PLC name used in NodeIds |
dialect |
auto |
auto, siemens-scl, beckhoff-twincat, schneider-unity, or generic |
username |
— |
Optional: enable authentication |
password |
— |
Required if username is set |
Requirements
- VS Code 1.85 or later
- No additional runtime, PLC software or internet connection required
License
Copyright © 2026 AppsCat. All rights reserved. See EULA for details.