validate_pou
Validate generated Structured Text against the project's real symbols to catch undefined tags, types, function blocks, and invalid formal parameters before handing the code to users.
Instructions
Validate agent-written IEC code against the project's real symbols.
Call this on generated code before handing it to a user. It catches the mistakes an LLM actually makes: tags that do not exist in the project, types that are not defined, function blocks that are not in the library, and formal parameter names that the target block does not have.
Args: path: Project file or directory. code: The Structured Text body to check (no declaration blocks). declared_vars: Any VAR blocks the code relies on, so locally declared symbols are not reported as undeclared. pou_name: Optional name, used only for labelling the result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| path | Yes | ||
| pou_name | No | ||
| declared_vars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |