Resolving TIA Portal V13 CodeBlockData Library Conversion Error

David Krause26 min read
SiemensTIA PortalTroubleshooting
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

Problem Overview

When a TIA Portal V12 global library that contains SINAMICS PROFIdrive telegram type definitions is opened in TIA Portal V13 or later, the library upgrade process fails and the following message is written to the conversion log:

Error occurred while converting the type 'CodeBlockData' (model type 'Siemens.Simatic.PlcLanguages.Model.CodeBlockData')

The library file appears in the project tree but every dependent block, UDT, FB, and DB is marked as inconsistent. In many cases the library cannot be opened at all; in others it opens read-only and the UDT cannot be instantiated in the user program. The error is most commonly reported by engineers controlling a SINAMICS S120 drive line (for example, a CU305 PN control unit) from an S7-1200 CPU such as the 6ES7214-1AG40-0XB0, using a SINAMICS Telegram V1.2 type imported from the Siemens Industry Online Support portal.

The failure is not a fault of the S7-1200 firmware, the CU305 PN firmware, or the GSDML file; it is a library-model incompatibility inside the TIA Portal engineering framework. The trigger is the internal representation of code-block data within the V12-compiled library, which the V13 converter cannot map to the V13 schema when the UDT was produced by the SINAMICS Telegram Configuration tool. The SINAMICS S120 firmware, the PROFIdrive profile, and the cyclic frame layout are all unaffected.

Engineering impact: The error blocks all drive commissioning and prevents download of the project. The CPU 1214C cannot establish the cyclic PROFIdrive telegram exchange with the CU305 PN until the library is rebuilt in a TIA Portal version that the project is targeting. Cyclic and acyclic PROFINET IO services to the drive will return IO device failure in the S7-1200 diagnostic buffer.

Affected Software, Builds, and Hardware

The error is governed by the TIA Portal engineering version, not by the runtime firmware of the controller or the drive. The following table lists the components that participate in the failure path.

Component Catalog / Order Number Role in the Failure
TIA Portal V12 SP1, Update 4 / Update 5 6AV2101-0AA02-0AA5 (V12.0.1.x) Source library build version that produces the bad model
TIA Portal V13 (no SP) 6AV2101-0AA03-0AA5 (V13.0.0.x) First target that rejects the V12 model
TIA Portal V13 SP1 6AV2101-0AA03-0AA7 (V13.1.0.x) Still rejects the V12 model on open
TIA Portal V13 SP2 6AV2101-0AA03-0AA8 (V13.2.0.x) Same restriction; SP2 only helps with newly built libraries
STEP 7 V14 / V15 / V15.1 / V16 6AV2101-0AA04-0AA5+ Rejects the V12 model; same refactor carried forward
CPU 1214C DC/DC/DC 6ES7214-1AG40-0XB0, FW 4.0 - 4.4 Controller that uses the SINAMICS library
CU305 PN 6SL3040-1JA01-0AA0, FW 4.6 - 4.8 SINAMICS S120 control unit, PROFINET
Line Module / Motor Module SLM 6SL313x, BLM 6SL313x, ALM 6SL313x; Motor Module 6SL312x Driven by CU305 PN telegram exchange
SINAMICS Telegram V1.2 type library Siemens download (search "SINAMICS Telegram V1.2") UDT source that triggered the error
GSDML file GSDML-V2.31-Siemens-Sinamics-S120-*.xml Required by the device configuration; not the source of the error

The same error is reported on CPU 1212C, CPU 1215C, CPU 1217C, CPU 1214F, and CPU 1215F when those CPUs are configured with the same V12 SINAMICS library. The S7-1500 family (CPU 1511, 1515, 1516, 1518) is also affected because the same V12 library is reused.

Root Cause Analysis

The TIA Portal library format is a binary container that embeds an internal model graph describing every block, UDT, FB, and their inter-references. The model is governed by the Siemens.Simatic.PlcLanguages.Model namespace. Between V12 and V13, several model classes were refactored to support multi-language comments, F-version tracking, knows-how protection extensions, and the OPC UA export features that were introduced in V13.

The class CodeBlockData is the abstract base for any block that contains executable code or a non-trivial UDT body. In V12, CodeBlockData stored a property bag for interface sections (Input, Output, InOut, Static, Temp) using a flat, attribute-keyed list. In V13, the property bag was replaced by a strongly typed InterfaceSection collection with explicit slot identifiers and per-section metadata. The V13 converter walks the V12 property bag and attempts to populate the new collection; when it encounters a UDT that was generated by the SINAMICS Telegram Configuration tool, the property bag contains an interface-slot entry that has no V13 equivalent (an "interface-less" stub used by the type generator to mark user-definable PZD words). The converter throws the CodeBlockData exception and aborts the library upgrade.

The same exception is reported regardless of which block in the library actually carries the bad property bag. The library is treated as a unit during upgrade, so a single bad UDT will poison the whole file. The error is deterministic and reproducible: restoring the library from a backup, recompiling, or re-downloading the V12 build will reproduce the error on the same V13 build.

Anti-virus products that perform binary inspection on TIA Portal files can mask the failure with a different error string. If the library cannot be opened at all and Windows reports "file access denied" or "file in use by another process" immediately after TIA Portal closes, the file is likely quarantined. Add the engineering share and the TIA Portal installation directory to the anti-virus exclusion list before re-running the upgrade.

TIA Portal Library Architecture Notes

Understanding the library model helps in diagnosing future conversion issues. The TIA Portal global library is a file with a version-specific extension:

TIA Portal Version Extension Container Format
V12 SP1 / V12 .al12 Binary model graph, V12 schema
V13 / V13 SP1 / V13 SP2 .al13 Binary model graph, V13 schema
V14 .al14 Binary model graph, V14 schema
V15 / V15.1 .al15 Binary model graph, V15 schema
V16 .al16 Binary model graph, V16 schema

The library file contains a manifest, a model graph, and a set of compressed source representations. The manifest is versioned; opening a library in a TIA Portal version older than the manifest's minimum required version produces a hard error. Opening it in a newer version triggers the upgrade converter. The converter runs once per library; the result is cached in the user profile at %LOCALAPPDATA%\Siemens\Automation\LibraryCache\. Deleting the cache forces a re-conversion and is a valid diagnostic step when the upgrade produces different errors on different workstations.

UDT generation in TIA Portal goes through three paths:

  1. Manual definition in the data-type editor (textual or table view).
  2. Generation from a PLC data type (PDT) in the project.
  3. Generation from a vendor tool such as the SINAMICS Telegram Configuration.

Path 3 is the one that produces the bad CodeBlockData property bag in V12. The vendor tool writes a stub interface section that the V12 schema permits but the V13 schema does not. The stub is invisible in the TIA Portal UI; it surfaces only when the converter walks the property bag.

Pre-Conversion Verification

Before applying any of the resolutions below, capture the engineering environment so the failure can be reproduced offline if a Siemens support request is opened.

  1. Open the TIA Portal V13 project that triggered the error.
  2. Select Project > Properties > TIA Portal version and record the exact build number (e.g., V13.2.0.2). The build number is required when Siemens support asks for the converter revision.
  3. Open the offending library: Global libraries > Open global library. Note the file path and the library version field at the bottom of the dialog.
  4. Export the library as a backup: right-click the library > Save as... and store the .al12 file in a controlled directory. Do not overwrite the original.
  5. Open the conversion log: Help > Show installed software > Open log. The full path is typically C:\ProgramData\Siemens\Automation\Logfiles\. Locate the LibraryUpgrade_*.log entry that contains the CodeBlockData line and attach it to any escalation.
  6. Confirm that the CPU 1214C and the CU305 PN are in the device catalog with the same article numbers you intend to use in the rebuilt library (the catalog view path is Devices & networks > Catalog > SIMATIC S7-1200 > CPU > CPU 1214C DC/DC/DC and Drive systems > SINAMICS S120 > Control Units > CU305 PN).
  7. Take a screenshot of the SINAMICS Telegram Configuration dialog: Device view > CU305 PN > Properties > PROFINET interface > Telegram configuration. The screenshot is required to recreate the UDT word-for-word in step 4 of the rebuild procedure.
  8. Capture the hardware identifiers of the PROFINET slots: Device view > CU305 PN > Properties > System constants. Record HW_ID_PN_Interface, HW_ID_PZD_IN, and HW_ID_PZD_OUT. These constants change when the Telegram Configuration is modified, so they must be re-read after the rebuild.

Resolution Method 1 — Library Rebuild in the Target TIA Portal Version

The deterministic fix is to rebuild the library in the same TIA Portal version that the project uses. This avoids the cross-version converter entirely.

  1. Create a new global library in TIA Portal V13: Libraries > New library. Name it, for example, Sinamics_Telegram_V13. Store it on a project-share path so other engineers can pull it.
  2. Add a new UDT: right-click the new library > Add new type > Data type (UDT). Name it UDT_Sinamics_Telegram_V12 (keep the original name to minimize program changes).
  3. Open the SINAMICS Telegram Configuration in a fresh V13 project that contains a CU305 PN: Device view > CU305 PN > Properties > PROFINET interface > Telegram configuration > Add telegram. Select telegram 102, 105, 106, or 110 as required (see the table in the Telegram Type Implementation section).
  4. When TIA Portal generates the UDT automatically, right-click the UDT in the project tree and select Copy. Paste it into the new global library. The pasted UDT is now free of the V12 conversion tag.
  5. Add the FBs from the original library: open the old V13 global library in read-only mode, copy each FB/FC body, paste it into the new library, and recompile. If the FB uses the old UDT, update the Used data types reference to point to the new UDT in the new library.
  6. Compile the new library: right-click > Compile > Software (rebuild all). The compile log should show zero errors and zero warnings.
  7. Replace the library reference in the project: Global libraries > Open global library > New library path. Delete the old library from the global libraries list.
  8. Recompile the S7-1200 program. Download to the CPU 1214C and verify in the online view that all SINAMICS instance DBs are non-error.
Tip: When pasting UDTs between libraries, deselect the Retain attribute on instance DBs that are auto-generated for the drive. The CU305 PN will overwrite the process data on the first cyclic frame and a stale Retain value can cause a one-cycle speed step on power-up. Retain should remain enabled only for setpoint ramps, hand-off auto/manual states, and operator-entered parameters that must survive a power cycle.

Resolution Method 2 — Side-by-Side TIA Portal Installation

If the project must remain on V13 but the source library must be preserved for traceability, install TIA Portal V12 SP1 Update 5 (or whichever build produced the library) on a separate engineering workstation or a Windows virtual machine. Parallel installation of V12 and V13 on the same machine is supported by Siemens as long as the installation order is oldest-first. Installing V13 first and then V12 produces a registry collision that prevents the V12 SIMATIC Manager from launching.

  1. On the V12 machine, open the library and identify the UDT that triggers the error. The V12 build will still load the library correctly.
  2. Right-click the UDT > Generate source from blocks. Export the source as a .src file. The source is plain-text SCL and is portable between TIA Portal versions.
  3. Copy the .src file to the V13 workstation.
  4. In V13, create a new UDT and paste the source into the editor. V13 will accept the textual UDT definition because the textual source path does not carry the bad CodeBlockData property bag.
  5. Re-create the FBs the same way: Generate source in V12, paste into V13.
  6. Recompile in V13 and verify the error is gone.

This method is preferred when the library contains dozens of UDTs because the textual round-trip preserves every member, every comment, and the original symbol names without manual transcription. The downside is the engineering overhead of maintaining two TIA Portal installs.

Resolution Method 3 — Re-Download of the SINAMICS Telegram Library

Siemens publishes the SINAMICS Telegram V1.2 type library as a free download on the Industry Online Support portal. The download is a .zip containing a global library and a PDF release note.

  1. Open Siemens Industry Online Support and search for SINAMICS Telegram V1.2 TIA Portal V13 or the equivalent search term for the target TIA Portal version. Filter by Entry type: Download.
  2. Download the latest revision of the library. Always use the revision whose release note states compatibility with the TIA Portal build that the project uses.
  3. Extract the .al13 (or .al14, .al15, .al16) file. Close all TIA Portal instances.
  4. Copy the library to the engineering share: \\<share>\Libraries\Sinamics\.
  5. Open the project, Global libraries > Open global library, point to the new file, and remove the old V12 library from the global library list.
  6. Recompile and download.
Warning: The Telegram V1.2 download is not backward compatible. A library built for V13 cannot be opened in V12 SP1. If you must retain the V12 build for any other project, keep two copies: one for V12 and one for V13. Forward conversion is supported (V12 → V13) but the resulting V13 library is not guaranteed to be byte-identical to the re-downloaded one.

Resolution Method 4 — Manual UDT Reconstruction

