Migrating TIA Portal Programs to PLCnext via PLCopen XML

David Krause13 min read
HMI ProgrammingSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Migrating TIA Portal Programs to PLCnext via PLCopen XML

Industrial automation projects rarely live within a single vendor ecosystem for their entire lifecycle. Hardware refreshes, end-of-life controller replacement, corporate standardization programs, and the need for an open, Linux-capable control platform routinely force engineering teams to port validated PLC code from one platform to another. This article covers the practical workflow for moving IEC 61131-3 program logic out of Siemens TIA Portal — the engineering framework for the SIMATIC S7-1200 and S7-1500 controller families — and into Phoenix Contact PLCnext Control devices (AXC F 1152, AXC F 2152, AXC F 3152, and EPC 1522) configured with PC Worx Engineer / PLCnext Engineer. The same workflow also applies when MATLAB Simulink models are part of the source project.

Central fact: there is no automated, full-fidelity converter that takes a TIA Portal project as input and emits a complete PLCnext project. Hardware configuration, HMI screens, S7-specific function blocks, fail-safe blocks, technology objects, and PROFINET device descriptions do not transfer. What does transfer reliably is the language-neutral IEC 61131-3 source code, and the recommended exchange path for that is the PLCopen XML interchange format defined in IEC 61131-10.

Why a 1:1 Project Converter Does Not Exist

TIA Portal is a tightly integrated engineering suite that bundles five distinct work domains under a single binary project database (.ap14, .ap15, .ap16, .ap17, or .ap18 archive, depending on TIA version):

TIA Portal Work Domain Equivalent in PLCnext Engineer / PC Worx Transferable via PLCopen XML?
Hardware configuration (HWCN) Axioline / INTERBUS / PROFINET device catalog No
PLC program (S7-1200 / S7-1500 logic) PC Worx / PLCnext Engineer IEC 61131-3 project Partial (POUs and data types only)
HMI (Comfort Panels / Unified Panels) Visu+ / WebVisit / HTML5-based visualization No
Drive commissioning (Startdrive / SINAMICS) PLCnext Technology drives library No
Safety (F-CPU / F-blocks / Distributed Safety) PLCnext Safety toolchain No

Only the PLC program domain has a vendor-neutral exchange path. SCL sources, ladder logic diagrams, and FBD networks are not stored in an open schema inside TIA Portal's archive — they live in a proprietary binary database — so a direct import is structurally impossible. PLCopen XML is the workaround: TIA Portal exposes an export filter that emits the language elements of the active CPU in the standardized XML schema, and PC Worx / PLCnext Engineer exposes a complementary import that reads that XML back into POUs.

PLCopen XML Interchange Path

PLCopen XML is the standardized XML representation of IEC 61131-3 elements defined in IEC 61131-10. Its schema covers:

  • Program organization units (POUs): programs, function blocks, functions
  • Data types: elementary types, derived types, user-defined structs, arrays, enumerations
  • Global variable lists (GVLs) and tag tables
  • Tasks and their associated POUs plus interval and priority metadata
  • Comments, documentation strings, and namespace identifiers

TIA Portal's "Export to PLCopen XML" function (located under Project > Export > PLCopen XML) generates a single .xml file containing the language elements of the active S7-1200 / S7-1500 CPU. PC Worx Engineer and PLCnext Engineer support the inverse Import > PLCopen XML operation. Export and import are one-way and one-shot — there is no live synchronization between the two tools.

Limitations of PLCopen XML Round-Trip

Not every IEC 61131-3 element survives a TIA → PC Worx round-trip cleanly. The mapping table below summarizes the practical outcomes observed in real migrations:

TIA Portal Element PLCopen XML Export PLCnext Import Notes
SCL source files (.scl) Yes Yes Re-imported as POU text bodies
LAD networks Partial Partial Imported as IL-style references; re-drawing recommended
FBD networks Yes Yes Block diagram preserved
Standard bit-logic timers (TP, TON, TOF) Yes Yes IEC 61131-3 standard blocks
SFB / SFC system function blocks No No Vendor-specific extensions blocked
S7-1500 extended timers (TP_LON, etc.) Partial No Replace with standard IEC timer instances
DB instances / multi-instance FB Yes Yes Variable section transfers
Optimized / non-optimized access Loses attribute Re-mapped AT % accessors not preserved
Pointer / ANY / VARIANT Partial No VARIANT round-trips; POKE / BLK_MOV do not
Watch / force tables No No Re-create manually
Trace recordings No No Re-create manually
Technology objects (TO_PositioningAxis, TO_PID_Compact) No No Re-commission on PLCnext side

