Configuring TCP/IP Communication Between Simotion D425 and S7-1200
The Simotion D425 is a compact motion controller in the Simotion D family that integrates a SINAMICS drive and a Simotion controller on a single hardware platform. Connecting it to a Simatic S7-1200 over Ethernet is required when the motion axis and the line PLC must exchange process data: HMI tag values, setpoints, status words, diagnostics, recipes, and axis commands. The D425 supports PROFINET on its integrated PN interface, which means three practical paths exist for S7-1200 ↔ D425 data exchange: classic TCP/IP using the SIMOTION communication blocks and S7-1200 T-blocks, PROFINET I-device coupling, and the SIMOTION easyProject generator utility that auto-generates the call interface.
This reference covers all three paths with port numbers, block parameters, hardware prerequisites, and a verification procedure. The advice is sized for the kind of payload called out in the original scope: approximately 500 REAL inputs to the drive and 300 REAL outputs out of the drive, plus BOOL, INT and DINT words for control and status.
Communication Path Comparison
Before writing any code, decide which transport best matches the application. Each path uses the same physical PROFINET/Industrial Ethernet port on the D425 but a different layer-7 protocol.
| Path | Protocol | Configuration Tool | Best Use | Cyclic Data Volume |
|---|---|---|---|---|
| T-blocks on S7-1200 + SIMOTION communication blocks | Standard TCP/IP (RFC 793) | TIA Portal (S7-1200 side) + SCOUT (Simotion side) | Large one-shot payloads, diagnostics dumps, non-real-time data | Up to 8192 bytes per send/receive job |
| PROFINET I-device | PROFINET IO (RT) | SCOUT + TIA Portal (HW catalog) | Cyclic, deterministic process data (WORD/DWORD) | Up to 1024 bytes slot-based per AR |
| SIMOTION easyProject | TCP/IP (auto-generated) | ProjectGenerator (SCOUT Utilities & Applications DVD) | Fast commissioning, libraries on both sides | Up to 4000 bytes per direction |
Hardware and Software Prerequisites
- Simotion D425 with PN interface. The MLFB must include the integrated PROFINET port (typically 6AU1425-xAx0x-xAB0 or similar). Confirm the PN port exists on the front X150 interface before commissioning.
- Simatic S7-1200 CPU with PN interface. Any CPU of firmware V4.0 or higher that ships with the PROFINET device interface (CPU 1211C/1212C/1214C/1215C/1217C with PN). CPU 1211C without PN cannot be used.
- SCOUT TIA or SCOUT V5.x with the matching Simotion firmware add-on. SCOUT must know the D425 target firmware version.
- TIA Portal V15.1 or higher on the engineering station to program the S7-1200.
- SIMOTION Utilities & Applications DVD or the corresponding download package. This DVD contains the ProjectGenerator (SIMOTION easyProject) and the standard SIMOTION communication blocks.
- Managed Industrial Ethernet switch (e.g. Scalance XC-200) for the simplest topology. Direct crossover is not supported on PROFINET-conformant ports.
Ethernet Port Reference
The following table lists the ports that are opened by the S7-1200 for the protocols discussed here. Confirm against the official Siemens S7-1200 manual collection when firewall rules are required.
| Port | Protocol | Direction | Used By |
|---|---|---|---|
| 102 | PROFINET IO / DCP | Inbound/Outbound | I-device and PROFINET IO AR |
| 161 / 162 | SNMP | UDP | Diagnostics and topology discovery |
| 34964 | PN-DCP / HSNP | UDP | PROFINET discovery |
| 2000-2004 | S7 communication (PUT/GET) | TCP | No usage on D425; reserved for S7-1200/300/400 partners |
| 49152-65535 | TSEND_C / TRCV_C | TCP | Open connection ID range for T-blocks |
Source: Communication protocols and ports used by Ethernet communication (S7-1200 Manual Collection).
Path 1 — TCP/IP Using SIMOTION Communication Blocks and S7-1200 T-Blocks
This is the most flexible path and the one that survives firmware mismatches between the D425 and the S7-1200. SCOUT installs a library called SIMOTION Communication Blocks with FB calls such as _TCP_send, _TCP_receive, _TCP_open and _TCP_close. The S7-1200 uses TSEND_C and TRCV_C from the standard instruction palette.
Step-by-Step: Simotion D425 Side in SCOUT
- Open the SCOUT project and navigate to the D425 target. Open the program source (ST or MCC) where the communication will run.
- Insert the SIMOTION communication blocks. The relevant block family is documented in the SIMOTION Communication Programming Manual: SIMOTION Communication Blocks – Manuals.
- Declare one connection handle. Open a passive TCP server socket on the D425 so the S7-1200 can act as active partner:
// ST source on the D425 VAR hConn : _tcp_connection_id; sHost : STRING[15] := '192.168.0.20'; // D425 own IP iPort : UINT := 2500; abort : BOOL; END_VAR _TCP_open( hConn := hConn, iMode := _TCP_MODE_PASSIVE, sHost := sHost, iPort := iPort, bExecute := TRUE, iTimeout := 5000 ); - Pack the 500 incoming REALs and the 300 outgoing REALs into two separate send/receive buffers. Use
_TCP_sendand_TCP_receivewith a buffer length of 4 × 500 = 2000 bytes inbound and 4 × 300 = 1200 bytes outbound. Pad BOOL, INT and DINT words at 16-bit or 32-bit boundaries; do not mix endianness mid-frame. - After commissioning, watch the
stateoutput of_TCP_open.STATE_CONNECTED = 4means the link is live.
Step-by-Step: S7-1200 Side in TIA Portal
- Open the S7-1200 device configuration in TIA Portal. Confirm the IP address, subnet mask and that the PROFINET interface is online (LED green = link + activity).
- From Instructions > Communication > Open User Communication, drag
TSEND_CandTRCV_Cinto an OB (typically OB1). - Configure
TSEND_Cparameters:Parameter Value REQ BOOL — toggles on transmit trigger ID WORD — connection ID, e.g. 16#0001 LADDR WORD — local port, leave blank when using ID-only mode CONNECT TCON_IP_V4 structure with partner IP 192.168.0.20 (D425) and remote port 2500 DATA P#DBx.DBX0.0 BYTE 1200 (REAL block reading 300 floats) LEN UINT = 1200 DONE / BUSY / ERROR / STATUS Drive standard error handling (see STATUS table below) - Configure
TRCV_Cin the same OB. Point its LEN to2000to match the inbound payload. - Use
TCON(notTSEND_Calone) if you want to separate the connection setup from data transfer.TSEND_Cinternally callsTCONon first REQ and tears down on rising edge ofREQ=FALSE.
Buffer Layout Convention
To keep both sides in lockstep, fix the byte layout in advance. The convention below packs 800 REALs, 64 Bools and 32 DINTs in a single 3264-byte frame:
| Offset | Type | Count | Size (bytes) | Description |
|---|---|---|---|---|
| 0 | REAL | 500 | 2000 | PLC → Drive setpoints |
| 2000 | REAL | 300 | 1200 | Drive → PLC actuals |
| 3200 | DINT | 32 | 128 | Process counters |
| 3328 | BOOL | 64 | 8 (word-padded) | Status flags |
| 3336 | INT | 256 | 512 | Auxiliary data |
| 3848 | Total frame length | 4096 | ||
Align DINT and BOOL blocks on 4-byte boundaries even if the natural size is smaller; this avoids unaligned access faults on the Simotion runtime.
Path 2 — PROFINET I-Device Coupling
The I-device function turns the Simotion D425 into a PROFINET IO device that exposes a vendor-defined slot structure. The S7-1200 then becomes the IO controller and reads/writes those slots cyclically. This path is deterministic and needs no TCP scripting — the only configuration work is in the device description and the slot mapping.
I-Device Activation in SCOUT
- In the SCOUT project properties of the D425, open PROFINET interface > I-Device configuration.
- Select Operate as I-device. The D425 will not start a PROFINET AR on its own in this mode.
- Add slots for the I-device. Typical slot definitions:
- Slot 1: 64 WORD input / 32 WORD output — control / status
- Slot 2: 128 REAL inputs / 64 REAL outputs — process data
- Slot 3: PROFIsafe (optional, only with F-CPU on the S7-1200 side)
- Export the GSDML file: PROFINET > Export GSDML. Save the resulting .xml to a known folder.
S7-1200 Side in TIA Portal
- Open the S7-1200 device configuration. Right-click the PROFINET interface and choose Add GSD device. Point at the GSDML exported above.
- Drag the D425 I-device from the catalog into the network view and assign it to the S7-1200 PROFINET controller.
- Open the slot configuration of the assigned D425. Tick each slot the S7-1200 should populate. The HW catalog shows the start address on the S7-1200 CPU (e.g. IW 64, QW 96).
- Compile and download. Verify that no PROFINET diagnostic interrupt is pending: the controller-side PROFINET error LED must stay dark.
Path 3 — SIMOTION easyProject Generator
The ProjectGenerator on the SIMOTION Utilities & Applications DVD is a wizard that emits a fully wired SCOUT program on the D425 side and a matching TIA Portal library on the S7-1200 side. The generator targets the same TCP transport as Path 1 but pre-fills all the block parameters, buffer offsets and connection IDs.
- Install the SIMOTION Utilities & Applications DVD (or extract the equivalent download package).
- Launch ProjectGenerator > SIMOTION easyProject from the Windows start menu.
- Select the D425 MLFB. Wizard pages then ask for the data layout in a tabular form — enter the number of REAL, BOOL, INT and DINT tags.
- Choose TCP/IP via PROFINET interface as the transport.
- Click Generate. The wizard writes a complete SCOUT source plus a TIA Portal V14+ library with pre-wired DBs.
- Import the library into TIA Portal (Options > Global libraries > Open library) and call the resulting FB from OB1.
This path collapses the commissioning time from hours to minutes for engineers who do not need custom frame layouts. The drawback is that the generated code is opaque; debugging requires inspecting the generated FBs.
LCom — The Lightweight TCP Library
LCom is the older, slimmed-down TCP communication library for Simotion. It predates the unified SIMOTION communication block set but is still maintained in field. LCom functions are:
-
LCom_open,LCom_close -
LCom_sendData,LCom_receiveData LCom_getConnectionState
Use LCom when the D425 project already imports LCom and you cannot add the newer SIMOTION block set due to firmware constraints. Configuration-wise LCom behaves like Path 1: the S7-1200 still uses TSEND_C / TRCV_C and a plain TCP connection. The LCom calling convention is documented in the Simotion Communication Programming Manual referenced above.
S7-1200 T-Block STATUS Codes
When TSEND_C or TRCV_C sets ERROR=TRUE, inspect STATUS. The most common values from TIA Portal V15 onward:
| STATUS (hex) | Meaning | Corrective Action |
|---|---|---|
| 16#0000 | No error | — |
| 16#7000 | Function idle, no REQ yet | Check call enable |
| 16#7001 | First call after REQ — connection setup | Wait |
| 16#7002 | Connection setup in progress | Wait |
| 16#8085 | LEN > LEN of DATA reference | Realign buffer length |
| 16#8086 | CONNECT parameter invalid | Check TCON_IP_V4 partner address and port |
| 16#80A1 | Connection aborted by partner (RST received) | Inspect D425 log; restart the Simotion program |
| 16#80B5 | Passive partner did not enable port | Verify _TCP_open and that the D425 is reachable by ping |
| 16#80C3 | Temporary resource shortage | Increase the connection resource count in the S7-1200 hardware config |
| 16#80C4 | Internal communication error | Rebuild the project; check firmware compatibility |
Verification Procedure
- Layer-1 link check. PROFINET port LEDs on both devices must be solid green. If not, swap cables or the switch.
- Layer-3 ping. From TIA Portal: Online > Accessible devices should list both the S7-1200 and the D425. A successful ping confirms IP/subnet correctness.
-
Connection state. On the D425, monitor the
stateoutput of_TCP_open. A value of 4 confirms a TCP session. On the S7-1200, watchTSEND_C.DONEandTRCV_C.NDR. - Round-trip tag check. Write a known REAL value to the first PLC → drive setpoint slot and read back the echoed value at the first drive → PLC actuals offset. Compare against the expected value.
- Heartbeat. Add a 1-second-incrementing counter in the S7-1200 send buffer and read it back at a different offset on receive. A ticking value on the receive side proves liveness.
- Load test. Run at minimum update period (10 ms on the D425 side) for 30 minutes and look for STATUS = 16#80A1 retriggers. Zero retriggers is acceptable; more than one per minute indicates switch congestion or buffer underrun.
Troubleshooting Matrix
| Symptom | Likely Root Cause | Fix |
|---|---|---|
| TSEND_C.ERROR with 16#80B5 | D425 passive TCP not yet open | Confirm Simotion program is running and _TCP_open completed |
| TSEND_C.ERROR with 16#80A1 after minutes of OK | Watchdog on D425 closed the socket | Increase the keep-alive interval; check Simotion task priorities |
| TCON.DONE never sets | Firewalled port or wrong IP | Disable Windows Firewall on engineering station during test; verify routing |
| I-device stays in diagnostic state "station failure" | GSDML mismatch or wrong slot ticked | Re-export the GSDML and reinstall the device |
| Receive buffer always zero | LEN > receive pointer size or wrong data block | Verify P# pointer in TRCV_C points to a DB with sufficient length |
| Real values garbage | Endian mismatch between Simotion (big-endian float) and S7-1200 (little-endian) | Swap byte pairs on Simotion side or use TAW/TAW instructions in TIA Portal |
| PROFINET alarms (red dot) on slot | Slot exceeds max slot size | Reduce slot count or upgrade D425 firmware |
| ProjectGenerator runs but library not visible in TIA Portal | TIA Portal version not matching generator output | Run the generator for the exact TIA Portal version installed |
Performance and Sizing Notes
The 800-REAL payload (3264 bytes) plus handshaking fits comfortably inside the D425's real-time Ethernet bandwidth. Expect a 2-4 ms round-trip latency on a 100 Mbit/s switched network when using T-blocks end-to-end. If the latency budget is under 1 ms, switch to PROFINET I-device and use the 1 ms update time setting.
Connection count limits: the S7-1200 CPU supports up to 8 simultaneous TSEND_C/TRCV_C pairs (firmware V4.4 or higher). The D425 supports up to 32 simultaneous TCP connections in its communication profile. Plan headroom for HMI panels and OPC UA servers that also need to talk to the same D425.
Comparison Summary: Which Path to Choose
- Pick PROFINET I-device when the S7-1200 needs to own the D425 as a process-data device with deterministic update times. Best fit for line control and motion interlocks.
- Pick T-blocks + SIMOTION blocks when the data is event-driven, large, or only occasionally read. Best fit for diagnostics, recipes, parameter sets.
- Pick SIMOTION easyProject when commissioning time is at a premium and the data layout is reasonably standard. The wizard outputs a complete, testable stack.
- Pick LCom only when the D425 firmware pins the project to the legacy communication library.
FAQ
Which TCP port should the S7-1200 use to talk to the Simotion D425?
Pick any free port above 2000, for example 2500, and configure it identically on the S7-1200 TCON_IP_V4 structure and on the D425 _TCP_open call. Standard PROFINET port 102 is reserved for I/O ARs and should not be reused for application TCP traffic.
Can the S7-1200 be the passive TCP partner instead of the D425?
Yes. Either side can act as server. In practice the D425 is almost always configured passive (_TCP_MODE_PASSIVE) because that way the S7-1200's TSEND_C controls the connection establishment and retries, which simplifies connection-error handling on the PLC side.
How many bytes of cyclic PROFINET data can the D425 I-device expose?
The D425 I-device depends on firmware. Firmware V4.4 SP1 and higher supports up to 1024 bytes of cyclic IO data per AR (input + output). Older firmware versions cap at 256 bytes per direction. Always verify against the firmware release notes before designing the slot table.
What is the smallest practical PROFINET update time between a D425 and an S7-1200?
1 ms is the practical floor. The S7-1200 PROFINET interface supports update times of 1 ms in RT mode. Going below 1 ms requires IRT and the D425 does not act as IRT controller.
Where can I download the SIMOTION easyProject generator?
It is included on the SIMOTION Utilities & Applications DVD. The same package is also published in the Siemens support download area under the Simotion entry. Confirm the generator version matches the SCOUT version installed.