If neither V12 nor the Siemens support site is available, build the UDT manually from the PROFIdrive specification. This method is the most labor-intensive but eliminates every external dependency.

  1. Open the project in V13 and create a new UDT.
  2. Add the standard PROFIdrive PZD members one by one. For Telegram 1 (speed setpoint, 16-bit), the UDT contains the input slot (controller → drive): STW1 (WORD), NSOLL_A (INT), NIST_A (INT) in the PZD-IN direction and ZSW1 (WORD), NIST_A (INT) in the PZD-OUT direction. For Telegram 102 (speed setpoint, 32-bit with torque limit), add M_LIM (INT) on the input side and MIST_GL (INT) on the output side.
  3. Match the byte order. PROFIdrive is little-endian on the S7-1200. A 32-bit REAL speed setpoint must be placed in two INT members; do not use REAL directly on the cyclic PZD boundary because the byte order inside a REAL depends on compiler settings.
  4. Mark each input member with Accessible from HMI/OPC UA only if the operator panel needs to read or write the value. Default is unchecked to keep the OPC UA namespace clean.
  5. Compile the UDT, then add the FB that calls DPRD_DAT and DPWR_DAT for the CU305 PN slot. The slot index must match the hardware identifier of the CU305 PN's PROFINET port; obtain it from the device view > CU305 PN > Properties > System constants > HW_ID_PN_Interface.
  6. Download and verify the cyclic frame in the watch table: the STW1 word must toggle from 16#047E (inhibit operation, no fault, no coast stop) to 16#047F (run enable) as the control bits are written.

PROFIdrive Telegram Type Implementation Reference

The following table summarizes the most common telegrams used between a CPU 1214C and a CU305 PN. The slot assignment assumes the CU305 PN is the only PROFINET IO device on the controller's PROFINET interface and that no shared device mode is configured.

Telegram # Direction Word layout (PLC ↔ drive) Typical use
1 Standard STW1 / ZSW1, NSOLL_A / NIST_A Speed setpoint, 16-bit
2 Standard STW1 / ZSW1, NSOLL_A / NIST_A, STW2 / ZSW2 Speed setpoint + 16-bit process data
3 Standard STW1 / ZSW1, NSOLL_A / NIST_A + 5 PZD Speed with 5 free PZD words
4 Standard STW1 / ZSW1, NSOLL_A / NIST_A + 6 PZD Speed with 6 free PZD words
5 Standard STW1 / ZSW1, NSOLL_A / NIST_A, STW2 / ZSW2 + 5 PZD Speed + 16-bit process + 5 free PZD
6 Standard STW1 / ZSW1, NSOLL_A / NIST_A + 9 PZD Speed + 9 free PZD
102 Vendor extension STW1 / ZSW1, NSOLL_A / NIST_A, M_LIM / MIST_GL, STW2 / ZSW2 Speed + torque limit + free PZD
105 Vendor extension STW1 / ZSW1, NSOLL_A / NIST_A, M_LIM / MIST_GL, FAULT_CODE / WARN_CODE Speed + torque limit + fault/warn
106 Vendor extension STW1 / ZSW1, NSOLL_A / NIST_A, M_LIM / MIST_GL + 4 PZD Speed + torque + 4 free
110 Vendor extension STW1 / ZSW1, NSOLL_A / NIST_A, M_LIM / MIST_GL + 6 PZD Speed + torque + 6 free

The UDT generated by the SINAMICS Telegram Configuration tool splits each PZD word into a separate UDT member. A Telegram 102 UDT contains 10 WORD members, of which 5 are inputs (controller → drive) and 5 are outputs (drive → controller). When the same telegram is read and written through the same UDT, the input and output members share the same data block but the byte offset is the same; the DPRD_DAT and DPWR_DAT calls operate on the same logical slot.

For applications that require an explicit separation between the controller's setpoint and the drive's actual value, create two UDTs: one for the input slot (controller → drive, populated by DPWR_DAT) and one for the output slot (drive → controller, populated by DPRD_DAT). This pattern simplifies the symbol table and makes it possible to pass each UDT to a different FB instance.

PROFIdrive State Machine and Control Words

The PROFIdrive state machine on the CU305 PN is governed by the control word STW1 and the status word ZSW1. The drive will not enter the Operation enabled state until bits 0, 1, 2, and 3 of STW1 are set in the correct order.

