Installing ET 200M AI Card in IM153: TDC Virtual Connection Setup

David Krause13 min read
I/O ModulesSiemensTutorial / 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

SIMATIC TDC and ET 200M System Overview

The configuration described in this article is a SIMATIC TDC multiprocessor automation system communicating with a SIMATIC ET 200M distributed I/O station over PROFIBUS DP. The ET 200M is built from an IM 153-x interface module and S7-300 signal modules (SM), so any S7-300 I/O module can be plugged in. This modularity is the main reason a new analog input card can be added to a working station without replacing the head station.

The TDC programs its signal exchange with the ET 200M using virtual connections defined in CFC (Continuous Function Chart). Each virtual connection has the form:

!E7CM06.xxxx

where E7 is the system prefix assigned to the PROFIBUS segment or coupling channel used in the TDC, CM06 identifies the ET 200M slave at PROFIBUS address 6, and xxxx is the user-chosen virtual connection number. The block that materialises this name is the CRV (Coupling Receiver) function block whose CRR output carries the string. The same string is referenced inside the CFC when an interconnection to a virtual address is created.

For the referenced station, the I/O population is documented as follows:

Slot Module Direction Width (bytes)
1 DI32 (SM 321) Inputs 4 bytes
2 AI8 (SM 331) Inputs 16 bytes (8 ch x 2)
3 DO32 (SM 322) Outputs 4 bytes
4 DO32 (SM 322) Outputs 4 bytes
5 AO4 (SM 332) Outputs 8 bytes (4 ch x 2)

The new AI card described below extends slot 2 (or occupies an additional slot if the SM 331 is being upgraded to a higher channel count). For TIA Portal v20 documentation on ET 200M, refer to the Siemens TIA Portal v20: ET 200M configuration reference.

Prerequisites

  1. STEP 7 V5.x with HW Config and CFC installed on the engineering station. TIA Portal can be used for the ET 200M station only if the TDC is configured in a separate SIMATIC Manager project; the CFC for TDC always runs in STEP 7 V5.x.
  2. Approved SM 331 module selected for the application (resolution, channel count, measurement type). Typical catalog numbers:
    • 6ES7331-7KF02-0AB0 - 8 AI, 13-bit resolution
    • 6ES7331-7NF10-0AB0 - 8 AI, 16-bit resolution
    • 6ES7331-7PF11-0AB0 - 8 AI, 16-bit, 0.052 ms/channel
    • 6ES7331-1KF02-0AB0 - 8 AI, 13-bit, basic
  3. Current TDC and ET 200M backups, including the CFC source and the compiled S7 program on the TDC.
  4. Front connector, coding key, and labeling strips for the new SM 331.
  5. Existing virtual connection inventory. Run a global search in the CFC for !E7CM06 and record the highest existing connection number (e.g. 0050 or 0070 in the examples referenced here).
  6. Plant in a safe state; the ET 200M power bus will be interrupted during the slot change, so downstream I/O must tolerate a short stop.

Hardware Installation of the AI Module in ET 200M

  1. Open the ET 200M station by releasing the terminal modules on each side of the new slot.
  2. Insert the bus connector from the previous module into the new SM 331.
  3. Snap the SM 331 onto the DIN rail and tighten the module screws.
  4. If the new SM 331 replaces the existing 8-channel module, the I/O address width remains 16 bytes. If a second 8-channel AI module is added, the I/O width grows by 16 bytes and shifts all subsequent slot addresses by 16 bytes, so any pre-existing !E7CM06.xxxx values pointing to slots 3 to 5 must be re-evaluated after HW Config changes.
  5. Wire the front connector, fit the coding key, and apply the new label.
  6. Restore 24 V to the backplane and confirm the IM 153 reports the new module in its diagnostic buffer without errors such as station failure or module not found.
On a powered PROFIBUS segment the IM 153 will briefly report the station as faulty during module insertion. If the station is on a Y-link or redundant IM 153-2, the standby head will pick up. Do not perform a hot swap on an IM 153-1 unless the application is approved for it.

HW Config: Inserting the New AI Module

  1. Open SIMATIC Manager and load the TDC project that contains the ET 200M slave at PROFIBUS address 6.
  2. Launch HW Config and double-click the IM 153 to open the station editor.
  3. Drag the new SM 331 from the hardware catalog onto the target slot. If you are upgrading the existing module, right-click the slot and select Replace Object.
  4. Double-click the new module to open its properties and configure:
    • Measurement type: voltage, current (4 to 20 mA), RTD, or thermocouple
    • Measuring range per channel group (channels 0-3 and 4-7 are usually paired)
    • Diagnostics and wire-break enable bits
    • Smoothing and integration time
  5. Note the input address range assigned by STEP 7 (e.g. PI 256 to PI 271 for 16 bytes). These process-image addresses are only used by the TDC for internal diagnostics; the actual data exchange with the CFC is performed exclusively through the virtual connection identifiers, not through PIW addresses.
  6. Save and compile the hardware configuration. Do not attempt to upload from the TDC; the new module must be downloaded back to the IM 153 so the station's actual configuration matches HW Config.

Understanding the E7CM06 Virtual Connection Naming

The string E7CM06 is set on the CRR output of the CRV function block. CRV is the TDC-side receiver used to bind a PROFIBUS slave to a CFC program. The naming has three parts:

Field Meaning Source
E7 System prefix for the TDC rack or PROFIBUS channel Project-wide TDC configuration
CM Coupling marker identifying the DP slave class CRV FB parameter
06 PROFIBUS slave address of the ET 200M HW Config PROFIBUS address

The number after the dot is purely a free index chosen by the engineer; it does not have to match a physical byte offset. The CRV FB and the downstream TDC firmware route the value to the correct process image offset by inspecting the I-type or DI-type tag and the connection number, in the order that the engineer inserts them in the CFC. This is why gaps are permitted and why the highest number must be re-checked when a module is added or removed.

Byte Layout and Address Calculation for Mixed I/O

For the reference station the input and output areas are laid out as follows. The byte offsets are relative to the start of the station's process image.

Byte offset Width Module Type Virtual connection type
0 to 3 4 bytes DI32 DI-type BOOL/byte pack
4 to 19 16 bytes AI8 I-type REAL/INT per channel
20 to 23 4 bytes DO32 #1 DO-type BOOL/byte pack
24 to 27 4 bytes DO32 #2 DO-type BOOL/byte pack
28 to 35 8 bytes AO4 O-type REAL/INT per channel

The standard mapping for AI8 is 2 bytes per channel. The order in which the engineer assigns !E7CM06.xxxx numbers determines which byte slice each connection reads:

!E7CM06.0001  DI32 (4 bytes, 32 bits)
!E7CM06.0002  AI8 channel 0 (bytes 4-5)
!E7CM06.0003  AI8 channel 1 (bytes 6-7)
!E7CM06.0004  AI8 channel 2 (bytes 8-9)
!E7CM06.0005  AI8 channel 3 (bytes 10-11)
!E7CM06.0006  AI8 channel 4 (bytes 12-13)
!E7CM06.0007  AI8 channel 5 (bytes 14-15)
!E7CM06.0008  AI8 channel 6 (bytes 16-17)
!E7CM06.0009  AI8 channel 7 (bytes 18-19)

When you have gaps - for example the engineer uses 0001, 0003, 0005, 0009, 0011 - the TDC fills the unused offsets with itself. The next free connection number must be strictly greater than the highest number currently in use on the same E7CM06 prefix. The use of NOP_I and NOP_O blocks is a common technique to claim a virtual connection that simply forwards the value into another program section.

CFC Configuration on the TDC Side

  1. Open the CFC chart that drives ET 200M on PROFIBUS address 6.
  2. Insert an NOP_I (or NOP_O) function block from the CFC library onto the chart sheet. NOP_I is a placeholder that gives the engineer an input pin to bind to a virtual address without doing any logic.
  3. Right-click the input pin of the NOP_I and select Interconnection to address.
  4. In the dialog, choose Virtual connection from the source list. From the drop-down, pick the string E7CM06 (defined on the CRR output of the CRV block).
  5. Enter the new connection number. The number must be greater than the maximum already used in the entire CFC for the same E7CM06 prefix. If !E7CM06.0070 is the highest existing connection, the new channel 1 is bound to !E7CM06.0071.
  6. Repeat for each of the 8 AI channels of the new module. The configuration must define all 8 channels even if some are physically unused, otherwise the TDC runtime may not be able to map the process image correctly and the diagnostic buffer will report an address gap.
  7. If the new module replaces an existing 4-channel SM 331 with an 8-channel SM 331, the additional 4 channels must also be claimed. Failure to claim them is a common cause of process image mismatch errors on the TDC.

A minimal example using NOP_I for the new AI module starting at 0071 is shown below. The numbers 0071-0078 each take 2 bytes from the AI8 process image, mirroring the previous pattern used at 0002-0009.

!E7CM06.0071  AI8 channel 0 (new card)
!E7CM06.0072  AI8 channel 1 (new card)
!E7CM06.0073  AI8 channel 2 (new card)
!E7CM06.0074  AI8 channel 3 (new card)
!E7CM06.0075  AI8 channel 4 (new card)
!E7CM06.0076  AI8 channel 5 (new card)
!E7CM06.0077  AI8 channel 6 (new card)
!E7CM06.0078  AI8 channel 7 (new card)

Virtual Connection Numbering Rules and Gaps

The TDC runtime allocates virtual connection numbers in the order the CFC references them. The rules to follow when extending an existing station are:

  • The lowest permitted number is 1; the highest is implementation-dependent but well above 9999 on standard TDC firmware.
  • You may skip numbers and create gaps. The runtime will fill the gap with the same offset it is currently routing to, which is harmless but inefficient.
  • You may not reuse a number that is already in use as a virtual connection for the same E7CM06 prefix; doing so causes a duplicate address error during compile.
  • The new number must be greater than the maximum currently used. If the maximum is 0050, you can use 0051; you cannot use 0001 or any number below 0050 because it would either collide with an existing reference or be ignored as a duplicate.
  • Numbers can be re-used across different prefixes (for example !E7CM07.0001 for slave 7) without conflict.

