plc_program_section
Retrieve the exact source code of one named PLC block or routine from an exported program file, capped at 200 lines with a truncation flag, so you can explain only that section.
Instructions
[READ][risk=low] Source text of ONE named block from an exported program.
Returns the exact source of a single block (FB/FC/OB/DB name for SCL/AWL;
Program.Routine or routine name for L5X — rungs are rendered as
'[rung N] ...'), capped at 200 lines with an explicit truncated flag, so
the agent reads exactly the section it is explaining instead of guessing.
Unknown block names fail with the list of available blocks.
Args:
path: Exported program file (.st/.scl/.awl/.l5x/.txt; must exist, ≤5 MB),
under $IAIOPS_HOME, the config dir or an IAIOPS_AGENT_READ_DIRS dir.
block: Block/routine name (case-insensitive; quotes optional).
Returns dict: {source_file, format, block, kind, start_line, end_line,
lines_returned, truncated, source, parse_errors}.
Example: plc_program_section(path="~/.iaiops/plc/Line3.scl", block="FB_Conveyor").
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>",
"block": "<block>"
},
"name": "plc_program_section"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| block | Yes |