STW1 bit Name Required value to enable Side effect when cleared
0 ON / OFF1 1 Drive coasts to stop (ramp stop if configured)
1 Coast stop (OFF2) 1 Drive coasts to stop, pulse inhibit
2 Quick stop (OFF3) 1 Drive ramps down with quick-stop ramp
3 Enable operation 1 Drive disables, pulses inhibited
4 Ramp-function generator enable 1 Ramp freeze at current value
5 Ramp-function generator unlock 1 Ramp holds at current value
6 Setpoint enable 1 Setpoint frozen
7 Fault acknowledge (edge) 0 → 1 transition No effect on state, but acks faults
8 Jog 1 0 Jog 1 active when 1
9 Jog 2 0 Jog 2 active when 1
10 Control by PLC 1 Drive ignores STW1

The drive acknowledges the state with ZSW1:

ZSW1 bit Name Meaning when set
0 Ready to switch on Drive ready, no fault, OFF1 active
1 Ready to operate Drive ready, OFF2 and OFF3 not active
2 Operation enabled Drive follows setpoint
3 Fault present Drive is in fault state, latched
4 Coast stop active (OFF2) OFF2 is active, pulses inhibited
5 Quick stop active (OFF3) OFF3 is active, ramp-down in progress
6 Switch-on inhibit Drive is in switch-on inhibit, needs re-init
7 Alarm present Drive has a non-fatal alarm
8 Speed setpoint-actual deviation Setpoint and actual differ beyond threshold
9 Control by PLC requested Drive expects bit 10 of STW1 = 1
10 f or n reached Actual speed within tolerance of setpoint

