get_routine
Retrieve PLC routine logic from an L5X file by program and routine name, returning ladder rungs as compact NeutralText with comments or raw Structured Text.
Instructions
Get routine logic — NeutralText for ladder, raw code for Structured Text.
Ladder rungs are returned as compact NeutralText with rung comments, not raw XML. A single rung like 'XIC Motor_Start XIO Motor_Fault OTE Motor_Run' replaces hundreds of lines of verbose XML.
Args: l5x_path: Path to a .l5x file. program: Program name containing the routine. routine_name: Routine name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| program | Yes | ||
| l5x_path | Yes | ||
| routine_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |