get_pou
Retrieve a complete POU with interface, body, and network details from MotionWorks IEC projects. Returns original Structured Text source, compact ladder/FBD representations, and supports paging for long bodies.
Instructions
Get one POU: its interface, its body, and every network it contains.
This is the workhorse tool. Structured Text is returned as the original
source, tab alignment and inline comments intact. Ladder and FBD bodies are
returned as one compact text line per network plus a structured nets array
naming each block, its instance and each formal parameter's source — the
equivalent of NeutralText for Studio 5000, and far smaller than the raw XML.
Long bodies are paged: check body.truncated and pass offset to
continue.
Args:
path: Project file or directory.
pou_name: POU name exactly as reported by get_pous.
offset: Line offset into the body, for paging long POUs.
include_interface: Include the declared variables for each scope.
include_outputs: For graphical bodies, include each block's output pins.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| offset | No | ||
| pou_name | Yes | ||
| include_outputs | No | ||
| include_interface | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |