S7-1200 T_SEND UDP: Configuring TUSEND and TADDR_Param
The SIMATIC S7-1200 CPU integrates a PROFINET port that supports both PROFINET IO and open Ethernet communication. Beyond the PROFINET side, the S7-1200 firmware exposes a set of standard instructions for open user communication: TSEND, TRCV, TCON, TDISCON, TUSEND, TURCV, and the compact variants T_SEND_C / T_RECV_C. The compact variants combine connection establishment, send/receive, and termination in single FBs; the discrete variants give the application full control over each step. This guide focuses on the recurring problem of configuring the UDP-aware TUSEND block: missing TADDR_Param UDT, optimized data-block errors, an undefined LEN pin, and the underlying TCON wiring that the LCom blocks depend on.
TADDR_Param is not visible in your project, the LCom library is not installed in the project library repository or the project was created in a TIA Portal version that does not include the UDT.1. Overview of S7-1200 Open User Communication
The S7-1200 PROFINET interface is a 10/100 Mbit/s port with auto-negotiation and auto-crossover. The firmware classifies every Ethernet service as one of:
- PROFINET IO (real-time, used for distributed I/O)
- S7 communication (PUT/GET for S7-S7 data exchange)
- Open user communication (TCP, ISO-on-TCP, UDP) — the layer that
TUSENDlives in - HMI / OPC UA / Web server (built-in services on firmware V4.0+)
For raw UDP datagram exchange, the S7-1200 firmware (V4.0 and later for the full UDP instruction set) supports up to 8 open user communications through the integrated PROFINET port. Each connection is identified by an ID in the range 1..0x0FFF (W#16#0001..W#16#0FFF) and is configured by a connection description UDT such as TCON_IP_V4 (V14+), TCON_ConfiguredConnection (legacy), or — for UDP specifically — the structured TADDR_Param used inside the application to describe the remote endpoint.
The S7-1200 open user communication model uses the classical ISO-on-TCP style of "connection" even for UDP. The firmware internally tracks a (local IP, local port, remote IP, remote port, connection ID) tuple and considers that tuple a "connection," although no TCP three-way handshake occurs. This is why a TCON call is still mandatory even when the application is sending raw datagrams.
2. T_SEND / TUSEND Block Identification and Selection
| Block | Library | Protocol | REQ Pin | LEN Pin | ADDR Pin Type |
|---|---|---|---|---|---|
| TSEND | Standard (built-in instructions) | TCP / ISO-on-TCP | BOOL — rising edge triggers send | UINT — number of bytes to send (1..8192) | P# ANY pointer or Variant |
| TRCV | Standard (built-in instructions) | TCP / ISO-on-TCP | BOOL — TRUE to enable reception | UINT — max bytes to receive | P# ANY pointer or Variant |
| TUSEND | LCom library (legacy / UDP) | UDP | BOOL — rising edge triggers send | UINT — payload length | Structured TADDR_Param UDT |
| TURCV | LCom library (legacy / UDP) | UDP | BOOL — enable | UINT — max length | Structured TADDR_Param UDT |
| T_SEND_C | Compact (built-in) | TCP / ISO-on-TCP / UDP (V4.4+) | REQ | Implicit from SD_1/SD_2 byte count | Variant |
| T_RECV_C | Compact (built-in) | TCP / ISO-on-TCP / UDP (V4.4+) | EN_R | Implicit | Variant |
The discrete TSEND/TRCV instructions use a low-level TCON/TDISCON model and a P#-style ANY pointer. The LCom TUSEND/TURCV blocks were authored for the S7-300/400 environment and use a structured TADDR_Param for the remote endpoint plus a separate TCON call to bind the local port. The compact T_SEND_C/T_RECV_C blocks were designed for the S7-1200 from the start and accept symbolic, optimized buffers via SD_1 / SD_2 / RD_1 Variant inputs.
Selection rule: pick T_SEND_C / T_RECV_C for new projects on firmware V4.4+. Pick TUSEND / TURCV only when maintaining a legacy S7-300/S7-400 LCom library port and the customer is constrained to the LCom block interface. Pick the discrete TSEND/TRCV/TCON when full control of the connection lifecycle is required (e.g., to share a port binding across multiple send calls).
3. Connection Limits and Supported Protocols
Per the official S7-1200 communication support entry, the CPU supports 8 connections for open user communications, active or passive, using T_SEND_C, T_RECV_C, TSEND, TRCV, TUSEND, and TURCV. This 8-connection budget is shared with:
- PROFINET IO controller/device connections (typically 1..3 per CPU)
- S7 communication (PUT/GET) — server connections defined in CPU properties
- HMI connections (variable, configured per HMI panel)
- TCP / UDP / ISO-on-TCP open user connections
Each resource consumes a portion of the same internal connection table. Exceeding the 8-connection limit returns STATUS = 0x8086 (no resources, no connection available) at TCON. The protocols supported by the integrated PROFINET port for open user communication are TCP, UDP, ISO-on-TCP, and ISO (for the compact blocks and S7 communication). Note that the protocol count is also tied to the CPU firmware version: UDP as a transport for TUSEND requires firmware V4.0 or later on the S7-1200 side; on older firmware the ConnectionType = B#16#13 (UDP) is rejected by TCON with STATUS 0x80A0.
4. Configuring TADDR_Param Data Type
TADDR_Param is a UDT (User-Defined Type) shipped with the LCom library and with the "SIMATIC S7-1200 Open User Communication" instruction set in TIA Portal V13 SP1 and later. The UDT structure is:
| Element | Type | Offset (bytes) | Meaning |
|---|---|---|---|
| RemIPaddr[1] | BYTE | 0 | Most significant octet of remote IPv4 address (e.g., 192 for 192.168.0.50) |
| RemIPaddr[2] | BYTE | 1 | Second octet (e.g., 168) |
| RemIPaddr[3] | BYTE | 2 | Third octet (e.g., 0) |
| RemIPaddr[4] | BYTE | 3 | Least significant octet (e.g., 50) |
| RemPort | UINT | 4..5 | Remote UDP port (1..65535, big-endian) |
| LocPort | UINT | 6..7 | Local UDP port to bind (0 = ephemeral assignment by the firmware) |
The IP address is encoded in network byte order (big-endian). For the address 192.168.0.50 the array must be set as {192, 168, 0, 50}. The two port fields are little-endian UINTs: a remote port of 2000 (decimal) is stored as 0x07D0 in low-byte / high-byte order, i.e., 0xD0 in the first byte and 0x07 in the second byte. A common commissioning bug is to set the port to 2000 but write it as WORD#16#2000 (8192 decimal) — confirm the byte order in the watch table.
If TADDR_Param is not visible when you open a global DB declaration, the LCom library is missing from the project. Add it through Project > Global libraries > Open library and load "LCom" from the default installation path, or create the UDT manually with the structure above. The UDT is then instantiated in a global DB and passed to the TUSEND / TURCV blocks as the ADDR parameter. The UDT DB must be a non-optimized DB (see Section 5) for the LCom blocks to interpret the offsets correctly.
For TIA Portal V11 SP2 — the version referenced in the original support case — TADDR_Param and the LCom library blocks TUSEND/TURCV are not part of the default installation. V11 SP2 only ships the discrete TSEND/TRCV/TCON instructions and the compact TSEND_C/TRCV_C. To use UDP on V11 SP2 you must either:
- Upgrade the project to TIA Portal V13 SP1 or later, or
- Manually install the LCom library and import
TUSEND/TURCV, or - Use the
TCONinstruction directly with aTCON_ConfiguredConnectionUDT (legacy) orTCON_IP_V4_PARAMUDT (V14+) and the discreteTSEND/TRCVinstructions withADDR= P# to a structured send area.
TSEND/TRCV when used with the S7-1200 standard instructions. However, TUSEND in the LCom library expects a structured TADDR_Param, not a P# pointer. Passing a P# to TUSEND causes STATUS = 0x8401 (data type mismatch) or 0x8402 (area length not permitted). The two blocks are not interchangeable at the ADDR pin.5. Optimized vs Non-Optimized Data Blocks
The standard TSEND/TRCV instructions and the LCom TUSEND/TURCV blocks were originally authored against the S7-300/400 memory model. On S7-1200, the default block attribute "Optimized block access" introduces symbolic-only addressing with non-deterministic byte offsets. TSEND/TRCV/TCON internally use absolute byte offsets resolved at compile time; symbolic-only optimized blocks break that resolution.
The fix:
- Open the global DB that holds the
TUSENDinstance data, theTADDR_ParamUDT instance, and the send/receive buffers. - Right-click the DB > Properties > Attributes > clear the "Optimized block access" checkbox.
- Confirm "Accessible from HMI / OPC UA / Web API" is enabled if an HMI needs to read tags inside that DB (optimized blocks were the default, but HMI access still requires symbolic access in TIA Portal V15.1+).
- Recompile the program. The DB now exposes the standard S7-300/400 address view; the blocks accept it.
For projects that must keep optimized blocks (because the rest of the program is symbolic), use the T_SEND_C / T_RECV_C compact instructions instead. The compact blocks were designed for the S7-1200 and accept symbolic, optimized buffers via the SD_1 and RD_1 (or RD_2) Variant inputs. The trade-off is loss of explicit TCON / TDISCON control over the connection lifecycle — the compact block does the TCON internally and reuses the connection across calls.
6. UDP Connection Configuration with TCON
Even when using the LCom TUSEND/TURCV, the underlying firmware still requires a TCON call to bind the local port and register the connection ID. A UDP "connection" in Siemens parlance is a logical binding of (local IP, local port, remote IP, remote port, ID) inside the firmware table, not a TCP three-way handshake.
Step-by-step TCON configuration for UDP on S7-1200:
- Open the
TCONinstruction instance DB (e.g.,iDB_TCON_UDP_1). - Set
REQ= TRUE to trigger connection establishment. - Wire
ID= W#16#0001 (or any unused value in the range 1..0x0FFF). EachTCONcall must use a unique ID. Reusing an ID that is already in use by another TCON, a PROFINET connection, or an S7 server returns STATUS 0x80A1 or 0x80C3. - Set
CONNECTto aTCON_ConfiguredConnection(legacy UDT 65) orTCON_IP_V4(V14+ UDT 73/74) instance with:
-InterfaceId= HW ID of the built-in PROFINET port (typically 64 decimal / 0x40 in TIA Portal V15.1+; check under Devices & networks > CPU > System constants for the actual HW ID)
-ID= same as the ID pin above
-ConnectionType= 19 (B#16#13 = UDP)
-ActiveEstablished= TRUE for a client that initiates the first datagram, FALSE for server-side binding (waiting for an incoming datagram)
-RemoteAddress= 192.168.0.50 (example — must be reachable on the same subnet as the PROFINET IP)
-RemotePort= 2000 (example)
-LocalPort= 2001 (example — or 0 for ephemeral assignment)
- Monitor
DONEandBUSYonTCON.STATUS= 0x0000 on success. - Once
DONE= TRUE, callTUSENDwith the same connection ID and the structuredTADDR_Paramas the ADDR input. - For bi-directional exchange, also call
TURCVwithEN_R= TRUE;TURCVfills its RD pin buffer with the next incoming datagram on the bound local port.
For TIA Portal V11 SP2, the TCON_ConfiguredConnection (UDT 65) and TCON_IP_V4_PARAM structures are reachable from the program editor's "Instructions > Communication > Open User Communication > Other" folder. Newer TIA Portal versions (V15.1 and later) replace the LCom-style UDTs with the TCON_IP_V4 UDT family and a more compact CONNECT input type.
TCON returns STATUS 0x80A7 after a hot restart, the connection table lost the local-port binding. Re-run TCON on the first OB1 scan after restart. This is not a fault — it is the normal firmware behavior.7. LEN Parameter and Data Length Handling
The LEN pin behavior differs between the standard TSEND instruction and the LCom TUSEND block:
| Instruction | LEN = 0 behavior | LEN > data size | LEN > 8192 behavior |
|---|---|---|---|
| TSEND (TCP) | STATUS = 0x8085 (LEN out of range) | STATUS = 0x8402 (area length error) | STATUS = 0x8085 |
| TSEND (ISO-on-TCP) | Same — 0x8085 | Same — 0x8402 | Same — 0x8085 |
| TUSEND (UDP, LCom) | Empty datagram sent; some stacks drop it | STATUS = 0x8085 on firmware < V4.2 | STATUS = 0x8085 |
| T_SEND_C | Implicit from SD_1/SD_2 byte count | Implicit — guard at the application level | Compiler error if SIZEOF > 8192 |
Set LEN to the number of bytes actually populated in the send buffer. Use SIZEOF on the symbolic tag if optimized access is enabled, or use a static constant when the buffer is a fixed-length ARRAY. Never tie LEN to a peripheral length (PEW/PAW) without a range check; doing so lets a process anomaly widen LEN beyond the buffer and force STATUS 0x8085.
For the discrete TSEND, the LEN input is a UINT and may take 1..8192. The TUSEND LCom block has the same UINT LEN range on firmware V4.2 and later. On firmware V4.0 and V4.1 the upper bound is 2048 for UDP; sending a larger buffer returns STATUS 0x8085. If the application needs UDP payloads above 2048 bytes, either upgrade the firmware to V4.2+ or fragment at the application layer.
8. TIA Portal Version Compatibility
The behavior of the open user communication instruction set has evolved across TIA Portal versions. The original support case mentions TIA Portal V11 SP2, which is well past its support window. The table below summarizes the relevant capability boundaries:
| TIA Portal | S7-1200 FW | TUSEND Available | TADDR_Param UDT | Optimized DB Support for T_SEND |
|---|---|---|---|---|
| V11 SP2 | V2.x / V3.0 | Only via separate LCom install | Not in default install | Not for TSEND/TRCV/TCON |
| V12 SP1 | V3.0 / V4.0 | Via LCom | Via LCom | Partial — TSEND_C supports optimized |
| V13 SP1 | V4.0 / V4.1 | Via LCom + SIMATIC NET | Built-in (UDT 74) | TSEND_C and T_SEND_C full |
| V14 SP1 | V4.2 | Built-in Open User Comm. palette | Built-in | Full |
| V15 / V15.1 / V16 / V17 | V4.3 / V4.4 / V4.5 / V4.6 | TCON_IP_V4 + TSEND / TUSEND | Built-in TCON_IP_V4 UDT | Full |
V11 SP2 is the version that produced the original issue. The cleanest path for a UDP project is to upgrade the project to TIA Portal V15.1 (or the current version) with firmware V4.4 or later on the S7-1200 CPU. The firmware upgrade is reversible only by Siemens service, so plan the upgrade during a maintenance window. Before upgrading, capture the program and PLC tag export — V11 SP2 projects must be migrated through the TIA Portal version-up wizard, which can fail on certain LCom block instances that have no successor in V14+.
9. Port and Protocol Reference
Per the S7-1200 communication protocols and ports reference, the following ports and protocols are active when UDP open user communication is in use:
| Protocol | Direction | Port | EtherType / Hex | Purpose |
|---|---|---|---|---|
| UDP | Inbound/Outbound | User-defined (LocPort / RemPort) | 0x0800 (IPv4) | TUSEND / TURCV payload |
| TCP | Inbound/Outbound | User-defined | 0x0800 (IPv4) | TSEND / TRCV payload |
| ISO-on-TCP (RFC1006) | Inbound/Outbound | User-defined | 0x0800 (IPv4) | S7-compatible TCP |
| ICMP | Inbound | — | 0x0800 | Diagnostic / control (ping) |
| MRP | Inbound/Outbound | — | — | Media Redundancy Protocol |
| DCP | Inbound/Outbound | — | — | Discovery & configuration (PROFINET) |
| LLDP | Inbound/Outbound | — | — | Link layer discovery |
| NTP | Outbound | 123 | 0x0800 | Time synchronization (when enabled) |
| SMTP | Outbound | 25 | 0x0800 | Programmatic email (when enabled) |
| SNMP | Inbound/Outbound | 161/162 | 0x0800 | Network management (when enabled) |
Reference: Communication protocols and ports used by Ethernet communication
The CPU firewall (enabled by default in firmware V4.4+) blocks inbound UDP packets whose destination port is not in the LocalPort list of an established TCON. If the remote test tool cannot reach the CPU, verify that the CPU's firewall setting is "Restricted" or that the LocalPort used by TUSEND is explicitly allowed in the firewall rules under CPU properties > Communication > Firewall.
10. Troubleshooting Matrix
| Symptom | STATUS / Error Code | Root Cause | Fix |
|---|---|---|---|
| TADDR_Param not in the data type drop-down | Compiler error (no runtime STATUS) | LCom library not installed in TIA Portal V11 SP2/V12 | Install LCom or upgrade to V15.1+ |
| Compiler error on TUSEND ADDR | Compiler error | Wrong data type — P# passed where UDT expected | Use TADDR_Param UDT instance, not a P# pointer |
| STATUS 0x8085 | 0x8085 | LEN = 0 or LEN exceeds buffer size or LEN > 8192 | Set LEN to actual payload byte count |
| STATUS 0x8086 | 0x8086 | All 8 open user connections in use | Free a connection, drop unused HMI/PROFINET connections |
| STATUS 0x80A0 | 0x80A0 | Connection type not supported by firmware | UDP requires firmware V4.0+; upgrade CPU |
| STATUS 0x80A1 | 0x80A1 | Connection ID already in use by another TCON | Use a unique ID per TCON call |
| STATUS 0x80A7 | 0x80A7 | Connection lost after hot restart | Re-run TCON on first scan after restart |
| STATUS 0x80C3 | 0x80C3 | Connection ID in use by another resource (e.g., PROFINET) | Use a separate ID; check CPU connection table |
| STATUS 0x8401 | 0x8401 | Data type mismatch on ADDR (e.g., optimized DB used with non-optimized-aware block) | Recreate DB with optimized access cleared |
| STATUS 0x8402 | 0x8402 | Area length not permitted | Match LEN to actual buffer size |
| STATUS 0x8600 | 0x8600 | Passive connection cannot be assigned (port already bound) | Use a different LocPort, or close the binding |
| No received data on TRCV/TURCV | NDR = 0, STATUS 0x80C0 | TCON was never called or did not complete | Call TCON first, wait for DONE |
| Datagram reaches CPU but no TUSEND completion | STATUS 0x0000, DONE = 0 | REQ pin not seeing a rising edge (held TRUE) | Edge-trigger TUSEND REQ with a one-shot |
| Wireshark shows datagram, remote end does not respond | — | CPU firewall blocked the inbound packet | Allow LocPort in firewall rules |
11. Verification and Commissioning Steps
- Compile the S7-1200 program; resolve any "Unknown data type" or "Instance DB not generated" errors.
- Download to the CPU. The CPU goes to RUN if no other fault blocks it. Check the CPU diagnostic buffer for SDO/communication errors before continuing.
- Open the watch table that contains the
TCONinstance, theTUSENDinstance, theTADDR_ParamUDT, and the send buffer. - Force
REQonTCONto TRUE; wait one scan.DONEshould be TRUE,STATUS= 0x0000. - Confirm
TCON'sCONNECT.ActiveEstablishedmatches your role (active = client initiating, passive = server waiting). - Use a separate UDP test tool (e.g., a packet capture with Wireshark filtered to the configured port, or a Python script with
socket.socket(AF_INET, SOCK_DGRAM)) to send a datagram to the CPU's local port. The CPU is reachable as its PROFINET IP address (default 192.168.0.1 for the first CPU, or whatever was set in CPU properties > Ethernet addresses). - Force
TUSENDREQ = TRUE; verify STATUS = 0x0000 (DONE = TRUE on the next scan). - Confirm the remote side received the datagram in Wireshark or the test tool. The datagram source port should match the LocPort from step 5, and the destination should match the RemPort from the
TADDR_ParamUDT. - Reverse the test: from the CPU, send to the test tool; confirm the tool received the datagram and the CPU's
TUSENDreturns DONE on the next call. - Stop forcing REQ and let the periodic OB1 call manage
TUSENDwith the rising edge of a dedicated trigger tag. Holding REQ = TRUE continuously will not cause multiple sends per scan — the FB itself is edge-triggered internally — but the cleaner pattern is to drive REQ from a one-shot (e.g., aP_TRIGinstance or a set/reset flag). - Log the STATUS word and the connection ID into a cyclic data log (CSV on the SD card, or push to a WinCC Unified tag) for first-week commissioning visibility.
12. Frequently Asked Questions
Why can't I see TADDR_Param in my S7-1200 project?
The TADDR_Param UDT is part of the LCom library (TIA Portal V11..V13) or the built-in Open User Communication instruction set (V13 SP1 and later). If you cannot find it, the library is not installed or the project was created in TIA Portal V11 SP2 without the LCom extension. Install the LCom library or upgrade the project to TIA Portal V15.1 or later with firmware V4.4+ on the CPU.
What is the difference between optimized and non-optimized data blocks for T_SEND?
Optimized blocks use symbolic-only addressing with non-deterministic byte offsets and are supported only by the S7-1200-native compact instructions (T_SEND_C, T_RECV_C). The discrete TSEND, TRCV, TCON, TUSEND, and TURCV blocks expect standard S7-300/400 absolute addressing. Clear the "Optimized block access" attribute in DB properties for any DB used as instance data, parameter storage, or send/receive buffer for those instructions.
How many UDP connections does the S7-1200 support?
Up to 8 open user communications (TCP, UDP, or ISO-on-TCP combined) are supported on the integrated PROFINET interface. The 8-connection budget is shared with PROFINET IO, HMI, and S7 communication resources, so the effective UDP-only ceiling may be lower. STATUS 0x8086 indicates the connection table is full. A CP 1243-1 communications processor can extend the budget by an additional 8 connections per module.
What LEN value should I set on T_SEND or TUSEND?
Set LEN to the exact number of bytes in the send buffer. LEN = 0 sends an empty datagram and is generally discarded by the remote stack. LEN greater than the buffer size returns STATUS 0x8085 (LEN out of range) on the discrete instructions. Use SIZEOF for symbolic, optimized buffers, or a static constant for fixed-length ARRAYs. The maximum LEN is 8192 for TCP/ISO-on-TCP and 2048 for UDP on firmware V4.0/V4.1; firmware V4.2+ allows 8192 for UDP as well.
Is TUSEND the same as TSEND on the S7-1200?
TSEND is the standard built-in instruction for TCP/ISO-on-TCP. TUSEND is the UDP-aware send instruction in the LCom library (or the Open User Communication instruction set in V13 SP1+) and uses a structured TADDR_Param ADDR input. They share the same scan-cycle semantics (REQ rising edge triggers, DONE/BUSY/ERROR/STATUS status output) but are not interchangeable at the data block level — the ADDR pin types differ.
What HW ID should I use for InterfaceId on TCON?
Use the HW ID of the CPU's PROFINET port. In TIA Portal V15.1+ it is found under Devices & networks > CPU > System constants and is typically 64 decimal (0x40) for the built-in port. For CPUs with a second PROFINET port (e.g., CPU 1215C, 1217C) the second port is 65 decimal (0x41). For a CP 1243-1 add-on module, use the HW ID of the CP's PROFINET port, not the CPU's. The HW ID must match the physical port the UDP traffic will traverse.