Plecs Codegen
plecs_codegenGenerates code from PLECS models using PLECS Coder and reports diagnostics; requires a PLECS Coder licence.
Instructions
Generate code with PLECS Coder (requires a PLECS Coder licence).
Verified on 5.0.6: plecs.codegen runs and streams Coder diagnostics back as an RPC
error ("Code generation error: ..."), which is surfaced verbatim. A model with blocks that
are ignored during code generation (e.g. Small Signal Response) fails instead of producing
partial artifacts.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "plecs_codegen"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| options | No | ||
| output_dir | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||