S7-400H CP443-1 TCP Communication Testing with AG_LSEND/AG_LRECV

David Krause21 min read
S7-400SiemensTutorial / 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

Engineering Problem: Verifying Redundant TCP Native Logic

You have an S7-400H fault-tolerant PLC, two CP 443-1 communication processors, and a third-party DCS that talks to it over TCP using SIMATIC native "open" communication. The user program on each CPU uses AG_LSEND (FC50) and AG_LRECV (FC60) - one send/receive pair bound to CP-A, one pair bound to CP-B. The DCS mirrors that pattern so either side of the redundant pair can carry traffic at any moment.

The challenge: confirm the four send/receive jobs behave correctly under (a) normal operation, (b) link failure of CP-A, (c) full H-station fail-over to the backup CPU, and (d) duplicate-frame rejection, all before the real DCS is available. Standard Modbus simulators (Modsim, Modscan) cannot be used - the S7-400H emits raw open-TCP or ISO-on-TCP frames, not Modbus PDUs. You need a generic byte-level TCP server/client plus visibility into the FC50/FC60 status word and the CP443-1 connection table.

Why four blocks in a 1-to-1 link? Each CP 443-1 owns its own connection resources. To survive CP failure on the active H-station, the application must drive one send/receive pair through CP-A and another through CP-B. The H-system handles CPU redundancy, but it does not automatically swap the CP socket - that is application logic. Hence four AG_LSEND/AG_LRECV calls per side of the link.

Redundant S7-400H TCP Native Architecture

The standard pattern for redundant native TCP between an S7-400H and a DCS is shown below. Two H-stations, each with a CPU 41x-H and a CP 443-1, are connected over a plant LAN to the DCS. The H-system keeps both CPUs memory-consistent via the sync fiber. Each CP443-1 opens its own TCP connection to the DCS (separate ports), and the application arbitrates which of the two received frames is "fresh."

S7-400H Redundant TCP Native to DCS H-Station 1 (Master) CPU 417-4H 6ES7417-4HT14-0AB0 CP 443-1 #1 6GK7443-1EX30-0XE0 AG_LSEND/RECV FC50/FC60, ID=1 H-Station 2 (Backup) CPU 417-4H 6ES7417-4HT14-0AB0 CP 443-1 #2 6GK7443-1EX30-0XE0 AG_LSEND/RECV FC50/FC60, ID=1 Sync Fiber 4x TCP Native open TCP / ISO-on-TCP DCS 4x S/R blocks Mirror redundancy 192.168.10.50 TCP 2001 / 2002

Physical equipment you will see in HW Config (STEP 7 V5.5 / V5.6):

  • CPU 414-4H (6ES7414-4HM14-0AB0), CPU 416-3H (6ES7416-3HS12-0AB0), or CPU 417-4H (6ES7417-4HT14-0AB0) in each H-station.
  • CP 443-1 in each rack. Common order numbers: 6GK7443-1EX20-0XE0 (legacy single-port), 6GK7443-1EX30-0XE0 (multi-port), 6GK7443-1GX20-0XE0 (Gigabit, advanced IT functions), and the security variants 6GK7443-1EX40-0XE0 / 6GK7443-1EX50-0XE0.
  • Sync modules and sync fiber between the two H-stations (subrack 0 in each).
  • Ethernet switch infrastructure: the CP443-1 connects to a managed switch on the plant network; the DCS connects on the same subnet unless you are using a routed topology with a firewall.

The IP address plan in the example: CP-A = 192.168.10.11, CP-B = 192.168.10.12, DCS = 192.168.10.50. The CP-A and CP-B addresses are bound to the H-system's virtual MAC; the active CPU owns the ARP entry at any moment, but the CP443-1 module's IP is the one seen on the wire per H-station.

AG_LSEND (FC50) and AG_LRECV (FC60) Block Interface

