ironplcvm¶
Name¶
ironplcvm — IronPLC bytecode virtual machine
Synopsis¶
Description¶
ironplcvm is the IronPLC virtual machine runtime. It loads and
executes compiled bytecode container (.iplc) files that
ironplcc produces.
The runtime follows the IEC 61131-3 execution model. Each scheduling round, the runtime checks which tasks are due based on elapsed time and executes them in priority order.
By default, ironplcvm runs continuously until interrupted with
Ctrl+C. Use --scans to limit execution to a fixed number of
scheduling rounds.
Commands¶
- ironplcvm run [OPTIONS] FILE
Load and execute a bytecode container (
.iplc) file.--dump-varsFILEWrite all variable values to the specified file after execution stops. The output contains one variable per line in the format
NAME: VALUE, using the names recorded in the container’s debug section. A variable with no recorded name is reported asvar[N]. Variables are dumped on both normal shutdown and after a runtime error.Each value is written as the IEC 61131-3 literal for its declared type, the same rendering the debugger and the playground show:
msg: 'hello' wide: "hello" flag: TRUE n: 42 ratio: 1.5 mask: 16#ABCD span: T#1500ms day: D#2024-01-15 clock: TOD#14:30:00 stamp: DT#2024-01-15-14:30:00 shade: GREEN (1)
Durations are written in milliseconds (
T#1500ms, notT#1.5s) so the value is exact and reparses as the same literal. A value that cannot be read — a string whose container carries no layout for it, or one whose layout does not fit the program’s data — is written as<unavailable>or<invalid>rather than as a number that would read like a value.Structures, arrays and function block instances are named by their type rather than shown, because the runtime does not yet record enough layout information to read their contents back:
origin: <POINT> counts: <ARRAY OF DINT> timer: <TON>
--scansNRun exactly N scheduling rounds then stop. Without this option, the runtime runs continuously until interrupted with Ctrl+C.
- ironplcvm version
Print the version number of the virtual machine.
Options¶
-v,--verboseTurn on verbose logging. Repeat the flag to increase verbosity (e.g.,
-vvv).-lFILE,--log-fileFILEWrite log output to the specified file instead of the terminal.
Examples¶
Run a compiled program:
ironplcvm run main.iplc
Run for a single scan and dump variable values:
ironplcvm run main.iplc --scans 1 --dump-vars output.txt
Run with verbose logging:
ironplcvm -vv run main.iplc