Save, Compile, and Download Procedure

  1. In HW Config, save and compile the hardware configuration. Check the Station menu to confirm that the new AI module is listed in the configured slots with no diagnostic warnings.
  2. Switch to the CFC chart and trigger Chart > Compile. Resolve any open warnings about unfilled interconnections or unconnected pins before proceeding.
  3. Connect the engineering station to the TDC. From SIMATIC Manager, select the TDC CPU and run PLC > Download to Target System. The new CFC and the new hardware configuration are transferred together; the TDC performs an initial run-up of the new station.
  4. If the TDC asks whether to overwrite the existing program, confirm; the original CFC was uploaded to a backup before the change.
  5. Trigger an omni E drive-style download only if the project is configured to push the binary into the IM 153 flash. In the standard workflow the IM 153 receives the new configuration from the TDC at the next PROFIBUS start-up.
  6. Monitor the diagnostic buffer of the TDC and the IM 153 to confirm a clean start-up. A typical error after a missed claim is Address area length error in the IM 153.
Uploading from the TDC is not supported for ET 200M virtual connections. The engineering station is the only source of truth. Always keep an offline backup of the CFC and the HW Config after the change.

Verification and Online Checks

  1. Open the CFC online view and watch the new !E7CM06.0071 to !E7CM06.0078 connections. With a calibrated mA source on the front connector, each connection should track the input.
  2. Open the IM 153 online diagnostics and verify Module OK for the new SM 331. A wire break or out-of-range flag must propagate to the CFC if diagnostics are enabled in HW Config.
  3. Force one AI channel to a known value and confirm that the connected CFC tag moves in lockstep. This is the fastest way to confirm that the byte offset is correct.
  4. Check the unused channel list. Channels that are physically wired must show valid data; channels that are intentionally left open must not generate wire-break alarms (disable wire-break in HW Config for those channels).
  5. Run a CFC consistency check to confirm that no references were lost during the edit. Pay particular attention to any E7CM06.xxxx referenced from other charts.

Troubleshooting Matrix

Symptom Likely root cause Corrective action
New AI channel reads 0 or a frozen value Connection number collides with an existing virtual connection Globally search the CFC for the chosen number, then renumber the new channel above the highest in use
TDC reports "address area length error" on PROFIBUS slave 6 All 8 AI channels of the new SM 331 are not claimed in CFC Insert NOP_I blocks for every channel of the new module and bind each to a unique !E7CM06.xxxx
Channels are swapped (channel 0 reads the sensor wired to channel 3) Byte offset calculation assumed a different channel width Verify that each !E7CM06.xxxx reads 2 bytes, and check that no other module is sitting in the same process image area
Wire-break alarm on an open input Wire-break diagnostics enabled for a 4-20 mA input that is intentionally open Disable wire-break in HW Config for the unused channel group, or fit a 4-20 mA simulator
IM 153 reports "module not found" after hot swap Module inserted in the wrong slot or wrong order Compare the configured slot in HW Config to the physical slot; reinsert in the correct slot and re-download HW Config
Diagnostic value 0x001A in TDC for a new connection Connection number conflicts with a DO connection at the same offset Use a connection number that is strictly greater than the maximum currently used on E7CM06
Compile warning "unconnected pin" on the new NOP_I The NOP_I was inserted but the input pin was not bound to a virtual connection Right-click the input pin and create the interconnection to E7CM06.xxxx
Existing references in other CFC charts return wrong data Adding the new module shifted the I/O byte map Recompile the full S7 program, not only the edited chart, and re-verify each reference

How do I choose the starting virtual connection number for a new AI card?

Run a global text search in the CFC for !E7CM06, record the highest existing number, and pick the next integer above it. For example, if the highest is 0050 the new channels start at 0051; if the highest is 0070 they start at 0071.

Do I have to define all 8 channels of a new SM 331 even if some are not wired?

Yes. The TDC requires every channel in the configured process image to be claimed by a virtual connection. The unused channels can be bound to NOP_I blocks; otherwise the station reports an address area length error after compile.

Why is the virtual connection name E7CM06 rather than the PROFIBUS address 6 directly?

The name is set on the CRR output of the CRV function block and is the project-wide handle for the slave. E7 identifies the TDC rack or PROFIBUS segment, CM is the coupling marker class, and 06 is the PROFIBUS slave address. The runtime resolves the name to the slave, not the other way around.

Can I upload the modified CFC from the TDC to the engineering station?

No. Uploading from the TDC is not supported for ET 200M virtual connections. Always keep an offline copy of the CFC and the HW Config in SIMATIC Manager; the engineering station is the only source of truth for the change.

What is the difference between I-type, DI-type, O-type, and DO-type virtual connections?

I-type reads an input (analog or digital) from the ET 200M, O-type writes an output, DI-type packs digital inputs into 4-byte blocks, and DO-type packs digital outputs. The SM 331 channels described here use I-type with 2 bytes per channel for a 16-bit value, while the SM 321 DI32 uses DI-type with 4 bytes per block.

Back to blog