Prerequisites

Before starting a migration, gather the following:

  1. TIA Portal source project — preferably the latest revision, saved with the TIA Portal version that will perform the export. If a version upgrade is required (for example, TIA V14 → V15 → V16), follow the Siemens upgrade recipe: make a working copy of the project, delete the global library in Copy #1 and attempt the upgrade, and keep the global library in Copy #2 — if vendor-specific blocks block the upgrade, replace them with IEC 61131-3 standard equivalents before retrying.
  2. PC Worx Engineer / PLCnext Engineer — current release on the engineering workstation. A 2023.x or later LTS build is recommended for the most complete IEC 61131-3 round-trip support.
  3. PLCnext Control firmware — current LTS image for the target AXC F 1152 / 2152 / 3152 or EPC 1522 controller. Pull the firmware image from the Phoenix Contact support portal and write it to the controller before commissioning.
  4. MATLAB Simulink + Simulink Coder + PLCnext Target add-on — required only if Simulink models are part of the source project. The PLCnext Target for Simulink is a separately licensed Phoenix Contact product and is installed into MATLAB as an add-on.
  5. Type mapping spreadsheet — list of every TIA-side DB tag, IEC timer instance, and SFC step. This document becomes your acceptance checklist.
  6. Offline / sandbox controller — never perform a first-time migration directly on a production controller. The migration must be validated on a bench unit before cutover.

Step-by-Step Migration Procedure

Step 1 — Clean Up the TIA Portal Project

Before exporting, the source project must compile without errors and must not reference any vendor blocks outside the IEC 61131-3 standard namespace.

  1. Resolve all compile errors in the active CPU.
  2. Identify every SFB / SFC call by searching the project tree for the SFB and SFC prefixes.
  3. Replace Siemens-specific blocks with IEC 61131-3 equivalents where possible:
    • SFB0 / SFB1 (CTU / CTD) → IEC standard CTU / CTD
    • SFB3 / SFB4 / SFB5 (TP / TON / TOF) → IEC standard TP / TON / TOF
    • SFB41 / SFB42 / SFB43 (CONT_C, CONT_S, PULSEGEN) → PLCnext PID function block from the PLCnext Technology library
  4. Search the project for any case-insensitive match on "SFB", "SFC", or vendor library namespace prefixes and resolve each occurrence.
Note on the CONVERT instruction: TIA Portal's CONV instruction (drag-and-drop from the Basic instructions > Conversion operations palette) is sometimes misidentified during migration because its output type is implicit. Open every CONV block in the source project, set the explicit output type via the instruction box properties, and re-compile before export. Reference: Siemens Support entry 48711306 and the CONV instruction manual page.

Step 2 — Export PLCopen XML from TIA Portal

  1. Open the cleaned project in TIA Portal.
  2. Right-click the S7-1200 / S7-1500 CPU in the project tree.
  3. Choose Export > PLCopen XML....
  4. Select the language elements to include: POUs, data types, GVLs, tasks.
  5. Save the resulting .xml file to a working directory.
  6. Validate the XML against the IEC 61131-10 schema using any XML validator — TIA Portal does not always flag schema violations before export.

Step 3 — Prepare the PLCnext Project Skeleton

In PC Worx Engineer / PLCnext Engineer:

  1. Create a new project targeted at the PLCnext Control hardware (for example, AXC F 2152 running the current LTS firmware).
  2. Define the PROFINET device catalog entries for any I/O stations that will replace the TIA-side ET 200SP / ET 200MP stations. PROFINET device GSDML files are portable, but the device configuration itself must be rebuilt.
  3. Create empty POUs, data types, and GVLs that match the names exported in the PLCopen XML.

Step 4 — Import PLCopen XML into PC Worx

  1. In PC Worx Engineer, right-click the project node.
  2. Choose Import > PLCopen XML.
  3. Select the exported .xml.
  4. Review the import log for warnings — most commonly:
    • "Unknown data type X, mapped to DINT"
    • "Comment truncated to 255 characters"
    • "Instance variable renamed from X to X_1 (duplicate name)"
  5. Manually re-bind any AT-overlapping variables that lost their % address attributes.
  6. Compile the project.

Step 5 — Port HMI, Drives, and Safety Separately

