Troubleshooting USS Protocol V2.1 Data Type Mismatch on S7-1200

David Krause12 min read
S7-1200SiemensTroubleshooting
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 commissioning USS protocol version 2.1 (USS V2.1) to replace legacy S7-200 control of Sinamics G110 drives with an S7-1200 CPU, the TIA Portal compiler returns the error:

The data type USS_Drive_Control of the actual parameter does not match the data type P2P_USS_BASE of the formal parameter.

The error fires after inserting USS_Drive_Control followed by USS_Port_Scan in OB1 and wiring the automatically generated USS_Drive_Control_DB to the USS_DB formal parameter of USS_Port_Scan. The behaviour is reproducible on TIA Portal V13.0 SP1 Update 9 (V13.00.01.09_07.01.00.01) with CPU 1214C AC/DC/Rly (6ES7214-1BG40-0XB0) firmware V4.1 and CM 1241 RS485 (6ES7 241-1CH30-0XB0) hardware version V1.0. The root cause is library-internal: the V2.0 and V2.1 USS libraries define incompatible P2P_USS_BASE UDTs, and dragging blocks from one variant while the project still references the other variant makes the compiler compare two structurally different data types at the USS_DB input of USS_Port_Scan.

Refer to the official Siemens application example, SIMATIC S7-1200 / S7-1500 with SINAMICS G110/G120 using USS protocol via CM 1241 (entry ID 109480894), for the canonical project layout used in V2.1 deployments.

Affected System Configuration

The failure has been confirmed on the following hardware and software stack:

Component Order Number Version / Firmware
CPU 1214C AC/DC/Rly 6ES7214-1BG40-0XB0 Firmware V4.1
CM 1241 (RS485) communication module 6ES7 241-1CH30-0XB0 Hardware V1.0
SIMATIC STEP 7 Basic (TIA Portal) 6ES7822-0AA03-0YA5 V13.0 SP1 Update 9 (V13.00.01.09_07.01.00.01)
USS protocol library Siemens "USS" global library V2.0 and V2.1 both installed
Drives Sinamics G110 (3 units) RS485 multidrop

The CPU 1214C DC/DC/Rly or DC/DC/DC variants (6ES7214-1AG40-0XB0 / 6ES7214-1HG40-0XB0) reproduce the same compiler behaviour when paired with the same library combination. The cause is library-related, not hardware-related; swapping the CPU does not change the diagnosis.

Note: Verify that CPU FW 4.1 and CM 1241 (RS485) HW V1.0 are present in the TIA Portal hardware catalog before reproducing the error. CPU FW 4.1 corresponds to HSP 0165 / HSP 0179 family updates for TIA Portal V13 SP1. Without the correct HSP, the CPU appears as "unknown" and the project will not compile, masking the real USS error.

Root Cause Analysis

The Siemens USS protocol libraries are shipped as TIA Portal global libraries. Two incompatible variants coexist in the same library repository:

  1. USS V2.0 – labelled "USS (S71200)" in the library tree. This is the legacy library retained for S7-1200-only projects and was the only USS option before TIA Portal V13 SP1.
  2. USS V2.1 – labelled "USS (S71200/S71500)" in the library tree. This variant was introduced with TIA Portal V13 SP1 to provide a unified USS interface usable on both S7-1200 and S7-1500 controllers.

The two variants define incompatible versions of the P2P_USS_BASE UDT. When the global library manager contains both variants and the user drags USS_Drive_Control from one variant and USS_Port_Scan from the other (or drags both from V2.1 while the project still holds V2.0 instance DBs of the old UDT shape), the compiler compares two structurally different data types at the USS_DB input of USS_Port_Scan. The error message names the symptom directly: the actual parameter is of USS_Drive_Control type, but the formal parameter expects P2P_USS_BASE.

Subordinate causes that frequently co-occur with the primary library-mismatch cause include:

  • The project was migrated from an earlier TIA Portal version that pinned the V2.0 blocks in the project library.
  • The library master copies were not re-linked after a TIA Portal service pack upgrade.
  • The CPU firmware was upgraded and the project recompiled against a newer USS library without re-importing the library globally.
  • Blocks were copy-pasted from a different project that linked the other USS library variant.

