Step-by-Step Workflow
This guide walks through a complete Ladder → SCL migration. The process takes 5–20 minutes depending on the size of the program.
Before you start
Section titled “Before you start”- Connect to TIA Portal (optional but recommended — lets the agent import the result directly).
- Connect the Ladder Migration MCP server via Settings → Connections → Ladder Migration MCP.
- Export your Ladder program from your vendor as a PDF.
Export Ladder from your vendor (e.g. TIA Portal)
Section titled “Export Ladder from your vendor (e.g. TIA Portal)”-
In TIA Portal, right-click your block (FC or FB) in the project tree.
-
Select Print → Print to PDF (or use the Print function and choose a PDF printer).
-
Save the PDF to your S7 PLC Buddy workspace folder (
~/Documents/S7 PLC Buddyby default).
Run the migration
Section titled “Run the migration”-
Open the AI Agent and start a new conversation (click + New Chat in the right sidebar).
-
Let the agent know you already added a Ladder Diagram file in his workspace, by mentioning it by name:
“Read the file MotorControl_LAD.pdf from your workspace and migrate all networks to SCL as a Function Block called FB_MotorControl.”
-
Specify what you want:
- Block type (FC or FB)
- Block name and number
- Any naming conventions to use for variables
- Whether you want inline comments (recommended)
Example prompt:
Read MotorControl_LAD.pdf.Migrate all 12 networks to SCL as FB_MotorControl (FB 100).Use snake_case for local variable names.Add a comment above each network describing what it does.Flag anything that might need manual review. -
Wait for parsing to complete. The agent calls
parse_ladder_pdffirst — this renders every page as an image and sends them to Claude Vision. For large programs (50+ networks) this can take up to 8 minutes. The intermediate result is saved next to the PDF automatically. -
Review the output in the chat. The agent calls
convert_all_to_scland presents the full SCL block. The.sclfile is saved automatically next to the intermediate file, so it is ready for TIA Portal import immediately.
Import into TIA Portal
Section titled “Import into TIA Portal”Once you are satisfied with the SCL output:
-
Ask the agent to import it:
The SCL looks good. Import it into TIA Portal as FB_MotorControl in the "MotorControl" folder. -
The agent calls
import_scl_file. TIA Portal compiles the block automatically. -
If the compiler finds errors, the agent reports them with line numbers and explains how to fix them. Ask it to correct the issues — it will call
write_scl_fileto save the corrected version — then retry. -
Once compiled successfully, the block appears in TIA Portal’s project tree.
-
Save the TIA Portal project before downloading to a PLC.
Iterating on the output
Section titled “Iterating on the output”If the migrated SCL isn’t quite right, keep the conversation going:
Network 7 is wrong — the timer reset condition should only trigger when the E-stop is released, not every cycle.Can you fix that?Redo networks 3 and 4 — they share a common interlock that should be factored into a local BOOL variable.The output coil for Conveyor_Start in network 9 is missing. Add it back.The agent can make targeted corrections without regenerating the whole block.
The generated files
Section titled “The generated files”convert_all_to_scl automatically saves two files next to the source PDF:
| File | Description |
|---|---|
MotorControl_LAD_intermediate.md |
Parsed network-by-network breakdown — can be inspected or edited with get_intermediate |
MotorControl_LAD.scl |
The generated SCL block — ready for import_scl_file or manual copy into TIA Portal |
If you want to save corrected SCL to a different path, ask the agent:
Save the corrected SCL to C:\exports\MotorControl_v2.sclThe agent uses write_scl_file for this — it validates the .scl extension and creates any missing folders.
Next step
Section titled “Next step”Read Reviewing SCL Output to learn what to check before the block goes into production.