PLCnext Engineer does not consume WinCC Comfort or WinCC Unified projects. Plan separate engineering tasks for:

  • HMI — rebuild in Visu+ or migrate to a web-based HTML5 visualization served by the PLCnext web server.
  • Drives — re-commission using the PLCnext Technology drives library (Axioline F I/O drives) or via the device's native tool connected through the controller's OPC UA server.
  • Safety — Safety PLC projects (S7-1500F + Safety Advanced / Distributed Safety) cannot be exported as PLCopen XML. They require a complete re-engineering in PLCnext Safety using SafetyDesigner-equivalent tools.

Step 6 — Integrate MATLAB Simulink Models

If the source TIA project contains MATLAB Simulink models compiled to TIA blocks (Simulink PLC Coder + the S7-1500 / S7-1200 target), the equivalent workflow on PLCnext is:

  1. Open the source .slx model in MATLAB Simulink.
  2. Identify the GDS (Global Data Set) in / out ports that act as the model's data interface.
  3. Install the PLCnext Target for Simulink add-on.
  4. Re-target the model to PLCnext, keeping GDS ports intact.
  5. Configure the build settings in MATLAB:
set_param(gcs, 'TargetHardware', 'PLCnext');
set_param(gcs, 'PLCnextLibraryName', 'MyModelLibrary');
set_param(gcs, 'GeneratePCWlxFile', 'on');
  1. Build the model — Simulink Coder emits a .pcwlx file (PC Worx Engineer library) containing the shared object and metadata.
  2. In PC Worx Engineer, choose Libraries > Add Library and import the .pcwlx file.
  3. Instantiate the library function block in your project and wire GDS inputs/outputs to your program's variables.

The .pcwlx file behaves like a normal program block: you call it from a task and the shared object runs in the PLCnext real-time context.

Step 7 — Wire, Compile, and Validate

  1. Map every PLCnext variable to a physical or PROFINET I/O address — the export stripped the addresses.
  2. Compile the project and resolve any "implicit conversion" warnings by inserting explicit CONVERT or type-cast blocks.
  3. Generate the PLCnext Engineer build artifact (PC Worx archive .pcwx / .pcwex).
  4. Download to the offline controller.
  5. Run the IEC checklist against your type-mapping spreadsheet:
Migration Item Source Verified Target Verified Notes
All POUs imported
All GVL tags present
IEC timers use standard blocks
No SFB / SFC references remain
I/O addresses bound
Tasks configured
Simulink .pcwlx integrated

Migration Workflow Diagram

TIA Portal Project Cleanup & Refactor PLCopen XML Export XML Validation PC Worx Skeleton PLCopen XML Import Compile & Resolve Simulink .pcwlx Integration Bind I/O & Commission Validation & Sign-off

Verification and Acceptance

A migration is not accepted until runtime behavior matches the source within documented tolerance. The following verification sequence is the minimum:

  1. Static comparison — diff the POUs line-by-line. IEC 61131-3 textual languages (SCL, IL, ST) should be character-identical after import.
  2. I/O loopback test — wire a known input pattern to the controller, capture the outputs, and compare against the same pattern run on the TIA simulator (S7-PLCSIM).
  3. Functional test against the source FAT/SAT documentation — replay every test case in the original validation plan on the new PLCnext controller.
  4. Long-duration soak test — at least 24 hours of uninterrupted run with a representative load profile, monitoring watchdog trips and task jitter in the PC Worx diagnostic view.
  5. OPC UA namespace check — export the OPC UA address space from both controllers and confirm that every variable exposed to SCADA has the same name, datatype, and access level.

Common Import Converter vs PLCopen XML

It is worth distinguishing PLCopen XML (IEC 61131-10 source-code exchange) from the Common Import Converter, which is a Siemens tool for converting TIA Portal datapoint configurations into the Siemens Common Configurator (used in building-automation and Desigo CC integrations). They are unrelated. See the Siemens Common Import Converter product page for the building-automation use case.

Troubleshooting Matrix