After a cold start, the recommended initialization sequence is:

  1. Set STW1 = 16#047E (bits 1, 2, 4, 5, 6 set, 0 and 3 clear). The drive enters Ready to switch on and reports ZSW1 = 16#0A31.
  2. Set bit 0 (STW1 = 16#047F). The drive enters Ready to operate and reports ZSW1 = 16#0A33.
  3. Set bit 3 (STW1 = 16#047F unchanged, but bit 3 must be 1). The drive enters Operation enabled and reports ZSW1 = 16#0A37.
  4. Ramp the setpoint NSOLL_A from 0 to the target. The drive follows the ramp and clears bit 8 of ZSW1 when the actual speed is within the tolerance window.

Integration with CPU 1214C and CU305 PN

The CPU 1214C DC/DC/DC (6ES7214-1AG40-0XB0) provides the PROFINET IO controller on port 1 and PROFINET IO device on port 2. The CU305 PN is the PROFINET IO device. The controller port and the device port must be wired through a managed switch (for example, a SCALANCE XC-206) or directly when no other IO device is present. The PROFINET device name must be assigned to the CU305 PN before the controller can establish the cyclic frame. Use the topology editor to set the device name; do not rely on DCP from the PLC scan alone if the controller is offline.

The slot assignment is fixed once the telegram is selected in the device configuration. The hardware identifier of the PZD slot is exposed under System constants. The DPRD_DAT block requires the hardware identifier of the input slot, and the DPWR_DAT block requires the identifier of the output slot. When the Telegram Configuration is changed (for example, from Telegram 1 to Telegram 102), the hardware identifiers change. Always re-read them and update the FB inputs.

The cycle time on the PROFINET interface should be set to 1.0 ms for the CU305 PN. This matches the default for SINAMICS S120. Increasing the cycle time to 2.0 ms or 4.0 ms is permitted but will reduce the achievable speed-loop bandwidth of the drive by the same factor. Do not decrease below 0.5 ms without verifying that both the controller and the device support it; the CPU 1214C PROFINET port supports 0.5 ms only on firmware 4.2 and later. The CU305 PN supports 0.5 ms on firmware 4.7 and later; firmware 4.6 requires a minimum of 1.0 ms.

Commissioning order: After the library is rebuilt and the project is downloaded, perform the SINAMICS basic commissioning (BICO, motor identification) on the CU305 PN using Starter or Startdrive. The PLC telegram exchange is only validated when the drive is in the "ready" state (r899 = 0x0A in the SINAMICS parameter view). The Telegram 1 default state machine expects STW1.0 = 0 (OFF1) on first power-up, so the drive will not start until the user program asserts bit 0 of STW1.

Commissioning with Starter and Startdrive

Siemens provides two commissioning tools for the SINAMICS S120 drive line:

Tool Latest Version Used For TIA Portal Integration
STARTER V5.x (legacy, V5.5 supported) Standalone drive commissioning, BICO wiring, motor identification None; project is separate from the TIA Portal project
Startdrive V15, V15.1, V16 (matches TIA Portal) Drive commissioning inside TIA Portal, technology objects, safety integration Yes; TO_Drive_S120 created in the project tree

For new projects, use Startdrive because the technology object TO_Drive_S120 simplifies the FBs and the safety integration. The TO_Drive_S120 is generated by Startdrive when the CU305 PN is dragged into the device view; it is stored inside the TIA Portal project, not in a separate global library. The Telegram V1.2 library is still required for the UDT mapping.

For legacy projects that already use STARTER, keep the STARTER project file under version control alongside the TIA Portal project. The two projects must be kept in sync: a STARTER parameter change (for example, a BICO rewire) is not visible in TIA Portal, and a TIA Portal telegram change (for example, from Telegram 1 to Telegram 102) is not visible in STARTER. The commissioning sequence is:

  1. STARTER / Startdrive: configure the Line Module (infeed), the Motor Module (power unit), and the motor parameters (p0300, p0301, p0304, p0305, p0310, p0311).
  2. STARTER / Startdrive: run motor identification (p1910 = 1 for static, p1960 = 1 for dynamic). The drive must be in Ready to operate state, not Operation enabled, during identification.
  3. STARTER / Startdrive: configure the telegram mapping (p0922, p2079) and the PROFIdrive slot assignment.
  4. TIA Portal: configure the CU305 PN in the device view, set the telegram number to match STARTER, and download the hardware configuration.
  5. TIA Portal: download the PLC program. Verify the cyclic frame in the watch table.
  6. TIA Portal: hand the drive over to the user program by setting STW1 = 16#047F and ramping the setpoint.

Verification and Commissioning

  1. Compile the rebuilt library. The compile log should show zero errors and zero warnings related to CodeBlockData.
  2. Compile the S7-1200 program. The log should show the SINAMICS instance DBs in the "Generated" state, not "Inconsistent".
  3. Download the project to the CPU 1214C. Watch the diagnostic buffer: Online & diagnostics > Diagnostic buffer. No entries of class "IO device failure" should be present after the CU305 PN is reachable.
  4. In the device view, go online with the CU305 PN. Open the watch table for the Telegram Configuration. Verify that the input slot reports "OK" and that the DPRD_DAT VALID output is set to TRUE.
  5. Write a small ramp function in OB1 that sets STW1 = 16#047F, then NSOLL_A = 0, then ramps NSOLL_A to 16384 (corresponding to 50% of the reference speed). Verify the drive follows the setpoint in the Startdrive trace.
  6. Power-cycle the drive and the controller together. After power-up, the drive should enter the "Ready to start" state without operator action. The ZSW1 word should report 16#0A31 (ready, no fault, no inhibit, speed within tolerance window).
  7. Archive the project and the library on the engineering share. Tag the library with the TIA Portal build that produced it (e.g., Sinamics_Telegram_V13_2_0_2.al13).
  8. Run a fault-injection test: trip the drive with a simulated encoder fault and verify that the user program reads ZSW1.3 = 1 within one PROFINET cycle. This confirms that the cyclic frame is healthy and that the UDT mapping is correct.

Related Errors and Edge Cases

The following errors may be reported alongside or in place of the CodeBlockData message. Each has a different root cause and a different fix.

Log message Root cause Fix
Cannot find a matching type for 'UDT_Sinamics_Telegram_V12' Old library was removed but the UDT reference remains in the program Re-add the new library, or replace the type manually with the rebuilt UDT
Library version is older than the project version V12 library opened in a V14+ project Apply the same rebuild procedure; V14/V15 converters are even stricter than V13
Interface section 'InOut' is not supported by the target version V13 introduced a stricter InOut validation Split the InOut into separate Input and Output sections
Type 'TO_Drive_S120' was created in a newer version The TO (technology object) is from a Startdrive release newer than the TIA Portal Install the matching Startdrive version, or remove the TO and re-create
GSDML file version 2.31 is not supported on PROFINET IO controller V2.0 CU305 PN GSDML requires PROFINET IO controller V2.1+ Use a PROFINET interface with a controller that supports V2.1+ (CPU 1214C FW 4.0+ supports it on port 1)
The block 'FB_Drive_Control' is protected and cannot be displayed Knows-how-protected block from a V12 library opened in a newer TIA Portal Source the FB from a V13 project or re-author it without protection
The interface of the block has changed since the last compilation UDT members were renamed or reordered during the library rebuild Reconnect the symbolic references; do not rely on absolute addresses
PROFINET IO: device failure, slot 0, subslot 1 The CU305 PN is not reachable on the network, or the device name does not match Verify the device name with the topology editor, check the port LEDs, verify the GSDML is installed
Diagnostic interrupt: channel fault, channel 0 CU305 PN reported a PROFIdrive channel fault (for example, telegram mismatch) Verify the telegram number in TIA Portal matches the drive parameter p0922

Preventive Measures

  • Tag every global library with the TIA Portal build that produced it. A library built on V12.0.1.5 should be named Sinamics_Telegram_V12_0_1_5.al12 so future engineers can see at a glance which build is required to open it.
  • When a TIA Portal upgrade is planned, schedule a library rebuild sprint for every drive library in the project. Do not assume the converter will handle them silently; the CodeBlockData exception is silent in the project tree and only visible in the log file.
  • Keep the engineering share backed up. A library that is broken by a failed upgrade should be restorable to its last good revision.
  • Run a virus scanner exclusion on the TIA Portal installation directory and on the engineering share. Some anti-virus products flag the V12 library model as a malformed executable and quarantine the file, which produces a similar error.
  • Document the rebuild procedure in the project's engineering handbook. Include the exact build numbers of TIA Portal, Startdrive, and the SINAMICS telegram library that the project is known to compile against.
  • Set up a CI-style gate on the engineering share: a scheduled job that opens every .al* library in a clean TIA Portal install and reports the conversion result. The job can be scripted via the TIA Portal Openness API.
  • Audit the project for cross-version library references. The References > Library usage view in TIA Portal lists every library and its build number; a project with mixed-version libraries will produce the error on the next full compile.
  • Use the "Always compile before download" option in the project properties. This forces the converter to run on every download, surfacing the error early instead of at the first commissioning step.

FAQ

Why does the library upgrade fail only with the SINAMICS Telegram V1.2 UDT and not with the other blocks in the same library?

The V13 converter walks the library element-by-element. The UDT generated by the SINAMICS Telegram Configuration tool carries an interface-slot stub that the V12 model allowed but the V13 model removed. Other UDTs in the same library are not affected, but the failure on a single UDT poisons the entire library because the library is upgraded as one transaction.

Can I keep the V12 library and just compile the project in V13?

No. The TIA Portal project model must be at the same version as the libraries it references. A V12 library in a V13 project will either be silently rejected on open or produce the CodeBlockData error on the first compile. The library must be rebuilt in V13 before the project will compile.

Will the rebuild change the UDT layout in the program?

Only if the engineer changes the telegram. The rebuild procedure in this article recreates the UDT with the same members, the same order, and the same names. Existing instance DBs will continue to work, and the symbolic references in the user program will resolve. The only visible change is the timestamp of the UDT in the project properties.

Is the same error reported on STEP 7 V14, V15, or V16?

Yes, with the same root cause. The TIA Portal model class was refactored in V13 and the same refactor was carried forward to V14, V15, V15.1, and V16. Any V12 library opened in any of these versions will produce the CodeBlockData error unless it is rebuilt first. The V17 release carries the same restriction.

Does this issue affect libraries other than the SINAMICS Telegram V1.2 library?

Yes. Any UDT generated by a TIA Portal add-in or by a vendor tool that produced a V12-compiled library with the interface-slot stub will exhibit the same error on upgrade. The SINAMICS library is the most commonly reported because it is widely distributed and frequently upgraded in the same TIA Portal maintenance window as the controller firmware. SIMOTION, SINUMERIK, and third-party drive libraries (ABB, Yaskawa, SEW-Eurodrive) have reported the same error pattern.

What is the minimum firmware on the CPU 1214C for the rebuilt V13 library to work?

Firmware 4.0 on the CPU 1214C DC/DC/DC (6ES7214-1AG40-0XB0) is sufficient for the standard PROFIdrive telegrams 1, 2, 3, 4, 5, 6, 102, 105, 106, and 110. Firmware 4.2 or later is required for PROFINET cycle times below 1.0 ms and for the OPC UA server on the S7-1200. The CU305 PN must be on firmware 4.6 or later for Telegram 1 to 6, and 4.7 or later for Telegram 102, 105, 106, and 110. Mismatched firmware will not produce the CodeBlockData error but will produce a "PROFINET IO: device failure" entry in the diagnostic buffer.

Back to blog