Problem Overview
An S7-1200 CPU 1212C (firmware V1.0.2) configured as a TCP server fails to maintain a connection with a PC client running LabVIEW. The exact same program—only the hardware configuration changed—runs correctly on a 1214C CPU (firmware V1.0). On the 1212C, the TCON block reports "connection established" (DONE = 1, STATUS = 0000) for a single OB1 scan, then resets all outputs and shows STATUS = 7002 on every subsequent scan. The PC client times out waiting for the first TSEND/TRCV handshake because the PLC never invokes the receive job.
This is one of the most frequently reported S7-1200 Ethernet communication faults: an intermittent, single-cycle "established" flag followed by a stuck 7002 state. The root cause is not network or PC-side configuration—those have already been validated against a known-working 1214C. The cause is a behavioral change in the open user communications instructions introduced in the V1.0.2 firmware line for the 1212C family.
Affected Hardware and Firmware
| CPU | Order Number (MLFB) | FW Version | TCON DONE Behavior | STATUS After 1 Cycle |
|---|---|---|---|---|
| CPU 1214C AC/DC/Rly | 6ES7214-1BE30-0XB0 | V1.0 | Latched (DONE=1) | 0000 (connected) |
| CPU 1212C AC/DC/Rly | 6ES7212-1BD30-0XB0 | V1.0.2 | One-cycle pulse | 7002 (job processing) |
| CPU 1212C DC/DC/DC | 6ES7212-1AD30-0XB0 | V1.0.2 | One-cycle pulse | 7002 (job processing) |
| CPU 1211C | 6ES7211-1AD30-0XB0 | V1.0.2+ | One-cycle pulse | 7002 (job processing) |
The behavior is consistent across the entire 12xC generation starting with firmware V1.0.2. Earlier firmware (V1.0) on 1214C retained the legacy "sticky" DONE bit pattern. Newer firmware retains the one-cycle pulse, which is correct per Siemens documentation, but it requires a different programming idiom.
Root Cause: TCON DONE Flag is Edge-Triggered in Firmware V1.0.2+
Starting with the V1.0.2 firmware release for the S7-1200, the TCON, TSEND, TRCV, and TDISCON instructions implement the standard PROFINET/PROFIBUS-style edge-triggered job semantics defined in the SIMATIC S7-1200 Programmable Controller System Manual. The DONE and ERROR outputs are pulsed for one OB1 cycle only; the actual connection state is no longer carried in DONE but in the internal connection DB pointed to by the CONNECT parameter.
A program written against the V1.0 firmware contract—where TCON.DONE stayed TRUE for the lifetime of the connection and TCON.STATUS = 0000 meant "connected and idle"—will appear to "lose the connection" on V1.0.2 hardware. In reality, the connection has been established correctly; the program is simply polling the wrong status bit.
Decoding the Status Word 7002
Status word 16#7002 on the open user communications instructions means "Job is currently being processed". It is not an error. The full pattern for TCON/TSEND/TRCV is:
| STATUS (Hex) | Meaning | Action Required |
|---|---|---|
| 0000 | Connection idle / no active job | Issue next send/receive or wait |
| 7001 | Job starting, not yet completed | Wait (transient) |
| 7002 | Job being processed / connection active | Do not re-trigger; poll for completion |
| 7003 | Job aborted during processing | Reset trigger and investigate error |
| 8085 | CONNECT parameter fault | Verify connection DB structure |
| 80A1 | Connection or port already in use | Check partner and local port |
| 80A3 | Connection attempt aborted | Verify peer reachable, firewall open |
| 80A7 | TCP connection lost (RST/FIN received) | Reconnect via TCON |
| 80B3 | Connection establishment error | Check IP/subnet on both ends |
| 80C3 | All connection resources in use | Reduce active connections (max 8 per CPU) |
| 80C4 | Temporary communication error | Auto-recoverable; retry |
When the CPU shows 7002 continuously on TCON, the connection is healthy and a job is in progress. A program that calls TSEND or TRCV while TCON is in 7002 will work correctly.
Required Program Structure
The correct V1.0.2+ program uses three boolean tags to capture the rising edges of the instruction outputs and to drive a state machine. This replaces the old "poll DONE" idiom.
Tag Declarations
VAR
// Edge flags
TCON_Done_Edge : BOOL; // Rising edge of TCON.DONE
TCON_Error_Edge : BOOL; // Rising edge of TCON.ERROR
TSEND_Done_Edge : BOOL;
TRCV_Done_Edge : BOOL;
// Connection state
ConnectionActive : BOOL; // Latched after first successful TCON
// Triggers
Start_TCON : BOOL;
TriggerSend : BOOL;
TriggerRcv : BOOL;
// LabVIEW interface
SendData : ARRAY[0..99] OF BYTE;
RcvData : ARRAY[0..99] OF BYTE;
END_VAR
OB1 Rung Structure
-
Rung 1 — TCON trigger: Set
Start_TCONonce in OB100 or via first-scan. CallTCON(block DB ID = 1, connection type = TCP, local port = 2000, remote = 192.168.0.241:6340). -
Rung 2 — TCON completion: Detect rising edge of
TCON.DONE; latchConnectionActive := TRUE. Detect rising edge ofTCON.ERROR; captureTCON.STATUSinto a diagnostics tag. -
Rung 3 — TRCV always ready: When
ConnectionActive = TRUE, callTRCV(LEN = 100, ADHOC = FALSE, DATA = RcvData). Latch receive trigger. -
Rung 4 — TSEND on request: When
TriggerSend = TRUE, callTSEND. Reset trigger on rising edge ofTSEND.DONE. -
Rung 5 — Reconnect on fault: If
TCON.STATUS = 16#80A7(connection lost), resetConnectionActiveand setStart_TCONto re-establish.
Step-by-Step Diagnostic Procedure
-
Verify the firmware version. In TIA Portal, go online to the CPU and read Online & Diagnostics → Diagnostics → CPU Information. Confirm 1212C shows
Firmware V1.0.2or higher. If you can only select "V1.0" in the device configuration, the project was originally created for the older 1214C and was never recompiled for 1212C. - Recompile the project against the 1212C hardware catalog. Add the 1212C as a new station or change the device in the project tree. TIA Portal will auto-resolve instruction differences. Download hardware and software to the PLC.
-
Remove the legacy "Wait for TCON.DONE" guard. Find any rung that conditions
TSENDorTRCVonTCON.DONE. Replace it with a latchedConnectionActivebit driven by the rising edge ofTCON.DONE. -
Re-arm TRCV on every completion. Confirm that the
EN_Rinput onTRCVremains TRUE throughout the cycle, and that a rising edge ofTRCV.DONEsimply copies the received buffer into your application tag and then re-arms the next receive. -
Watch table validation. Create a watch table with tags:
TCON.DONE,TCON.ERROR,TCON.STATUS,TSEND.DONE,TRCV.DONE,ConnectionActive. ForceStart_TCON := TRUEon the first scan (OB100), then observe —ConnectionActiveshould latch and remain TRUE. -
Wireshark validation. On the PC, run Wireshark on the Ethernet interface and filter on
tcp.port == 2000. You should see the three-way handshake (SYN → SYN-ACK → ACK) immediately on PLC startup, followed by periodic ACKs while idle. - LabVIEW client sanity check. Use the Siemens reference S7-1200 HyperTerminal TCP sample project with a free terminal emulator on the PC (e.g., Putty, raw socket) to prove the PLC side works before reintroducing LabVIEW. This isolates the PLC fault from any client-side timing issue.
LabVIEW Client-Side Considerations
LabVIEW's TCP Open Connection, TCP Write, and TCP Read VIs work fine with the S7-1200, but the following points prevent the most common cross-vendor timing issues:
-
Open as the TCP client. The PLC is the server on local port 2000. LabVIEW calls TCP Open Connection with
192.168.0.41:2000, not the other way around. -
Disable Nagle. On the TCP Open Connection VI, set the
delay-ackingcluster to 0 ms. Nagle's algorithm on Windows can delay small LabVIEW sends by up to 200 ms, which collides with the PLC's 100 ms internal cycle. -
Match read length to LEN. The PLC's
TRCVis configured withLEN = 100. Read exactly 100 bytes per call, or setLEN = 0(ad-hoc) and letTRCVuse the partner's send length. -
Reconnect logic. If the LabVIEW VI closes and reopens the socket, the PLC will see a FIN, return to
STATUS = 80A7, and require anotherTCONjob. Provide a handshake from LabVIEW: send one byte; wait for echo; if no echo within 2 s, retry the open.
Network Configuration Validation
| Parameter | PLC (1212C) | PC (LabVIEW) | Verification |
|---|---|---|---|
| IP address | 192.168.0.41 | 192.168.0.241 |
ping both directions |
| Subnet mask | 255.255.255.0 | 255.255.255.0 | Match required |
| Default gateway | 192.168.0.1 (or empty) | 192.168.0.1 | Optional |
| Local port (PLC) | 2000 | — | Not 0, 80, 102, 443, 502 |
| Remote port (PC) | — | 6340 | Outgoing ephemeral OK |
| Firewall | n/a | Allow port 2000 inbound/outbound | Disable Windows FW for test |
| Switch/router | Direct crossover or unmanaged switch | Same | No managed VLAN ACL |
Connection Resource Limits
The S7-1200 supports a maximum of 8 open user communications connections simultaneously across TCON, TSEND, TRCV, TMAIL, and TMOVE. The 1212C and 1211C share the same resource pool as the 1214C in this regard; the difference is firmware behavior, not resource count. Each active TSEND/TRCV pair consumes one connection ID. The connection DB is allocated when the project is compiled and downloaded.
If the project grows and you exhaust connections, TCON.STATUS = 80C3 ("all connection resources in use") will appear. Reduce the number of TSEND/TRCV blocks or move multi-peer traffic into a single multiplexed protocol.
Verification Procedure
- Download the rebuilt project to the 1212C. Perform a STOP → RUN transition.
- Open the watch table. Confirm
TCON.DONEpulses for one cycle, thenTCON.STATUS = 7002continuously whileConnectionActive = TRUE. - Launch Wireshark. Confirm the SYN/SYN-ACK/ACK handshake occurs once on startup and remains established.
- Launch the LabVIEW VI. Confirm data flow in both directions for at least 60 s.
- Pull the Ethernet cable from the PLC for 5 s, then reconnect. Confirm the PLC re-establishes the connection within 2 s and
STATUSreturns to7002. - Restart LabVIEW. Confirm the PLC logs
80A7briefly, then re-connects on the nextTCONjob.
Related Status Codes and Their Meaning
For the complete list of TCON/TSEND/TRCV status codes on S7-1200, refer to the SIMATIC S7-1200 Communication Function Manual. The most common field-encountered codes beyond those listed above are:
-
80A0— Active connection already exists on the same connection ID. -
80A4— IP address of the partner is invalid or unreachable on the subnet. -
80A9— Connection request rejected by partner. -
80B4— Interface not configured (PROFINET port disabled in device configuration). -
80B5— Partner did not respond to SYN within the timeout (default 5 s). -
80BB— Partner sent RST during handshake (port closed on partner). -
80C0— Connection cannot be established because the local port is in use by another TCON job.
Firmware Upgrade Path
If a deployment requires the legacy "DONE latched" behavior (for example, when porting older 1214C V1.0 code without rewriting the state machine), the V1.0.2 firmware does not include a compatibility bit to restore the old semantics. The recommended path is:
- Update the project to the latest TIA Portal version (V15 or later for 1212C support).
- Refactor the program to use the edge-triggered idiom described above.
- If the firmware on the 1212C is older than V2.0, consider a firmware update via the SIMATIC S7-1200 Firmware Update Tool to gain additional diagnostics and bug fixes for TCON behavior.
Preventive Checklist
- Document the CPU MLFB and firmware version in every project header comment.
- Use a watchdog timer on the LabVIEW side: if no data is received within 2 × the expected cycle, close and re-open the socket.
- Avoid conditional triggering of
TRCV; leave it armed continuously onceConnectionActiveis set. - Reserve a diagnostics DB to log every
TCON.STATUSandTSEND.STATUSnon-zero value with a timestamp fromRD_SYS_T. - Run TIA Portal "Online & Diagnostics → Compare Offline/Online" before every download to catch stale hardware configuration mismatches.
Why does TCON DONE only pulse for one cycle on S7-1200 firmware 1.0.2?
Starting with firmware V1.0.2, Siemens aligned the open user communications instructions with the standard PROFINET job-handling convention where DONE and ERROR are edge-triggered outputs pulsed for one OB1 cycle. The actual connection state lives in the internal connection DB, not in the DONE bit. Replace the "wait for DONE" pattern with a rising-edge detection that latches a ConnectionActive flag.
What does TCON STATUS 7002 mean on the S7-1200?
Status word 16#7002 means "job is currently being processed." On TCON, a continuous 7002 indicates an active, healthy connection. It is not an error. If you see 7002 with DONE = 0, the connection is established and waiting for a TSEND/TRCV job from your program.
How many TCP connections can an S7-1200 1212C support?
All S7-1200 CPUs support a maximum of 8 open user communications connections concurrently, including TCON, TSEND, TRCV, TMAIL, and TMOVE jobs. The 1212C has the same resource pool as the 1214C. Exceeding this limit returns TCON.STATUS = 80C3 ("all connection resources in use").
Do I need to upgrade TIA Portal to program the 1212C with firmware 1.0.2?
Yes. TIA Portal V10.5 SP2 supports the 1212C and its V1.0.2 firmware, but the device catalog entry must be the V1.0.2 variant. Projects originally created against the 1214C V1.0 catalog must be re-targeted. Newer TIA Portal versions (V13 SP1 and later) provide additional diagnostic flags and improved error reporting for the same instructions.
Can the 1212C connect to a LabVIEW TCP client without any additional hardware?
Yes. The S7-1200 PROFINET port is a standard 100 Mbit/s Ethernet interface and speaks raw TCP/IP via TCON/TSEND/TRCV. No additional CP module is required. Use a standard Cat5e or Cat6 cable between the PLC and the PC, or connect both to an unmanaged switch. Ensure the subnet mask and IP range are consistent, and that the Windows firewall on the PC allows inbound traffic on the chosen local port.