Symptom Likely Cause Resolution
PLCopen XML export fails with "Schema not valid" TIA project contains unsupported syntax (case statements, derived DT with methods) Locate the offending POU from the export log; refactor to IEC 61131-3 v3 base language
Import completes but POUs are empty Source was LAD/FBD and the export option "Graphical export" was disabled Re-export with graphical export enabled, or re-enter the network as FBD manually
Timers count down but never latch Imported S7 timer instance was rewritten as IEC standard timer but the instance DB was not re-instantiated Delete the auto-generated instance, drag a fresh IEC timer onto the network, rewire
Simulink model produces no output GDS ports were not declared in the new PLCnext target In Simulink, open Model Configuration Parameters > PLCnext Target > Data Interface, ensure GDS in/out ports are checked
.pcwlx import fails with "missing shared object" Simulink was built without the PLCnext coder target selected Rebuild with the PLCnext Target; verify the build log contains Writing shared object: libMyModel.so
Compilation warning "implicit conversion REAL to DINT" S7 conversion blocks lost their explicit output type during XML export Insert explicit CONVERT blocks; see the CONV instruction reference for parameter mapping
Variables lost their I/O address PLCopen XML does not carry % address information Re-bind variables in the PLCnext device editor using the hardware catalog
Watch table values differ between platforms Different task cycle times (TIA default 100 ms vs PLCnext default 1 ms) Align task periods; account for the timing change in process tuning
Project fails to compile with "duplicate symbol" warnings GVL imported with the same name as a built-in IEC symbol Rename the GVL or use namespace qualification in referencing POUs
Cross-compiler complains about POINTER parameters TIA POINTER semantics differ from PC Worx POINTER semantics Refactor call sites to use VARIANT or explicit in/out parameters

Cross-Vendor Considerations

If the source project is not TIA Portal but rather another IEC 61131-3 platform — Allen-Bradley Studio 5000 / RSLogix 5000, Schneider EcoStruxure Control Expert, Codesys 3.5, Beckhoff TwinCAT 3 — the PLCopen XML path still applies with the same caveats. TIA Portal itself does not consume PLCopen XML for import (only export), so a Codesys → PLCnext migration goes via the source tool's PLCopen XML export, not via TIA.

For Allen-Bradley → S7 (TIA) → PLCnext chains, expect two separate conversion efforts rather than one combined workflow. There is no Siemens-published "Allen-Bradley to S7" converter that survives more than tag-name mapping.

Summary of Hard Migration Limits

The following items cannot cross from TIA Portal to PLCnext under any currently documented workflow:

  • WinCC Comfort / WinCC Unified HMI screens and tag connections
  • SINAMICS drive parameter sets (Startdrive commissioning)
  • Safety logic (S7-1500F / F-CPU / Distributed Safety)
  • S7-specific technology objects (TO_PositioningAxis, TO_SynchronousAxis, TO_OutputCam, TO_MeasuringInput, TO_ControllerPID)
  • GRAPH sequencers
  • ProDiag fault definitions
  • TIA Portal Openness API customization scripts
  • Reusable global library elements that wrap SFBs / SFCs

Each of these requires a dedicated re-engineering effort and a new validation test plan.

FAQ

Can a complete TIA Portal project be converted to PLCnext automatically?

No. Only the IEC 61131-3 program elements (POUs, data types, GVLs, tasks) round-trip via PLCopen XML. Hardware configuration, HMI screens, drives, safety logic, and technology objects must be re-engineered manually on the PLCnext side.

Which PLCnext controllers support PLCopen XML import?

The PLCnext Control family — AXC F 1152, AXC F 2152, AXC F 3152, and EPC 1522 — running current LTS firmware and configured with PC Worx Engineer or PLCnext Engineer (2023.x or later recommended) supports PLCopen XML import.

What is a .pcwlx file and how is it used?

A .pcwlx file is a PC Worx Engineer library produced by MATLAB Simulink Coder with the PLCnext Target add-on. It contains a Linux shared object plus metadata describing the GDS input/output interface. It is added to a PC Worx project via Libraries > Add Library and instantiated as a normal program block in a task.

Do S7-1500 SFB and SFC blocks survive export to PLCopen XML?

No. SFB and SFC blocks are Siemens-specific extensions outside the IEC 61131-3 standard namespace and are stripped from the PLCopen XML export. Replace them with IEC 61131-3 standard equivalents (CTU, CTD, TP, TON, TOF, R_TRIG, F_TRIG, etc.) before exporting.

Why does TIA Portal sometimes refuse to export optimized DBs cleanly?

Optimized data blocks use symbolic-only access, and their internal memory layout is not represented in PLCopen XML. The exporter will fall back to a non-optimized representation for the round-trip, which strips the optimization attribute. Re-enable optimization in the PLCnext project after import if your application depends on it.

Can I migrate WinCC Unified panels to a PLCnext visualization?

Not directly. WinCC Unified projects are stored in a TIA-specific binary format and have no PLCopen XML export path. The recommended approach is to rebuild the visualization in Visu+ (Phoenix Contact) or as an HTML5 web visualization served by the PLCnext web server.

Back to blog