USS Library Architecture Comparison

Property USS V2.0 (S7-1200 only) USS V2.1 (S7-1200 / S7-1500)
Library folder in TIA Portal USS (S71200) USS (S71200/S71500)
Target CPUs S7-1200 (CPU FW ≥ 2.0) S7-1200 (FW ≥ 4.1) and S7-1500
Port scan block USS_Port_Scan USS_Port_Scan
Drive control block USS_Drive_Control USS_Drive_Control
Parameter access blocks USS_Read_Param / USS_Write_Param USS_Read_Param / USS_Write_Param
Base DB UDT P2P_USS_BASE (V2.0 layout) P2P_USS_BASE (V2.1 layout)
Max drives per port 16 16
Error code width WORD WORD
Compatible with TIA Portal V13 SP1 Yes Yes (after library import)
Compatible with TIA Portal V14 / V15 Yes Yes

The two libraries are not interchangeable within the same project. A clean conversion requires removing every USS block, every USS UDT, and every instance DB generated by the wrong variant before inserting the correct variant.

Resolution Path A – Use the USS V2.0 Library on S7-1200

USS V2.0 is the library guaranteed to compile on TIA Portal V13 SP1 with CPU FW 4.1 without additional service packs. V2.0 is also the library most commonly encountered in legacy migration projects that replace S7-200 CPU 224XP with built-in RS485 ports.

  1. Open the project in TIA Portal V13 SP1 Update 9.
  2. Open the Libraries task card on the right side of the project tree.
  3. Expand Global libraries → USS (S71200). Do not open USS (S71200/S71500).
  4. Drag USS_Port_Scan from the master copies folder into OB1. Accept the default instance DB name (e.g., USS_Port_Scan_DB).
  5. Drag USS_Drive_Control into OB1 for each of the three Sinamics G110 drives. Each insertion creates a separate instance DB (e.g., USS_Drive_Control_DB_1, _DB_2, _DB_3).
  6. Wire each USS_Drive_Control block's USS_DB input to the same multi-instance DB generated by USS_Port_Scan.
  7. Compile the project (Project tree → CPU → Compile → Software). The compiler must accept the USS_DB input wiring without error.

Recommended input wiring for the V2.0 blocks:

USS_Port_Scan input Wiring
PORT Hardware ID of the CM 1241 RS485 port (typically 269)
USS_DB Multi-instance DB generated by USS_Port_Scan (type P2P_USS_BASE)
BAUD 9600 or 19200 baud (matches P2010 on Sinamics G110)
ERROR BOOL memory bit (e.g., M0.0) – read on rising edge
STATUS WORD memory word (e.g., MW2)
USS_Drive_Control input Wiring
RUN BOOL – always TRUE on every drive instance
OFF2 BOOL – coast-stop, normally FALSE
OFF3 BOOL – fast-stop, normally FALSE
F_ACK BOOL – fault acknowledge, momentary TRUE on operator action
SPEED_SP REAL – speed setpoint in % of P2000 reference
DIR BOOL – direction reversal
DRIVE USINT – node address (1, 2, 3 matching P2013 on each drive)
USS_DB Same DB used by USS_Port_Scan (V2.0 P2P_USS_BASE instance)

Resolution Path B – Convert the Project to USS V2.1

If V2.1 functionality (extended parameter-channel diagnostics, S7-1500 portability) is required, perform the conversion in this order to avoid leftover UDT references:

  1. Delete every USS_Drive_Control, USS_Port_Scan, USS_Read_Param, and USS_Write_Param block from every OB, FB, and FC.
  2. Delete every instance DB whose type starts with USS_ or whose name appears in the USS library master copies list.
  3. Delete the P2P_USS_BASE UDT from the project PLC data types folder.
  4. Open Options → Manage global libraries and confirm that the V2.0 library master copies are removed from the project library repository.
  5. Open Libraries → Global libraries → USS (S71200/S71500) and drag USS_Port_Scan into OB1. Accept the default instance DB.
  6. Drag USS_Drive_Control into OB1 three times – once per drive – accepting each default instance DB.
  7. Compile the project. The P2P_USS_BASE UDT is now imported from the V2.1 master copy and matches the UDT expected by both blocks.