FC50 and FC60 live in the SIMATIC_NET_CP library that ships with STEP 7. They are the supported open-TCP send/receive primitives for CP443-1 in STEP 7 V5.x; TIA Portal's TSEND_C/TRCV_C blocks are functionally similar but are only available in TIA Portal projects, and a STEP 7 V5.x program using FC50/FC60 cannot be transferred as-is.

FC50 (AG_LSEND) input/output parameters
Parameter Direction Type Meaning
LADDR INPUT WORD Logical base address of the CP443-1 (e.g. W#16#0100 for address 256)
ID INPUT WORD Connection ID, range 1-16, must match the configured connection in NetPro
SEND INPUT ANY Pointer to source data area (DB, MB, etc.)
LEN INPUT INT Number of bytes to send, 1-8192
DONE OUTPUT BOOL 1 for one cycle after a successful job
ERROR OUTPUT BOOL 1 if STATUS contains an error code
STATUS OUTPUT WORD Status / error code, e.g. W#16#0000
BUSY OUTPUT BOOL 1 while the job is in progress
FC60 (AG_LRECV) input/output parameters
Parameter Direction Type Meaning
LADDR INPUT WORD Logical base address of the CP443-1
ID INPUT WORD Connection ID, 1-16
RECV INPUT ANY Pointer to receive area (must be at least LEN bytes)
LEN INPUT/OUTPUT INT On input: max bytes to read; on output: actual bytes received
NDR OUTPUT BOOL 1 for one cycle when new data has been accepted
ERROR OUTPUT BOOL 1 if STATUS contains an error code
STATUS OUTPUT WORD Status / error code
BUSY OUTPUT BOOL 1 while a receive job is in progress

Calling pattern in OB1 (STL):

CALL "AG_LSEND"  // FC50
 LADDR  := W#16#100   // CP443-1 #1 at HW address 256
 ID     := 1          // Connection ID 1
 SEND   := P#DB100.DBX0.0 BYTE 200
 LEN    := 200
 DONE   := M100.0
 ERROR  := M100.1
 STATUS := MW102
 BUSY   := M100.2

Calling pattern in OB1 for the receive (SCL):

AG_LRECV(
  LADDR  := W#16#100,
  ID     := 1,
  RECV   := P#DB110.DBX0.0 BYTE 200,
  LEN    := 200,
  NDR    := M110.0,
  ERROR  := M110.1,
  STATUS := MW112,
  BUSY   := M110.2
);

You repeat the same call template for the second CP443-1 by changing LADDR (e.g. W#16#0180 for CP-B at HW address 384) and a separate set of DONE/ERROR/STATUS/BUSY flags. The four send/receive jobs share the same DB areas only if you intend the application to treat both CP-A and CP-B as a single redundancy group; in practice, four separate DBs (DB100 for CP-A send, DB110 for CP-A receive, DB200 for CP-B send, DB210 for CP-B receive) keep the logic clean and let you see which frame arrived on which channel.

State machine discipline. The block is a static-instance call - you must not interrupt a busy job with another REQ edge on FC50, and you must not re-trigger FC60 with new parameters while BUSY=1. Doing so returns STATUS = W#16#80A7 (connection busy / job still in progress). The recommended pattern is positive-edge-triggered REQ in OB35 with a BUSY=0 gate, or a state-driven call in OB1 with the previous call's DONE/ERROR evaluated before the next call.

CP 443-1 Configuration for Open TCP

Open TCP on the CP443-1 is configured in NetPro by adding a "TCP connection" to the CP, then setting the partner (the DCS) as an unspecified / "other" partner and entering its IP address and remote port. The local port is chosen by the configuration tool (default 2000, but the CP increments it automatically for additional connections).

  1. In HW Config, double-click the CP 443-1 and assign a unique IP address, e.g. 192.168.10.11 for CP-A and 192.168.10.12 for CP-B. Enable the "Use Router" option only if a router is on path.
  2. In NetPro, right-click the CP and select Insert New Connection > TCP connection > Unspecified / other.
  3. Configure the connection:
    • Local port: leave at default (the CP will pick the next free port starting at 2000; do not duplicate across CPs on the same H-station).
    • Partner address: 192.168.10.50 (the DCS).
    • Partner port: 2001 for the A-channel, 2002 for the B-channel - or whatever the DCS expects.
    • Connection name: CP443A_TCP_A and CP443B_TCP_B.
    • Connection ID: 1 and 2 (must be unique per CP - the IDs are per-CP-scoped, not project-wide).
  4. Compile and download the connection table to both CPUs. In an H-system you must download to both H-stations; the S7-400H runtime keeps the connection table mirrored.
  5. Set the operating mode of the CP to "RUN" (no PG/OP routing change required for open TCP, but the CP must not be in STOP).
Connection ID scope. Connection ID is per-CP. The same ID=1 may exist on CP443-1 #1 and CP443-1 #2 in parallel - they are independent resources. The LADDR parameter in FC50/FC60 tells the block which CP the ID belongs to.

If you are using ISO-on-TCP (RFC 1006) instead of plain open TCP, change the NetPro connection type to "ISO-on-TCP connection" and the CP443-1 will add the 4-byte TPKT header (length + 0x03 0x00) automatically. The FC50/FC60 interface does not change - the framing is handled by the CP. For plain open TCP the CP sends no header; the raw user data goes straight onto the wire. Wireshark with a tcp.port == 2001 filter will show the difference clearly.

Connection ID, Resource, and Port Allocation

For an S7-400H with two CP443-1 cards and a DCS partner that accepts two open-TCP sockets, the allocation looks like this:

Typical connection allocation
Job CPU CP443-1 NetPro conn. ID LADDR Local port Remote IP Remote port
AG_LSEND/RECV #1 CPU 0 (H-master) CP443-1 #1 CP443A_TCP_A 1 W#16#0100 2000 192.168.10.50 2001
AG_LSEND/RECV #2 CPU 0 (H-master) CP443-1 #2 CP443B_TCP_B 1 W#16#0180 2000 192.168.10.50 2002
AG_LSEND/RECV #3 CPU 1 (H-backup) CP443-1 #1 CP443A_TCP_A 1 W#16#0100 2000 192.168.10.50 2001
AG_LSEND/RECV #4 CPU 1 (H-backup) CP443-1 #2 CP443B_TCP_B 1 W#16#0180 2000 192.168.10.50 2002

On the H-master, both CPU 0 jobs are active. CPU 1 jobs run in the background and are kept in lock-step by the H-system; once a fail-over happens, the backup takes over both send/receive pairs without the user having to re-trigger. The CP443-1 in the H-backup does not open its own TCP connection during steady state - the connection is owned by the H-master's CP443-1; after fail-over the new master's CP443-1 re-opens it.

One caveat on H-redundant CP443-1. If you use the redundant CP443-1 feature in the H-system, the connection is owned by the "system connection" - both CPs use a single shared LADDR and the system swaps transparently. If you instead use two independent CP443-1 modules in two H-stations, the application owns the swap. The source design uses the second pattern, hence the four-block approach.

FC50/FC60 State Machine

The behavior of FC50 is dictated by a small state machine on the REQ, BUSY, DONE, and ERROR outputs. Understand this state machine before commissioning - the most common bugs in S7-400H TCP programs are violations of it (re-triggering while BUSY=1, missing the DONE edge, racing the H-system during fail-over).

AG_LSEND (FC50) Job State Machine REQ=0 IDLE STATUS=7000 REQ=1, BUSY=1 SENDING STATUS=7002 DONE=1, ERROR=0 SUCCESS STATUS=0000 DONE=0, ERROR=1 FAIL STATUS=80xx REQ pos-edge partner ACK partner NACK / err DONE consumed, next cycle ERROR consumed, next cycle

FC60 has a similar shape, with NDR playing the role of DONE and no equivalent of "send complete" - the receive job is pending whenever BUSY=1. The recommended user pattern is:

// Trigger pattern (OB1)
IF NOT "busy_send_A" AND "send_request_A" THEN
   "AG_LSEND_A"(REQ := TRUE, ...);  // single-cycle pulse
ELSE
   "AG_LSEND_A"(REQ := FALSE, ...); // keep calling to read BUSY/DONE/ERROR
END_IF;

// Edge handling (OB1)
IF "done_send_A" THEN
   "send_request_A" := FALSE;
   "last_send_status_A" := "status_send_A";
END_IF;
IF "error_send_A" THEN
   "send_request_A" := FALSE;
   "last_error_code_A" := "status_send_A";
   // raise a maintenance alarm with "status_send_A"
END_IF;

FC50/FC60 Status and Error Code Reference

Before testing, memorize the STATUS codes that matter for open TCP. They are documented in the SIMATIC NET help and in the S7-400H / CP443-1 manual. The table below is the subset you will see in practice on native TCP / ISO-on-TCP with FC50/FC60.

FC50/FC60 status and error codes
STATUS (W#16#) Class Meaning What to do
0000 Done Job completed, no error Continue
7000 Info Connection exists, no job active, idle Trigger a new job when needed
7001 Info First call - job started, no acknowledgment yet Wait and re-call
7002 Info Job in progress, follow-up call Continue calling until DONE/ERROR
8085 Error LADDR wrong; CP in STOP; CP not configured for this slot Check HW Config, verify LADDR in STEP 7 online view
80A0 Error Negative acknowledgment from partner; partner rejected the data Check DCS partner application
80A1 Error Connection terminated by partner (TCP RST or FIN) Check partner state, network
80A2 Error Connection cannot be established; ARP/DNS/timeout; partner unreachable Verify partner IP/port; check switch and firewall
80A3 Error Connection closed locally (e.g. CP443-1 in STOP) Check CP operating mode
80A4 Error Length error: LEN = 0 or exceeds the CP buffer (8192 bytes for FC50/FC60) Correct LEN parameter
80A7 Error Connection busy / another job active on the same ID Wait until BUSY=0, or do not retrigger
80A8 Error Receive area too small: RECV ANY length < incoming frame Increase DB/area size
80B0 Error System error / resource error on CP Power-cycle CP, check diagnostic buffer
80B1 Error Parameter assignment error (e.g. ID > 16) Fix ID range; must be 1-16
80B2 Error CP not available / removed / not online Check rack and CP module
80C0 Error Send error - frame could not be transmitted (link down) Check physical link
80C1 Error Send buffer too short for ISO-on-TCP TPKT header Reduce LEN or split into multiple jobs
80C2 Error Frame received with error (checksum / length invalid) Check partner format; check for LEN mismatch
80C3 Error Authentication failed (security-enabled CP) Re-enter credentials in NetPro
80C4 Error Security state error (security-enabled CP) Check security configuration

Codes in the 80xx range that you do not recognize are usually reported directly in the CP443-1 diagnostic buffer. Open them with STEP 7 > PLC > Module Information on the CP443-1. The S7-400 buffer and the CP buffer are independent - read both; a 7000 on FC50 with a buffer entry "connection aborted by partner" still tells you the partner is the cause.

Simulating the DCS Partner: TCP Server/Client Tools

To test the four-block redundant logic, you need a raw TCP server and a raw TCP client on a PC (or two PCs). Avoid tools that hard-code a protocol on top of TCP - the S7-400H sends user-defined bytes, not Modbus, not S7-comm, not OPC UA. The following are useful.

TCP test tools for FC50/FC60 verification
Tool Mode Why it is useful Limitations
Hercules SETUP Utility (HW Group) TCP Server / Client / UDP Lightweight Windows GUI, send/receive in ASCII or hex, separate Server and Client tabs let you run both sides in one window Single instance; for two servers (port 2001 and 2002) run two copies
PuTTY (raw socket) TCP Client (raw) Connects to a remote port and shows a terminal; quick smoke test of one connection Client-only, no listener
netcat (nc) TCP Server / Client Scriptable: nc -l -p 2001 on Linux; ideal for batch test scripts No native Windows GUI; need Cygwin / WSL
socat TCP / serial redirector Bidirectional, can tee to file for capture CLI only, learning curve
Python socket + select Custom script You can script fail-over scenarios: open both sockets, kill one, then re-accept Requires writing the script
Wireshark Passive capture Capture the TCP frames on the wire to inspect exactly what the CP443-1 sends - including the TPKT header for ISO-on-TCP Read-only

For the typical setup, run two Hercules instances (or a small Python script) listening on TCP ports 2001 and 2002 - one for CP-A's connection, one for CP-B's connection. The CP443-1 will open both as active partner; the simulator acts as the passive server. Use Wireshark in parallel to capture and confirm frame contents.

A minimal Python test harness that emulates the DCS for one connection:

import socket, threading

def serve(port, replies):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    s.bind(('0.0.0.0', port))
    s.listen(1)
    while True:
        conn, addr = s.accept()
        while True:
            data = conn.recv(8192)
            if not data: break
            conn.sendall(replies.pop(0) if replies else data)
        conn.close()

threading.Thread(target=serve, args=(2001, [b'\xAA'*200]*1000), daemon=True).start()
threading.Thread(target=serve, args=(2002, [b'\xBB'*200]*1000), daemon=True).start()
import time; time.sleep(3600)
Hyperterminal note. Hyperterminal Private Edition can open a TCP connection (File > Properties > Connect Using = TCP/IP) but it is client-only. Use it for one-direction verification only - you cannot accept the CP443-1's connection if the CP is the active opener.

If the CP443-1 is configured as the passive partner (it waits for an incoming connection), flip the test: use Hercules in TCP Client mode to dial the CP's IP and port, then watch FC60 receive the data. The active / passive role is fixed in NetPro by checking "Active connection establishment" on the local CP or on the partner - the source design has the CP as active.

Online Diagnostics in STEP 7

Three online views are the workhorse for troubleshooting FC50/FC60 on the CP443-1:

  1. Module Information on the CP443-1. In SIMATIC Manager, right-click the CP443-1 in the project (online), choose PLC > Module Information. The "Diagnostics" tab lists connection state, the "Connection" tab shows established / aborted connections with their ID and partner IP/port, and the "Statistics" tab counts send/receive errors and link resets.
  2. NetPro online view. In NetPro, right-click the configured TCP connection and select Connection Status. The status is reported as one of: Established, Not Established, Being Established, Being Aborted. The detail shows the local and remote port and the connection ID.
  3. Watch table / VAT on FC50/FC60 outputs. Open a VAT in OB1 or attach a watch table to the FC50/FC60 instance environment and monitor DONE, ERROR, STATUS, BUSY, NDR (for FC60). This is the fastest way to capture transient STATUS codes during a fail-over test.

To force a fail-over during the test, use the S7-400H test panel: PLC > Operating Mode > Switch Over. This swaps the H-master to the backup CPU; the connections held by the CPs on the original master are torn down and rebuilt by the new master. Watch STATUS cycle through 7000 → 7001 → 7002 → 0000 (or an error) on both the FC50 and FC60 jobs.

Additional diagnostic tool, often forgotten: the CP443-1 has a web server that you can enable in HW Config. Point a browser at https://192.168.10.11 and you get a live view of the connection table, the system log, and the diagnostic buffer - useful when the PG is far away. Disable the web server in production or at least restrict it via the security settings on the 6GK7443-1EX50-0XE0 variants.

Test Procedure and Verification

  1. Pre-flight. Confirm the CP443-1 module is in RUN (no SF / BF LED), the IP address and subnet match NetPro, and the partner IP (the simulator PC) is reachable: ping 192.168.10.50 from a PG on the same VLAN.
  2. Stand up the simulator. Run two TCP listeners on ports 2001 and 2002 (Hercules / netcat / Python). Confirm the listener shows LISTEN state on both ports. Start Wireshark with a capture filter for tcp port 2001 or tcp port 2002 on the simulator PC's interface.
  3. Bring up FC50 jobs. Trigger the two AG_LSEND calls in the H-master. In a VAT, watch STATUS for the expected sequence: 7001 (start) → 7002 (sending) → 0000 (done). Wireshark should show a TCP SYN from CP-A (port 2000) to 192.168.10.50:2001 and a payload of 200 bytes on DATA.
  4. Bring up FC60 jobs. The simulator echoes a known reply payload (e.g. 200 bytes of 0xAA). Watch the two AG_LRECV calls: NDR should pulse for one PLC cycle, LEN should report the actual bytes received, and STATUS = 0000 on success.
  5. Verify duplicate handling. With both CP-A and CP-B receiving the same echo payload from the simulator, the application should accept only one of them per scan - typically the one with the most-recent sequence number or timestamp. A simple test: send a payload with an embedded counter; verify the application increments its expected counter and discards the duplicate.
  6. Simulate CP-A link loss. Unplug the Ethernet cable on CP-A (or shut its switch port). Watch the Wireshark capture for a TCP RST/FIN. FC60 on the CP-A pair should report STATUS = 80A1 (connection terminated by partner) or 80A3 (connection closed locally). The CP-B pair must continue to receive and the application must fall back to the CP-B data path.
  7. Simulate H-station fail-over. From SIMATIC Manager trigger PLC > Operating Mode > Switch Over. The H-master and H-backup swap roles. Both CP443-1 jobs (originally on the old master) should now appear in the new master and re-establish their TCP connections - expect to see two TCP SYN packets in Wireshark and STATUS cycling 7000 → 7001 → 7002 → 0000.
  8. Restore and confirm steady state. Reconnect the CP-A cable. Both pairs should show STATUS = 7000 (idle, connection established) and the application should re-enable the CP-A data path.
  9. Capture evidence. Save the Wireshark trace, the VAT recordings, and the CP443-1 diagnostic buffer export as the commissioning record. Keep one capture per failure mode (link loss, H fail-over, partner abort) for the site acceptance test.
Timing reality check. TCP re-establishment on a healthy LAN with no firewall usually completes in 50-200 ms. The S7-400H fail-over itself is 100-300 ms (single-sided) or 300-700 ms (full H fail-over with master/standby switch). Plan your DCS-side timeout accordingly - a 5-second TCP keepalive and a 2-second application timeout are typical starting points for open TCP to a DCS. Anything tighter than 1 second is risky on a congested plant network.

Troubleshooting Matrix

FC50/FC60 faults to causes to actions
Observed symptom Likely cause Action
FC50/FC60 STATUS = 8085 LADDR wrong; CP443-1 in STOP; module removed Check HW Config online view; verify LADDR matches the configured slot/offset; bring CP to RUN
FC50/FC60 STATUS = 80A2, simulator does not see SYN Partner unreachable; ARP failure; wrong IP or port Ping from PG; verify switch port; check VLAN/firewall; confirm Remote IP and Remote Port in NetPro
FC50 STATUS = 0000 but simulator sees no data Wrong SEND ANY pointer; LEN zero; DB not loaded Verify SEND pointer with VAT; check LEN > 0; confirm the source DB has been downloaded
FC60 NDR = 0, STATUS = 80A8 Receive area smaller than incoming frame Resize RECV DB or area; cap LEN at the actual frame size
FC60 NDR = 0, STATUS = 80A7 Calling FC60 with new parameters while BUSY=1 Add edge detection on REQ only when BUSY=0; check the call is in OB1 not OB35 with different priorities
Connection established, then STATUS = 80A1 Partner closed connection Check DCS partner application for unhandled close; check switch port security / BPDU guard / ACLs
Wireshark shows TCP retransmits Network congestion or duplex mismatch on CP443-1 port Hard-set switch port to 100 Mbit/s full-duplex or auto; check CP443-1 port for errors via Module Information > Statistics
Both CP-A and CP-B keep switching the "active" pair rapidly Duplicate-frame logic too aggressive; sequence number not updated Add a per-source monotonically increasing sequence number; only accept frame if seq > last_accepted_seq
After H-switchover, FC50 reports 80B0 (system error) Connection resource not released by old master before new master takes it Increase STATUS polling interval; verify NetPro connection is downloaded to both H-stations
CP443-1 BF LED lit, FC50 reports 80C0 Physical link down on that CP Replace cable, check SFP (if used), confirm port LEDs
STATUS = 80C3 or 80C4 Security-enabled CP, partner credentials not configured Re-enter TLS/PG/partner credentials in NetPro and reload
STATUS = 80A4 after a fail-over Application passed LEN = 0 during the brief CPU-restart window Guard the FC50/FC60 call with a "PLC has been restarted for at least N cycles" bit to skip the first scan
Simulator shows SYN, then immediate FIN from CP CP cannot route to the partner IP; routing table missing Configure a default router on the CP443-1 in HW Config; verify subnet mask; on cross-subnet partners, set "Use Router" and the gateway IP
FC50 returns 80A0 even though simulator sent data Application defined "no ACK" mode in NetPro but block expects ACK, or vice versa Verify "Acknowledged" / "Unacknowledged" setting in NetPro matches the block's behavior; for raw open TCP use Acknowledged

For the official FC50/FC60 description and the full status-code table, see the Siemens Industry Online Support entry for "AG_LSEND / AG_LRECV" in the SIMATIC NET CP library documentation, and the CP 443-1 manual on the same portal. For the S7-400H fail-over behavior and the switchover procedure, refer to the S7-400H Fault-Tolerant Systems manual, available on Siemens support under product support for S7-400H. SIMATIC product documentation is also reachable from Siemens SIMATIC product page.

Frequently Asked Questions

Can I use Modbus simulators (Modsim, Modscan) to test S7-400H native TCP?

No. The CP 443-1 with FC50/FC60 sends raw open-TCP or ISO-on-TCP user frames, not Modbus PDUs. Use a generic byte-level TCP server/client such as Hercules, netcat, or a Python socket script instead, and capture with Wireshark to inspect the payload on TCP ports 2001/2002.

Why are there four send/receive blocks in a 1-to-1 redundant S7-400H TCP setup?

Each CP 443-1 owns its own TCP connection resource. To survive CP failure on the active H-station, the application drives one AG_LSEND/AG_LRECV pair via CP-A (LADDR W#16#0100) and another via CP-B (LADDR W#16#0180); the H-system handles CPU redundancy, but the application owns the CP swap, hence four jobs per side of the link.

What is the difference between AG_LSEND/AG_LRECV (FC50/FC60) and TSEND_C/TRCV_C in TIA Portal?

FC50/FC60 are the legacy open-TCP / ISO-on-TCP blocks from the SIMATIC_NET_CP library in STEP 7 V5.x. TSEND_C/TRCV_C are the TIA Portal equivalents with integrated connection setup and a unified interface. They expose different parameter sets; you cannot simply copy a STEP 7 V5.x program using FC50/FC60 into a TIA Portal project without rewriting the calls and re-importing the connection table.

How do I read the live connection state of a CP443-1 from STEP 7?

Right-click the CP443-1 online, choose "Module Information" for module diagnostics, or open NetPro and right-click the configured TCP connection to view "Connection Status." In a VAT, monitor the FC50/FC60 outputs (DONE, ERROR, STATUS, BUSY, NDR) to capture transient codes during fail-over; expect STATUS to cycle 7000 to 7001 to 7002 to 0000 within 1-2 seconds on a healthy network.

How do I trigger an S7-400H fail-over during a TCP test?

From SIMATIC Manager, choose "PLC > Operating Mode > Switch Over" on the H-master. The H-master and H-backup swap roles; the TCP connections on the original master's CPs are torn down and rebuilt by the new master. Both FC50 and FC60 should re-establish within 1-2 seconds; if you see STATUS=80B0, the connection resource was not yet released by the old master - increase the polling interval or verify the connection table is downloaded to both H-stations.

Back to blog