Plecs Run Script
plecs_run_scriptExecutes a named simulation script in a PLECS model to trigger model-defined automation or simulation workflows via RPC.
Instructions
Run a model Simulation Script by name.
Verified on PLECS 5.0.6: the second argument is an optStruct, not a bare
string — plecs.runScript(model, {"ScriptName": name}). A successful run
returns null; the script's printed output goes to the PLECS console/Octave
log and is not captured by RPC. Use params only for a raw override.
script_name must exactly match a Script { Name "..." } block in the
.plecs file. The RPC model tree does not expose script names; use
plecs_overview(model).scripts or read the file. A wrong name lists the
available scripts in the error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | No | ||
| model_name | Yes | ||
| script_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||