Warning: Skipping step 2 leaves orphan DBs of the V2.0 type. The compiler may then silently bind to the old UDT, masking the error message and producing runtime faults when the wrong DB layout is dereferenced during cyclic execution.

Sinamics G110 Commissioning Parameters

Before commissioning USS from the S7-1200, set the G110 communication parameters via the Basic Operator Panel (BOP) or STARTER commissioning tool to match the S7-1200 configuration:

Parameter Address Description Recommended value
P0700 Command source 5 = USS on COM link 5
P1000 Setpoint source 5 = USS on COM link 5
P2010 USS baud rate 6 = 9600; 7 = 19200; 8 = 38400; 9 = 57600 6 (9600 baud for first-time commissioning)
P2011 USS PZD length Process data word count 2
P2012 USS PKW length Parameter channel word count 127 (variable; 0 / 3 / 4 / 127)
P2013 USS node address 1 – 31 1, 2, 3 (one per drive)
P2014 USS telegram off time Watchdog in ms 500 ms
P2000 Reference frequency Setpoint scaling base 50.00 Hz (match motor nameplate)

RS485 Wiring and Termination

The CM 1241 RS485 module exposes a 9-pin sub-D female connector. The recommended topology for three Sinamics G110 drives is daisy-chain with termination enabled at both physical ends only:

  • Pin 3 = RS485 DATA+ (P)
  • Pin 8 = RS485 DATA– (N)
  • Pin 5 = logic ground (reference, not shield)

Set the CM 1241 onboard termination switch to ON when the module is at one end of the bus; the Sinamics G110 termination switch (DIP switch S1 position 1) must be ON at the drive at the far end of the bus. Maximum cable length at 9600 baud is 1200 m; at 19200 baud the limit drops to 800 m. Use shielded twisted-pair cable and bond the shield at the cabinet entry only.

Verification and Troubleshooting Matrix

After the compile error is cleared, perform the following live checks:

  1. Download the project to the CPU and place it in RUN.
  2. Open Online & diagnostics → USS diagnostics in TIA Portal (V14 and later only).
  3. Monitor USS_PORT_SCAN.ERROR. A rising edge indicates a port-level fault – read STATUS for the error code (see matrix below).
  4. Set SPEED_SP = 50.0 on drive 1 and verify a 25 Hz reference at the G110 (50% of P2000 = 50 Hz).
  5. Toggle the OFF2 bit and verify the drive coasts to stop within the deceleration ramp of P1121.
  6. Send a fault (e.g., trip F0001 on the G110 by exceeding the current limit) and toggle F_ACK – the drive must reset and resume running.
Symptom Likely cause Verification Fix
Compiler error: P2P_USS_BASE mismatch Mixed USS V2.0 and V2.1 in same project Inspect library master copies Delete one variant globally; recompile
ERROR output toggles immediately at RUN No reply from drive (wrong node address) Read P2013 on G110 BOP Correct DRIVE input to match P2013
ERROR = TRUE after first SCAN cycle Baud rate mismatch Compare P2010 with BAUD input Set BAUD to value matching P2010
STATUS = 16#0001 Drive number out of range (must be 1–31) Inspect DRIVE input Limit DRIVE to 1 – 31
STATUS = 16#0007 USS_DB shared incorrectly across drives Inspect USS_DB on every drive Use the same multi-instance DB; do not allocate one per drive
STATUS = 16#000A CM 1241 port not configured for USS Device configuration → CM 1241 properties Set protocol to USS, enable port
STATUS = 16#000E Response timeout – telegram lost Check wiring, termination, node addresses Verify RS485 topology and P2014 watchdog
Drive runs uncontrolled OFF2 / OFF3 not wired Inspect F-block inputs Tie OFF2 and OFF3 to FALSE until tested
Compile error: USS_Drive_Control_DB not found Insertion order wrong (Port_Scan before Drive_Control) Check insertion order Insert Drive_Control blocks first
Runtime: drive 1 responds, drives 2/3 silent Duplicate node addresses Compare P2013 on all drives Assign 1, 2, 3 uniquely

