Overview
The TCON instruction establishes TCP/UDP/ISO-on-TCP connections on S7-1200 and S7-1500 CPUs. When a user program calls TCON and the instruction returns status word 16#8602, the CPU has accepted the connection setup request but the partner specified in the connection description does not match the partner that is actually requesting or has established the connection. This is a partner-validation error, not a network-layer failure, and is one of the most common TCON faults on CPU 1214FC, CPU 1215C, and related firmware families.
This reference covers the exact meaning of 16#8602, distinguishes it from related codes (16#80A4, 16#80C3, 16#80B3), walks through the Instance DB (IDB) parameters that govern partner validation, and provides a verified commissioning procedure for both active and passive connection roles. The procedures apply to firmware V4.2 through V4.6 of the S7-1200 family; see the official TIA Portal reference for TCON, TDISCON, TSEND, TRCV.
STATUS output of the TCON instruction. It is logged by the CPU and viewable in the online diagnostic buffer. It is not a fatal PLC stop; the application must handle the return code and decide whether to retry, re-initialize the IDB, or fault the machine.Problem Details
Symptom: A program in OB1 (or another cyclic OB) calls TCON with REQ = TRUE to bring up an Open User Communication (OUC) connection. The instruction completes after one scan, but the DONE bit is FALSE, BUSY is FALSE, ERROR is TRUE, and the STATUS word reads 16#8602. Toggling the input that drives REQ repeatedly produces the same result. No connection is established on the configured interface, and the partner device either never sees a SYN/ACK or sees a RST after the handshake.
Affected platforms and firmware:
- CPU 1211C, CPU 1212C, CPU 1214C, CPU 1214FC, CPU 1215C, CPU 1215FC, CPU 1217C
- Firmware V4.0, V4.1, V4.2, V4.3, V4.4, V4.5, V4.6, V4.7
- S7-1500 CPUs share the same TCON instruction semantics; the same partner-validation rules apply
- ET 200SP CPUs (CPU 1510SP, CPU 1512SP, CPU 1515SP) behave identically
Companion symptoms that often co-occur:
-
STATUS= 16#80A4 immediately after the first failing call when the connection is in passive role and the CPU's local end is already engaged -
STATUS= 16#80C3 when too many OUC connections are configured for the CPU's connection resources (S7-1200: max 8 OUC; S7-1211C: max 4) -
STATUS= 16#80B3 if a firewall or unmanaged switch drops the SYN
Root Cause
Per the TIA Portal reference for TCON, TDISCON, TSEND, and TRCV, status 16#8602 means: "Validation of the remote partner failed. The remote partner that wants to establish the connection does not match the defined partner of the structure."
Internally, the CPU compares the partner's IP address and (for ISO-on-TCP) the TSAP against the values stored in the TCON_IDB. The comparison is exact — IP, port, and TSAP (where applicable) must all match. If any one of these three elements differs, the CPU rejects the connection and writes 16#8602 to the STATUS output. The CPU also writes an entry to the diagnostic buffer of the form:
Connection to partner [IP]:[port] failed; reason: partner address does not match configured connection description
The three parameter mismatches that produce 16#8602 are:
-
IP address mismatch — The IP configured in
TCON_IDB.PARAMS.LocalPartner[].RemoteAddress(or the equivalentConnectionwizard parameter) does not match the actual IP of the device that is calling or accepting the connection. - Port mismatch (TCP/UDP) — The configured remote port differs from the port on which the partner is listening. This applies only to the active role; the local port is set by the CPU and is not validated by the partner.
- TSAP mismatch (ISO-on-TCP) — For protocol = ISO-on-TCP, the local TSAP and remote TSAP must both match. Mismatches here are common when the partner is a third-party device or a non-Siemens PLC.
Unlike 16#80A4 (which is informational and means "the local end is already a passive participant on this connection"), 16#8602 is a hard validation failure that requires a parameter correction, not a retry.
TCON Status Word Reference
The following table maps the relevant TCON status codes for Open User Communication on S7-1200/S7-1500. Codes in the 16#80xx range are extended error codes; 16#86xx codes carry the meaning in the rightmost byte.
| STATUS (hex) | Meaning | Action |
|---|---|---|
| 16#0000 | Connection terminated, no error | Normal teardown |
| 16#7000 | No call active, no job pending | Initial state |
| 16#7001 | First call, job started, BUSY=1 | Continue polling |
| 16#7002 | Follow-up call, job in progress | Continue polling |
| 16#8600 | Connection successfully established | DONE=TRUE on this or next call |
| 16#8601 | Connection already exists, request ignored | Idempotent; no action needed |
| 16#8602 | Partner validation failed (IP/port/TSAP mismatch) | Correct IDB parameters, rebuild, retry |
| 16#8603 | Connection attempt initiated by partner rejected | Local CPU rejected SYN; check role/passive settings |
| 16#80A4 | Connection ID already in use, passive end engaged | Informational; verify connection table |
| 16#80A7 | TCP connection interrupted by network failure | Check cabling, switch, partner state |
| 16#80B3 | Connection attempt failed at TCP level | Verify partner reachable (ping, ARP) |
| 16#80C0 | Local resource error: ID invalid or in use | Verify IDB, connection ID uniqueness |
| 16#80C3 | Connection resources exhausted | Reduce OUC count or upgrade CPU |
| 16#80C4 | Connection terminated because of error | Inspect partner for fault |
TCON IDB Parameter Inspection
The TCON instruction reads its connection description from an associated Instance DB. The structure name varies by firmware; in V4.x it is typically TCON_v4 with the following fields controlling partner validation:
| Field | Type | Validation role |
|---|---|---|
| PARAMS.LocalInterface.Address | IP_V4 (octets) | Local CPU IP (informational, not validated against partner) |
| PARAMS.LocalInterface.Port | UINT | Local port (TCP/UDP); not validated by partner |
| PARAMS.LocalInterface.TSAP | BYTE[8] | Local TSAP (ISO-on-TCP); must match partner's remote TSAP |
| PARAMS.LocalPartner[].Address | IP_V4 (octets) | Expected partner IP — must match |
| PARAMS.LocalPartner[].Port | UINT | Expected partner port (TCP/UDP) — must match |
| PARAMS.LocalPartner[].TSAP | BYTE[8] | Expected partner TSAP (ISO-on-TCP) — must match |
| PARAMS.ConnectionType | BYTE | 0x0B = TCP, 0x0C = ISO-on-TCP, 0x0D = UDP |
| PARAMS.ActiveEstablishment | BOOL | TRUE = CPU initiates SYN; FALSE = CPU accepts |
| ID | WORD | Connection identifier (1..64 on S7-1500; 1..8 on S7-1200) |
When the connection is in passive role (ActiveEstablishment = FALSE), the partner's SYN is checked against LocalPartner[].Address and (for ISO-on-TCP) the TSAP. If the partner's IP is in a different subnet than the local CPU interface, the SYN is rejected at the IP layer and a different error (16#80B3 or 16#80A4) is returned. The 16#8602 case requires the SYN to reach the CPU, which means subnet and IP-stack checks already passed, leaving partner-identity mismatch as the only valid interpretation.
Prerequisites for the Fix
- Know the exact IP address and listening port of the partner device. For ISO-on-TCP, know the partner's TSAP (hex string of up to 16 ASCII characters or 8 bytes, often expressed as
TSAP_LENGTH.TSAP_IDin TIA, e.g.02.47.45= "GE" on slot 2). - Have the TIA Portal project that contains the S7-1200 program, with write access to the offline project.
- Online connection to the CPU (Ethernet, PROFIBUS, or TeleService) for download and diagnostic buffer inspection.
- For ISO-on-TCP, the partner's TSAP must be known; guessing is the most common cause of 16#8602 with third-party devices.
- Confirm the CPU has free OUC connection resources. S7-1211C: 4 total; S7-1212C: 4; S7-1214C/FC: 8; S7-1215C/FC: 8; S7-1217C: 8.
Step-by-Step Resolution
Step 1 — Capture the Online IDB
Go online with the CPU in TIA Portal. Open the TCON instance DB and compare the online values of PARAMS.LocalPartner[].Address, Port, and TSAP against the partner device. The online view is the authoritative value — what the firmware is actually validating against. Offline edits that have not been downloaded can mask the true configuration.
Step 2 — Cross-Verify the Partner Identity
From a maintenance laptop on the same subnet, run:
arp -a
Confirm the partner's IP is bound to the expected MAC. Then:
ping <partner_ip>
Loss is acceptable for a verification, but the ARP entry must populate. If ARP does not populate, fix the L2 path first; a 16#8602 with no ARP entry is a network problem, not a TCON problem.
Step 3 — Correct the Connection Description
In the offline project, open the TCON call and click Configuration to launch the connection wizard (or edit the IDB PARAMS structure directly). Set:
- Partner IP: the exact IP from Step 2.
- Partner port: the exact port the partner is listening on. For ISO-on-TCP, leave blank; TSAP is used instead.
-
Partner TSAP (ISO-on-TCP only): the exact TSAP configured on the partner device. TSAPs are case-sensitive ASCII encoded into hex;
"GE"=0x47 0x45, not0x47 0x65. - Connection type: TCP (0x0B), ISO-on-TCP (0x0C), or UDP (0x0D). Mismatching the protocol type will not produce 16#8602 directly but will produce 16#80C2 ("connection type and TSAP inconsistent") and is a related fault to rule out.
Step 4 — Re-Download and Re-Initialize
Download the project to the CPU. The TCON instance DB is re-initialized by the firmware on download. After download, execute the TCON call once with REQ = TRUE from a watch table or from OB1. Observe STATUS.
Step 5 — Distinguish 16#8602 from 16#80A4
After download, the first TCON call on a previously-failing IDB can transiently return 16#80A4 rather than 16#8602. This is informational and means the CPU's passive end of the connection table is briefly occupied during re-initialization. The second call returns 16#8600 (success) or 16#8602 (persistent failure). Do not treat 16#80A4 on the first call as the same fault — only treat 16#8602 on the second or third call as the persistent validation failure.
Step 6 — Active vs Passive Role Check
If the CPU is the active end (ActiveEstablishment = TRUE), the CPU initiates the SYN. The partner IP and port must be reachable. If the CPU is the passive end, the partner initiates. In passive mode, the IP/port validation is still performed; setting the partner to 0.0.0.0 or 255.255.255.255 in older firmware is not a valid wildcard. TIA Portal V16+ supports a partner wildcard in passive mode by leaving the IP/port blank in the connection wizard, but the legacy IDB still requires a real partner address.
Programming Example: Safe TCON Handler
Use a state machine in OB1 to handle the 16#8602 return cleanly. The snippet below uses symbolic names; replace iDB_TCON with the actual instance DB name.
// State machine for TCON with 16#8602 recovery
CASE #eState OF
STATE_IDLE:
#iDB_TCON.REQ := FALSE;
IF #xConnectCmd THEN
#eState := STATE_CONNECT;
END_IF;
STATE_CONNECT:
#iDB_TCON.REQ := TRUE;
#iDB_TCON.ID := 1; // connection ID
#iDB_TCON.CONNECT := TRUE; // legacy alias
TCON_DB := #iDB_TCON;
IF #iDB_TCON.DONE AND #iDB_TCON.STATUS = 16#0000 THEN
#eState := STATE_RUN;
ELSIF #iDB_TCON.ERROR THEN
IF #iDB_TCON.STATUS = 16#8602 THEN
// Partner validation failed; reload IDB from setpoints
#iDB_TCON.PARAMS.LocalPartner[0].Address := #cfgPartnerIP;
#iDB_TCON.PARAMS.LocalPartner[0].Port := #cfgPartnerPort;
#eState := STATE_RECOVER;
ELSIF #iDB_TCON.STATUS = 16#80A4 THEN
// First-call transient; do not flag as fault
#eState := STATE_RUN;
ELSE
#eState := STATE_FAULT;
END_IF;
END_IF;
STATE_RECOVER:
// Backoff and retry once with corrected IDB
#iTimeout(IN := TRUE, PT := T#2s);
IF #iTimeout.Q THEN
#iTimeout(IN := FALSE);
#eState := STATE_CONNECT;
END_IF;
STATE_RUN:
// Connection up; handle TSEND/TRCV
;
STATE_FAULT:
; // HMI alarm
END_CASE;
Verification
- In TIA Portal online view, force the
REQbit of the TCON instance DB toTRUE. WatchSTATUSin the same monitor window. - Expected:
STATUS = 16#0000(withDONE = TRUE) on the first successful call, or16#80A4on the very first call after download followed by16#0000on the second. - Open the CPU's diagnostic buffer (Online & Diagnostics > Diagnostic buffer). There should be no new entries of class Communication error for the OUC connection.
- Send a test frame with
TSENDfrom the CPU and confirm the partner receives it; receive withTRCVand confirmDATAis non-zero length. - Use a packet capture (Wireshark with port mirroring on the switch) to confirm the TCP handshake completes with
SYN, SYN-ACK, ACKand noRST. ARSTafter theSYN-ACKfrom the CPU means the CPU itself is rejecting — that is a 16#8602 condition despite the connection having reached TCP state.
Edge Cases and Field-Proven Caveats
Sub-second retransmits amplify the error. If a faulty application toggles REQ at 10 ms cadence while 16#8602 is active, the CPU can exhaust its OUC connection resources within seconds, and the next TCON call returns 16#80C3 ("connection resources exhausted"). Always gate REQ with a state machine and an explicit backoff.
ISO-on-TCP TSAPs are case-sensitive. The TSAP is not a string; it is a byte sequence. 0x47 0x45 ("GE") and 0x47 0x65 ("gE") are different TSAPs. A mismatch on the second character of a 2-character TSAP is enough to trigger 16#8602.
Passive mode with no defined partner is not always supported. S7-1200 firmware V4.0 and V4.1 reject any passive-mode connection where the partner address is left at the default 0.0.0.0. V4.2+ accepts the wildcard in passive mode only when the TIA wizard's "Accept any partner" checkbox is set. If you see 16#8602 only on a passive-mode IDB that was created by direct structure edit (not the wizard), this is the cause.
16#80A4 vs 16#8602 confusion. Operators sometimes report 16#80A4 as the "error" because it surfaces in the same STATUS tag. 16#80A4 is informational; the connection is up. 16#8602 is a hard validation failure. Differentiate in the HMI alarm by status code, not by presence of ERROR = TRUE.
Same Connection ID, different protocols. TIA Portal will not prevent you from assigning Connection ID = 1 to a TCP connection and Connection ID = 1 to an ISO-on-TCP connection in the same project if they are in different subprograms. The runtime will resolve it (last-loaded wins), but the losing IDB sees 16#80C0 or 16#8602 depending on timing. Enforce a project-wide Connection ID map in your coding standard.
Firewall state. Some managed switches and industrial firewalls maintain a TCP state table. A RST generated by the firewall in response to a SYN that does not match the firewall's expected tuple can look like 16#8602 to the CPU. Disable the firewall rule temporarily during commissioning to rule this out.
CPU 1214FC safety projects. The safety variant of the CPU does not change TCON behavior, but the F-runtime can interfere with online IDB edits. Always re-download the entire F-block container after a TCON parameter change; partial online edits to F-shared DBs are not supported.
Related Errors to Rule Out
| Symptom | Code | Difference from 16#8602 |
|---|---|---|
| Connection set up by CPU but partner never replies | 16#80B3 | Network layer failure; partner unreachable |
| First call after download returns transient | 16#80A4 | Local end briefly occupied; not a fault |
| Too many OUC connections configured | 16#80C3 | Resource exhaustion; reduce connection count |
| IDB parameter structure invalid | 16#80C2 | Structure invalid for the selected protocol |
| Existing connection terminated by partner RST | 16#80C5 | Runtime interruption, not initial setup |
| Connection ID already in use | 16#80C0 | Two IDBs share an ID; not a partner validation error |
Troubleshooting Matrix
| Observation | Check | Action |
|---|---|---|
| 16#8602 on first call, never 16#0000 | Partner IP in IDB | Set IP exactly, no leading zeros, no CIDR suffix |
| 16#8602 with ISO-on-TCP | TSAP byte sequence | Verify hex values, not ASCII display |
| 16#8602 on passive role | Partner wildcard setting | Use TIA wizard "Accept any partner" checkbox (V4.2+) |
| 16#8602 then 16#80C3 on rapid REQ | REQ cadence | Gate REQ with state machine, backoff 1-2 s |
| Wireshark shows RST from CPU | Partner validation in firmware | Confirm IP/port/TSAP match partner device exactly |
| Wireshark shows no SYN at all | Active role expected, partner not listening | Check partner service, firewall, subnet |
| 16#8602 only on F-runtime (CPU 1214FC) | F-block container download | Re-download F-container, do not partial-edit online |
| 16#8602 disappears after partner reboot | Partner had stale ARP/connection | Document the sequence; not a CPU issue |
Standards and Reference Documents
The TCON instruction implements a subset of RFC 793 (TCP) and RFC 1006 (ISO-on-TCP). For protocol-level questions about why the CPU compares IP and port tuples, refer to RFC 793 Section 3.9 (Event Processing). For ISO-on-TCP TSAP encoding semantics, refer to RFC 1006. The TIA Portal S7-1200 manual collection for TCON is the authoritative Siemens reference for the 16#86xx status code definitions.
FAQ
What does TCON error 16#8602 mean on a Siemens S7-1200?
16#8602 means the CPU validated the TCP/ISO-on-TCP connection setup against the partner defined in the TCON instance DB and the partner's IP, port, or TSAP did not match. The CPU wrote 16#8602 to the STATUS output and logged a communication error in the diagnostic buffer. Correct the IDB partner parameters and re-download.
How is 16#8602 different from 16#80A4 on TCON?
16#80A4 is informational and means the CPU's local passive end of the connection is already engaged — it appears on the very first call after a download and should be ignored. 16#8602 is a hard validation failure that persists across calls until the partner IP/port/TSAP is corrected. Treat 16#80A4 once; treat every 16#8602 as a real fault.
How many Open User Communication connections can an S7-1200 CPU handle?
The CPU 1211C and 1212C support 4 OUC connections; the CPU 1214C, 1214FC, 1215C, 1215FC, and 1217C support 8 OUC connections. Exceeding this limit returns status 16#80C3 ("connection resources exhausted") on subsequent TCON calls. Connection resources include TSEND, TRCV, TCON, and TDISCON, all of which share the same pool.
Do I need to re-download the project after changing TCON partner IP?
Yes. The TCON IDB is initialized at download time. Online edits to the IDB partner parameters via a watch table do not take effect on the active connection description. Download the project, let the CPU restart the program, and the new partner address will be used on the next TCON call.
Can ISO-on-TCP TSAPs be entered as ASCII in the TIA wizard?
Yes, the TIA Portal connection wizard accepts ASCII for TSAPs and converts them to the underlying byte sequence. The wizard stores the bytes, not the ASCII. If you edit the IDB structure directly in ST, you must supply the hex byte values. A 2-character ASCII TSAP like "GE" is stored as 0x47 0x45 and must match the partner exactly — case-sensitive and without length prefix unless the partner includes one.