Skip to content

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.

  • 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)”
  1. In TIA Portal, right-click your block (FC or FB) in the project tree.

  2. Select Print → Print to PDF (or use the Print function and choose a PDF printer).

  3. Save the PDF to your S7 PLC Buddy workspace folder (~/Documents/S7 PLC Buddy by default).

  1. Open the AI Agent and start a new conversation (click + New Chat in the right sidebar).

  2. 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.”

  3. 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.
  4. Wait for parsing to complete. The agent calls parse_ladder_pdf first — 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.

  5. Review the output in the chat. The agent calls convert_all_to_scl and presents the full SCL block. The .scl file is saved automatically next to the intermediate file, so it is ready for TIA Portal import immediately.

Once you are satisfied with the SCL output:

  1. Ask the agent to import it:

    The SCL looks good. Import it into TIA Portal as FB_MotorControl in the "MotorControl" folder.
  2. The agent calls import_scl_file. TIA Portal compiles the block automatically.

  3. 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_file to save the corrected version — then retry.

  4. Once compiled successfully, the block appears in TIA Portal’s project tree.

  5. Save the TIA Portal project before downloading to a PLC.

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.

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.scl

The agent uses write_scl_file for this — it validates the .scl extension and creates any missing folders.

Read Reviewing SCL Output to learn what to check before the block goes into production.