render_pou_source
Generate POU source code in MotionWorks IEC's export format with properties header, declarations, and body.
Instructions
Emit a POU in the shape MotionWorks' Extended IEC 61131-2 export uses.
Produces the (*@PROPERTIES_EX@ ... *) header, the PROGRAM/FUNCTION_BLOCK
line, the declaration blocks and the (*@KEY@: WORKSHEET ... *) body region —
the same structure the IDE writes when exporting a POU as text.
Whether the IDE imports this shape is not verified: that format is
undocumented in the installed help, whose documented import path is PLCopen XML
(File → Import → "Import PLCopen xml file"). So either create a POU in
the IDE and paste the code, or wrap the result in PLCopen XML for the documented
route.
Args: name: POU name. pou_type: "program", "function_block" or "function". language: Body language — "ST", "LD" or "FBD". declaration: The VAR blocks, without the closing END_* keyword. code: The Structured Text body. description: Free text stored in the POU's DESCRIPTION region.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| name | Yes | ||
| language | No | ST | |
| pou_type | No | program | |
| declaration | No | ||
| description | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |