MB_CLIENT. The same procedure applies to S7-1200 CPUs running firmware V4.0 or higher where the identical instruction set is available.1. Problem Summary
A SIMATIC S7-1500 CPU attempts Modbus TCP polling of a Bently Nevada 3500 machinery protection rack fitted with a 3500/92 Modbus TCP gateway card. The PLC is wired into a SCALANCE X208 managed switch on PROFINET port X2 of the CPU (port X1 carries the PROFINET ring). Ping from the engineering station and from the PLC to the 3500/92 IP succeeds, but the MB_CLIENT instance reports a permanent status word value of 809B hex on the STATUS output and never updates the receive buffer.
The same engineering project also exhibits the following behaviour:
- The 3500/92 rack is reachable by ICMP echo from both the engineering PC and the PLC.
- Setting the 3500/92 to act as a Modbus client instead of a server produces the same 809B status.
- Changing
MB_MODEbetween 101 and 104 yields no change inSTATUS. - Only when
MB_MODE= 0 is entered does the status finally clear and registers begin populating.
2. Hardware and Network Topology
| Device | Role | IP Address | Port / Interface | Notes |
|---|---|---|---|---|
| S7-1516-3 PN/DP (CPU 1516) | Modbus TCP Client | 192.168.1.2 | Port X2 (Profinet interface 2, HW ID 72) | Port X1 used for PROFINET ring with other IO devices |
| SCALANCE X208 | Switch | 192.168.1.1 (mgmt) | Any port | Layer 2 only - no firewall, no NAT, no ACL filtering |
| Bently Nevada 3500/92 | Modbus TCP Server | 192.168.1.6 | TCP 502 (default Modbus TCP server port) | Configured as Server, Modbus start address 45001, length 95 words |
Wiring path: CPU X2 → CAT6 patch → SCALANCE X208 Port 1 → SCALANCE X208 Port 4 → 3500/92 Ethernet RJ45. The PROFINET ring (port X1) is logically and physically separate from the Modbus subnet.
3. Decoding Status 809B
The 16-bit STATUS output of MB_CLIENT reports class A errors as 0x8xxx hex. Per the Siemens SIMATIC S7-1500 Communication Function Manual, the relevant subset of error classes is:
| STATUS (hex) | Class | Meaning | Typical Cause |
|---|---|---|---|
| 7000 | Status | No job active | Request edge not yet issued |
| 7001 | Status | First request being processed | Initial handshake in progress |
| 7002 | Status | Follow-up job being processed | Polling in progress |
| 809B | Error | TCP connection could not be established - partner actively refused or port not open | Wrong RemotePort, server not listening, firewall, or local port already bound |
| 80C8 | Error | No response from slave within response timeout | Slave exists but does not reply (function code, latency, MB_DATA_ADDR offset) |
| 80B0 | Error | Illegal Modbus function code | Slave rejected FC; check MB_MODE/MB_DATA_ADDR mapping |
| 8188 | Error | Connection aborted by partner | Partner closed TCP session after first response |
Diagnosis: Status 809B is reported before any Modbus PDU is exchanged. It indicates the TCP three-way handshake with the 3500/92 server failed. The PLC attempted to open a TCP session to the configured RemoteAddress:RemotePort and the partner either refused the SYN or did not reply.
4. Root Cause Analysis
Three contributing defects were present in the original project. Each must be corrected before MB_CLIENT will complete the TCP handshake.
4.1 Remote port misconfiguration
The initial project had RemotePort = 0 with LocalPort = 502. The roles are reversed in a Modbus TCP client. The 3500/92 acts as the server and is the device listening on TCP 502. The PLC must therefore set RemotePort = 502; the local port must be 0 (let the operating system assign an ephemeral port) or any unused port above 1024.
4.2 MB_MODE value mismatched to data request
The MB_MODE parameter encodes both the Modbus function code and the access type (read/write, bit/word). Valid values are 0, 1, 2, 3, 101, 102, 103, 104, 105, 106. Modes 101-104 require the data length to be ≤ the maximum word count the function allows and require MB_DATA_ADDR to be entered as the zero-based Modbus address (0 to 65535). Mode 0 (FC 3 - Read Holding Registers) with explicit address and length supplied via MB_DATA_ADDR and MB_DATA_LEN is the most forgiving configuration and was the only mode that produced a successful response on this hardware combination.
4.3 DATA_LEN exceeding server-mapped length
The 3500/92 was configured with a Modbus mapping length of 95 holding registers starting at server address 45001. MB_DATA_LEN must be exactly 95; any larger value triggers a server-side rejection once the PLC moves past the configured range. The MB_DATA_ADDR parameter must be set to the address value declared inside the 3500/92 configuration utility - in this case 45001 - not to the zero-based offset. MB_CLIENT performs the zero-based remapping internally.
5. Working MB_CLIENT Configuration
The instance DB of MB_CLIENT must contain the following parameter values. Hardware identifier (InterfaceId) for port X2 on an S7-1516 is system constant 72 in TIA Portal V15 and later; verify with the device view "System constants" tab.
| Parameter | Value | Comment |
|---|---|---|
REQ |
TRUE (constant) | Continuous polling; tie to OB1 cyclic call |
DISCONNECT |
FALSE | Hold the TCP session open |
CONNECT_MODE |
0 (TCP/IP, classic) | Not OPC UA mode |
MB_MODE |
0 | FC 3 - Read Holding Registers |
MB_DATA_ADDR |
45001 | Start address as configured in 3500/92 |
MB_DATA_LEN |
95 | Must equal the 3500/92 mapping length exactly |
MB_DATA_PTR |
P#DB100.DBX0.0 WORD 95 | Non-optimised DB (standard access) |
DONE |
BOOL tag | Set on successful response |
BUSY |
BOOL tag | TRUE while request is in flight |
ERROR |
BOOL tag | TRUE on class 8 error |
STATUS |
WORD tag | Watch this for 809B |
| CONNECT parameter | Value | Comment |
|---|---|---|
InterfaceId |
72 | HW identifier of CPU PROFINET interface X2 |
ID |
1 | Any unique number 1..16 for this connection |
ConnectionType |
11 | TCP/IP (decimal 11 per TCON structure) |
ActiveEstablished |
TRUE | PLC opens the connection |
RemoteAddress |
192.168.1.6 | Bently Nevada 3500/92 |
RemotePort |
502 | Standard Modbus TCP server port |
LocalPort |
0 | Any ephemeral port |
6. Step-by-Step Resolution Procedure
-
Confirm physical layer. From the engineering PC, ping
192.168.1.6. Successful reply indicates that the SCALANCE X208, patch cabling, and the 3500/92 RJ45 port are functional. -
Confirm 3500/92 TCP server. From the PC, open a Modbus TCP test tool (for example a PC acting as Modbus client with Wireshark on
tcp.port == 502) and issue an FC 3 read of 1 register from address 45001. A response confirms the server is listening and that registers are mapped. - Identify the PLC PROFINET interface. In TIA Portal, open Devices & Networks, select the CPU, and switch to the System constants tab. Note the HW identifier of the PROFINET interface used for Modbus traffic. On an S7-1516 with two PROFINET ports, port X1 is usually HW ID 71 and port X2 is HW ID 72.
-
Insert MB_CLIENT. Drag
MODBUS TCP > MB_CLIENTinto the project. The instruction creates an instance DB automatically. -
Configure the CONNECT input. Open the instance DB and populate the
CONNECTstructure with the values from the working configuration table above.ConnectionType = 11selects standard TCP/IP. -
Configure the polling inputs. Set
MB_MODE = 0,MB_DATA_ADDR = 45001,MB_DATA_LEN = 95. -
Provide a non-optimised data block. The receive buffer
MB_DATA_PTRmust point into a standard (non-optimised) DB of at least 95 WORDs. Optimised DBs occasionally interfere with the Modbus data transfer under specific firmware versions; revert to standard access if problems persist. -
Tie REQ high. Connect
REQto a constant TRUE in OB1 for continuous polling, or to a clock generator for periodic polling. -
Compile, download, go online. Force OB1 to run and observe the
STATUStag online. Expect 7001 momentarily, then 7002, then DONE pulses. - Verify register contents. Open the receive DB online and confirm that 95 WORDs are populated and change when the 3500 rack vibration channels are stimulated.
7. Verification Checklist
| Check | Expected Result | Pass Criterion |
|---|---|---|
STATUS word online |
7002 / 0000 alternating | No 809B, no 80C8 |
DONE |
Pulses TRUE for one scan per request | Pulses regularly at polling interval |
BUSY |
TRUE while request in flight | TRUE for < response timeout (default 2 s) |
ERROR |
FALSE | Never TRUE during normal polling |
| Receive DB WORD values | Non-zero, varying | Channel 1 vibration peak-hold data should be visible at 45001..45020 |
| Wireshark capture (optional) | SYN from PLC → 192.168.1.6:502, SYN-ACK from 3500/92, ACK from PLC, MBAP + FC 03 PDU, response PDU with byte count | Three-way handshake completes; FC 03 echoed in response |
8. Common Pitfalls and Field Notes
-
Mode vs. address confusion. Modes 101-104 are convenience modes that auto-derive the function code from a 1-based register number. If the 3500/92 mapping starts at 45001, the user is tempted to set
MB_DATA_ADDR = 45001with mode 103. Mode 103 internally reinterpretsMB_DATA_ADDRas 45001 with zero-based offset calculation - on most firmware revisions this works, but with the 3500/92 a small subset of the address space above register 41000 causes the server to NAK. Falling back to mode 0 with explicit address and length avoids the interpretation problem. -
Optimised access blocks. A receive DB with "Optimised block access" enabled prevents the
MB_DATA_PTRANY pointer from resolving to a known byte offset. Always use a standard DB with byte offsets for Modbus data buffers, or assign the symbol directly in TIA Portal V16+ where the compiler can resolve symbolic slice references. - CPU PROFINET port selection. S7-1500 CPUs with two PROFINET ports (X1 and X2) report a separate HW identifier for each. Using the wrong identifier routes the TCP SYN out the wrong interface and the 3500/92 never sees it. The symptoms are indistinguishable from a partner-refused error (809B). Confirm the HW ID against the CPU's system constants.
- SCALANCE switch ACLs. A SCALANCE X208 in default configuration passes all frames. If a previous project has loaded an ACL or VLAN filter, ensure that VLAN membership and IP-based filter rules permit TCP/502 between 192.168.1.2 and 192.168.1.6.
-
3500/92 firmware versions. Bently Nevada 3500/92 firmware revisions prior to A2.10 do not implement Modbus TCP keep-alive and may drop the connection after 60 seconds of silence. With continuous
REQ = TRUEpolling this is not an issue, but periodic polling at intervals above 30 s should enable the 3500/92 "Modbus Keep-Alive" parameter. -
Modbus TCP port collision. Port 502 is privileged on some embedded Linux stacks and may require the S7-1500 firmware V2.6 or higher to bind outgoing connections correctly. Update the CPU firmware if
LocalPort = 0still triggers 809B after the partner configuration is corrected.
9. Related TIA Portal Diagnostics
The Siemens Open User Communication instructions TCON, TDISCON, TSEND, and TRCV sit beneath the MB_CLIENT abstraction and expose lower-level status information. For persistent 809B errors, drop to a manual TCON/TRCV pair to isolate whether the TCP handshake itself completes - the underlying connection establishment function returns a status that mirrors the partner refusal condition described above. Reference: TCON, TDISCON, TSEND, and TRCV (TCP communication instructions).
Use the diagnostic buffers of the CPU (Online & Diagnostic → Diagnostic buffer) to inspect the connection status events generated when the TCP handshake is attempted.
10. Troubleshooting Matrix
| STATUS | Likely Root Cause | Action |
|---|---|---|
| 809B | TCP connection refused | Verify RemotePort = 502, LocalPort = 0, server is up |
| 80C8 | No response within timeout | Verify MB_DATA_LEN ≤ server mapping length; check latency |
| 80B0 | Illegal function code | Verify MB_MODE mapping; 3500/92 supports FC 1, 2, 3, 4, 5, 6, 15, 16 |
| 8188 | Partner aborted | Reduce poll rate or enable keep-alive on 3500/92 |
| 7002 (permanent) | No new request issued | Verify REQ rising-edge generator; polling is stuck |
| 0 / 7000 | Idle | Issue a request |
11. Cross-Platform Equivalents
| Controller | Modbus TCP Client Function | Equivalent of MB_MODE = 0
|
Notes |
|---|---|---|---|
| Schneider Modicon M340 | MBP_MSTR / READ_VAR | Function code 3, route through ETH port | Use ADDM function block |
| Allen-Bradley ControlLogix | MSG instruction with CIP Modbus mapping | Read Holding Registers | Requires AOI or third-party add-on |
| ABB AC500 | MODTCP client library | Function code 3, register 45001..45095 | Use MOD_TCP_M FB |
| Mitsubishi MELSEC iQ-R | MELSEC Communication Protocol + Modbus scanner | Function code 3 | Use Modbus/TCP scanner module |
| OMRON NJ/NX | Modbus TCP library FB | Function code 3 | Use Sysmac Library Modbus TCP |
All platforms share the same three failure modes: wrong remote port, wrong slave address mapping, or wrong data length. The 809B-equivalent status on other platforms is "connection refused" (Winsock error 10061) or a CIP error 0x0308.
12. FAQ
What does S7-1500 MB_CLIENT status 809B mean?
Status 809B hex indicates the TCP connection could not be established. The PLC either cannot reach the partner, the partner actively refused the SYN (wrong port), or the partner is not a Modbus server. Check RemotePort = 502, LocalPort = 0, and confirm the partner listens on TCP 502.
Why does MB_MODE = 0 work when MB_MODE = 101-104 returns 809B on the Bently Nevada 3500/92?
Modes 101-104 interpret MB_DATA_ADDR as a 1-based register number and apply automatic offset logic that fails on the 3500/92 mapping window above register 41000. MB_MODE = 0 forces FC 3 (Read Holding Registers) and uses MB_DATA_ADDR as the exact starting address the 3500/92 was configured with, bypassing the offset derivation.
What InterfaceId should I use for the second PROFINET port on an S7-1516?
The hardware identifier (InterfaceId) is a system constant generated by TIA Portal. On an S7-1516 with two PROFINET interfaces, port X1 is typically HW ID 71 and port X2 is HW ID 72. Open Devices & Networks → select the CPU → System constants tab to confirm the exact value for your firmware revision.
Must the receive DB for MB_CLIENT be non-optimised?
Yes for older firmware revisions (S7-1500 CPU firmware < V2.6). Set the receive data block to "Standard" access (non-optimised) so the MB_DATA_PTR ANY pointer can resolve to a fixed byte offset. On TIA Portal V16+ with CPU firmware V2.9 or higher, symbolic slice referencing is supported, but standard DBs remain the safest option.
What is the correct modbusDataLen for a Bently Nevada 3500/92 with 95 mapped registers?
Set MB_DATA_LEN to exactly 95. Any larger value causes the 3500/92 server to NAK the request after register 45095. Any smaller value silently truncates the response.