Best Practices and Migration Notes from S7-200

The S7-200 USS instructions (USS_INIT, USS_CTRL, USS_RPM_x, USS_WPM_x) are library functions specific to the S7-200 platform and are not portable to S7-1200. The following migration rules apply when porting a working S7-200 USS program:

  • S7-200 used a single USS_INIT per port; S7-1200 uses USS_Port_Scan per port and one USS_Drive_Control per drive.
  • S7-200 USS_CTRL was polled in OB1; S7-1200 USS_Drive_Control should be polled in a cyclic OB (OB1) at a 50 – 100 ms interval to match the G110 telegram off time (P2014).
  • S7-200 polled parameter reads with USS_RPM_W / USS_RPM_D; S7-1200 uses USS_Read_Param with a single tag covering all parameter formats.
  • S7-200 typically ran at 19200 baud with 3-word PKW; S7-1200 supports up to 115200 baud with 127-word PKW, but conservative 9600 baud remains the field-proven default for new G110 installations.
  • S7-200 stored drive status in VW memory; S7-1200 stores drive status in the multi-instance DB generated by USS_Drive_Control.

Field-proven caveats not always obvious from library documentation:

  • CPU firmware 4.1 requires TIA Portal V13 SP1 Update 4 or later. Earlier SP1 Update levels will load the project but produce an unreadable cross-reference on the USS blocks.
  • The CM 1241 RS485 hardware version V1.0 cannot be replaced in the field with V2.0 without re-assigning the hardware identifier in TIA Portal. The HW ID is referenced at USS_Port_Scan.PORT.
  • The G110 telegram off time (P2014) must be greater than the S7-1200 scan cycle × 2. A typical 9600 baud setup with three drives and a 100 ms port scan requires P2014 ≥ 300 ms. Setting P2014 too low causes the drive to time out on the second drive before the first response is parsed.
  • Do not enable the G110 analog input as a secondary setpoint source when P1000 = 5. Mixed setpoint sources cause the USS speed setpoint to be summed with the analog input, producing an uncontrollable speed range.

Frequently Asked Questions

Which USS library version should I use with an S7-1200 CPU running firmware 4.1?

Use the USS V2.0 library (folder "USS (S71200)") for S7-1200-only projects with firmware 4.1 and TIA Portal V13 SP1. Use USS V2.1 ("USS (S71200/S71500)") only when the same USS code must run on S7-1500 or when V2.1-specific parameter-channel features are required. The two libraries are not interchangeable inside one project.

What causes the "P2P_USS_BASE data type mismatch" compiler error?

The compiler error appears when USS_Drive_Control_DB is generated by one USS library variant while USS_Port_Scan expects a P2P_USS_BASE instance from the other variant. The fix is to remove every USS block, instance DB, and the P2P_USS_BASE UDT from the project and re-insert all blocks from a single library master copy.

Can I run USS V2.1 with TIA Portal V13 SP1 Update 9?

Yes. The USS V2.1 library ships with TIA Portal V13 SP1 and remains compatible through V15.1. V2.1 was introduced with V13 SP1 specifically to support both S7-1200 and S7-1500 controllers with one library.

How many Sinamics G110 drives can I control on one CM 1241 RS485 port?

The USS protocol supports up to 31 node addresses on a single RS485 trunk. The USS_Port_Scan block accepts 1 to 16 USS_Drive_Control instances in TIA Portal. For three G110 drives on one CM 1241 the project uses three USS_Drive_Control instances and one USS_Port_Scan instance sharing the same P2P_USS_BASE multi-instance DB.

What is the maximum cable length for USS on RS485 at 9600 baud?

The Siemens RS485 specification allows up to 1200 m (4000 ft) of shielded twisted-pair cable at 9600 baud with proper termination at both ends. At 19200 baud the maximum drops to 800 m. The CM 1241 onboard termination switch must be enabled only when the module sits at one physical end of the bus.

Back to blog