TwinCode & vPLC
TwinCode pairs a browser-hosted IEC 61131-3 engineering environment with a deterministic ahead-of-time virtual PLC runtime. Engineers author, debug, transpile, qualify vendor firmware patches, and promote live controller updates against a full-physics digital twin without Windows engineering virtual machines or controller download halts.
IEC 61131-3 across 18 vendor dialects
TwinCode supports all five IEC 61131-3 languages—Structured Text (ST), Ladder Diagram (LD), Function Block Diagram (FBD), Sequential Function Chart (SFC), and Instruction List (IL)—parameterised by self-contained per-PLC Device Packs. Each pack carries the vendor dialect grammar, rack and backplane I/O layout, instruction timing quirks, and hardware reference vectors.
FUNCTION_BLOCK FB_ChillerValveLoop
VAR_INPUT
SupplyTemp_C : REAL;
Setpoint_C : REAL;
EnableTrim : BOOL;
END_VAR
VAR_OUTPUT
ValveCmd_Pct : REAL;
TempFault : BOOL;
END_VAR
VAR
Err_C : REAL;
END_VAR
TempFault := (SupplyTemp_C < 2.0) OR (SupplyTemp_C > 35.0);
IF NOT EnableTrim OR TempFault THEN
ValveCmd_Pct := 100.0;
ELSE
Err_C := SupplyTemp_C - Setpoint_C;
ValveCmd_Pct := LIMIT(15.0, 50.0 + (Err_C * 12.5), 100.0);
END_IF;
END_FUNCTION_BLOCK# Validate and compile ST/LD/FBD/SFC/IL via the vPLC workbench
twinctl control codegen --file ./logic/chiller_valve_loop.st --json
# Inspect live vPLC executive status and cyclic scan metrics
twinctl control status --json| PLC dialect | Vendor toolchain | Native export / archive |
|---|---|---|
| ABB AC500 | ABB Automation Builder | PLCopen XML / AC500 project |
| AutomationDirect | Productivity Suite | Productivity XML / ladder export |
| Beckhoff TwinCAT | TwinCAT 2 / 3 XML | .TcPOU / .tsproj |
| B&R Automation | Automation Studio | B&R structured project export |
| CODESYS / PLCopen | CODESYS / PLCopen TC6 | PLCopen TC6 XML |
| GE PACSystems | Proficy Machine Edition | PACSystems XML / logic archive |
| Honeywell ControlEdge | ControlEdge Builder | ControlEdge IEC 61131-3 XML |
| Mitsubishi MELSEC | GX Works2 / Works3 | MELSEC GX project / XML |
| Omron Sysmac | Sysmac Studio | Sysmac NJ/NX XML |
| Opto 22 groov | PAC Control / EPIC | groov EPIC strategy export |
| Phoenix PLCnext | PLCnext Engineer | PLCnext Engineer XML |
| Rockwell L5X | Studio 5000 Logix Designer | .L5X / .L5K |
| Schneider XEF | EcoStruxure Control Expert | .XEF / .ZEF |
| Siemens S5 | STEP 5 Legacy | .S5D program import |
| Siemens SIMATIC ML | TIA Portal Openness | SimaticML .scl / .xml / .zap |
| TI505 / CTI | Control Technology Inc. | 505 Workshop archive |
| WAGO PFC | e!COCKPIT / CODESYS | PFC200 PLCopen XML |
| Yokogawa FA-M3 | WideField3 | FA-M3 project export |
Live LSP diagnostics and verified inline diffs
Every open POU, symbol table, and I/O mapping runs through a lossless syntax and semantic analyser over the Language Server Protocol (LSP). Diagnostics flag undeclared tags, address collisions, type mismatches, and safety-partition violations before compilation.
Workspace-aware co-pilot proposals appear as inline diffs rather than opaque chat snippets. Before any proposal can be accepted into the project tree, TwinCode compiles the candidate change, runs a headless TwinCore plant sweep, and verifies behavioural equivalence against baseline safety assertions.
Lockstep debugging, time travel, and scan oscilloscope
Multiple debug sessions attach concurrently across heterogeneous targets on the same TwinCore host—combining soft PLCs, protection relays, UPS and STS controllers, liquid-cooling CDUs, BMS controllers, and network switches.
- Non-blocking isolation and barrier groups: Isolate a single paused controller behind a non-blocking state snapshot, or bind multiple controllers into a lockstep barrier group so every target advances scan-for-scan together.
- Breakpoints and watchpoints: Set line breakpoints, conditional expressions, and register watchpoints over live process images and forced I/O tables.
- Synchronised time-travel rewind: Step backward through deterministic execution checkpoints to inspect the exact scan and causal message that triggered an interlock trip.
- Scan oscilloscope: Arm cycle-accurate triggers to capture high-rate digital and analogue waveforms across electrical, thermal, and control points in one time-aligned view.
Universal N×N transpilation with equivalence proofs
TwinCode compiles any licensed source dialect into a canonical IEC 61131-3 intermediate representation and lowers it to any licensed target dialect. Rather than relying on brittle regex translation, every cross-vendor conversion undergoes formal equivalence checking:
- V1 structural parity: Verifies POU hierarchy, task priorities, scan intervals, and variable retention classes.
- V2 static semantic checks: Validates type widths, timer/counter edge semantics, and array bounds across dialects.
- V3 differential scan sweeps: Executes identical test vectors on both source and target runtimes inside TwinCore and compares output trajectories bit-for-bit.
- V4 explicit review markers: Isolates hardware-specific opaque instructions with mandatory engineer review annotations so non-portable blocks never pass silently.
Vendor patch import, shadow qualification, and native export
Facilities with installed vendor PLCs import native project archives and firmware patch packages directly into TwinCode, rehearse them in simulation, and export vendor-compliant binaries back to physical controllers:
- Binary and project lift: Import vendor packages (
.ACD, SimaticML.zap,.tsproj,.XEF, orSII) into portable logic representation alongside preserved opaque blocks. - Digital-twin rehearsal: Debug and stress-test the patched logic against the 100%-compliant twinned PLC and coupled plant physics under fault injection.
- Shadow qualification: Run the candidate logic in read-only shadow mode alongside the live plant to confirm residual error stays within pack tolerances.
- PE sign-off and native deployment: Record four-eyes engineer approval, export compliant native artefacts (
.L5X, SimaticML,.TcPOU,.XEF, PLCopen XML, or IEC 61850.scd/.cid), and deploy with atomic rollback capability.
Bumpless Slot A/B single-scan vPLC deployment
Conventional soft-PLCs require a stop-on-download halt when function blocks or I/O tables change. The TwinControl vPLC eliminates download outages by maintaining dual runtime slots:
- Ahead-of-time machine code: Logic compiles to native machine instructions with zero garbage-collection pauses and deterministic worst-case execution time.
- Protected safety partitions: Safety-pinned routines carry immutable CRC seals; non-safety control logic updates independently without voiding certified safety signatures.
- Single-scan Slot A/B handover: The standby slot initialises inside pre-allocated memory reserve, synchronises retained state across one scan barrier, and assumes active control without dropping plant telemetry or output holds.