lars_runtime
Manage local LARS simulation instances for LASAL stations: set up/start/stop workspaces, redirect station targets to simulated ports, restore real targets, and run no-hardware tests.
Instructions
Manage local LARS (LASAL Runtime System) simulation instances. LARS runs one program per instance — use one workspace per station (PLC + HMI) so both run simultaneously on separate ports. Actions: list (auto-cleans stale workspaces), setup (create workspaces for all stations), start (auto-creates the workspace if the station is known but unconfigured), stop, remove, gc (lazy cleanup of unreferenced workspaces), set_station_target (point a station's .lss at its LARS instance), restore (revert .lss to the real target. After set_station_target, build_project/control_plc/plc_values/deploy_all operate on the LARS instance automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | LARS workspace name (e.g. 'VisuPalletizer_PLC'). Required for start/stop/remove/set_station_target/restore when station is omitted. | |
| action | Yes | 'list' shows all configured LARS workspaces and their state (auto-cleans stale ones, but never the selected project's). 'setup' creates/updates LARS workspaces for the selected project's stations (or one station/lcp), wiring both the CLASS 2 project and the LASAL SCREEN (.lpr) project so LARS renders the screen locally. 'start' launches a LARS instance (auto-creates the workspace first if the station is known but unconfigured); reports the effective online port it probed (LARS builds differ in which port they serve). 'stop' terminates it, 'remove' deletes its workspace config. 'gc' runs lazy garbage collection: deletes auto-created workspaces that are not running and no longer referenced by any station .lss or published DataService stations.json, while always keeping workspaces of the selected project. 'set_station_target' points a station's .lss at the online port its LARS instance actually services (probed; never a port another running instance owns); 'restore' reverts to the saved real target. 'target_pc' switches an ARM-compiled .lcp to the PC (x86) compile target LARS requires (restore via 'restore'). 'simulate' runs the full no-hardware loop in one call: ensure workspace (auto-creates), switch ARM targets to PC, compile, start the local LARS instance (probing its effective online port), then download to it. 'screenshot' captures the LARS window of a running workspace (returns the PNG) — use it to visually verify LASAL SCREEN projects running locally. | |
| dry_run | No | With action 'gc': report what would be removed without deleting anything. Default false. | |
| station | No | Station name from the selected project's solution (e.g. 'PLC', 'HMI', 'Local'). Resolution is scoped to the selected project; a station that only exists in another project's workspace is refused, and multiple matches report an ambiguity error and list the candidates. Pass name= to disambiguate. Mutually exclusive with name. | |
| lcp_path | No | Absolute path to a .lcp to create a workspace for (setup only, when no station name is usable). | |
| min_age_h | No | With action 'gc': only delete workspaces unreferenced for at least this many hours (overrides LASAL_MCP_LARS_GC_MIN_AGE_H; 0 = immediately. | |
| project_dir | No | Solution directory to auto-detect stations from and to scope station resolution (setup/list/start/stop/set_station_target/restore/target_pc/simulate. Defaults to the selected project. | |
| compile_mode | No | With action 'simulate': CLASS 2 compile mode. Default RebuildAll (safest). | RebuildAll |
| skip_compile | No | With action 'simulate': skip the CLASS 2 compile step (reuse the existing build). Default false. | |
| skip_download | No | With action 'simulate': skip the download step (only compile + start). Default false. |