plc_program_section
Fetches the exact source text of a named block (FB/FC/OB/DB or routine) from an exported PLC program file, returning up to 200 lines and a truncation flag for accurate section review.
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).
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="~/exports/Line3.scl", block="FB_Conveyor").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| block | Yes |