How to Poll Multiple Modbus RTU Slaves via Modbus TCP Gateway Using CP 443-1 in PCS 7
To poll multiple Modbus RTU slaves connected to a Modbus TCP gateway (such as a Moxa MGate) using CP 443-1 in PCS 7 V9.1, use a single MB_REDCL (or MBTCP_Client) connection configured with a sequential Job List (JOBLST). Because the gateway's serial RS-485 link is half-duplex, NetPro forbids multiple client instances sharing the same connection ID. For slaves with identical register maps, configure discrete jobs in JOBLST specifying the target Unit ID (slave address) and write the polled data into distinct offsets of a shared data block, or deploy a CFC copy multiplexer to unload values into dedicated slave DBs upon job completion.
Table of Contents
- Half-Duplex Constraints and MB_REDCL Job List Architecture
- Configuration Workflow and Register Mapping in Shared Data DBs
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Half-Duplex Constraints and MB_REDCL Job List Architecture
In industrial communication networks, integrating serial Modbus RTU field devices (such as energy meters, power monitors, or variable speed drives) into SIMATIC PCS 7 commonly utilizes an Ethernet-to-serial gateway (e.g., Moxa MGate MB3180):
* The gateway listens on Ethernet TCP port 502 on the PCS 7 Plant Bus side.
* It bridges incoming Modbus TCP packets to an RS-485 serial multidrop bus on the field side.
* Up to 16 or 31 Modbus RTU slaves reside on the RS-485 cable, each distinguished by a unique Unit ID (slave address 1 through 247).
Engineers attempting to instantiate multiple MBTCP_Client or MB_REDCL blocks in CFC to poll these slaves in parallel encounter immediate barriers:
1. Connection ID Exclusivity: NetPro establishes a single TCP connection (ID = 1) to the gateway's IP address. Two independent client blocks cannot access the same local connection ID simultaneously.
2. Serial Bus Half-Duplex Bottleneck: RS-485 allows only one transmitter on the wire at any instant. Attempting to send parallel queries through multiple client blocks causes packet collisions and gateway buffer overflows.
3. Sequential Polling Mandate: All communication through a single-port serial gateway must proceed sequentially: Query Slave 1 -> Await Response -> Query Slave 2 -> Await Response.
The Siemens SIMATIC Modbus/TCP Redundant Client library (MB_REDCL / FB 1081) natively provides the Job List (JOBLST) architecture to solve multi-device polling:
* Instead of running separate client blocks, a single MB_REDCL instance executes an array of communication tasks defined in a parameter Data Block.
* Each entry in the JOBLST defines: Unit ID (target slave address), Function Code (e.g. FC 03), Start Register (e.g. 40001), Length, and Data DB Pointer.
* The block automatically steps through the job list sequentially. When Job 1 concludes, it advances immediately to Job 2, ensuring deterministic, collision-free serial arbitration.
Configuration Workflow and Register Mapping in Shared Data DBs
When multiple identical field devices share identical register addresses, the PCS 7 Modbus Configuration Wizard restricts creating multiple overlapping data DBs. To store each slave's data in dedicated variables without memory overwrite:
- Configuring Memory Offsets inside a Single Master DB:
* Create a single large Data Block (DB_Modbus_Buffer).
* Allocate dedicated arrays:Meter_01(Bytes 0 to 39),Meter_02(Bytes 40 to 79), throughMeter_09(Bytes 320 to 359).
* In theJOBLST, configure Job 1 targetingDB_Modbus_Bufferstarting at byte offset0, Job 2 targeting byte offset40, and so forth. - Step-by-Step Engineering Sequence:
* In NetPro, configure an Unspecified TCP Connection from the CP 443-1 to the gateway IP address on port502. Note the local Connection ID (e.g.,16#0001).
* Launch the Modbus/TCP Configuration Wizard in SIMATIC Manager and generate the Modbus Parameter DB (MODBUS_HPARAM_CP_1).
* Open the parameter DB, expandJOBLST, and configure Unit ID, function codes, lengths, and distinct DB offsets for each slave.
* PlaceMB_REDCLin a cyclic OB (OB32 or OB35), interconnect the parameter DB, and enable cyclic execution (EN_R := TRUE).
Verification
- In CFC, open
MB_REDCLin test mode. - Verify that
ACT_JOBcycles continuously through numbers1through9. - Confirm that output
STATUSreports16#7000(Idle) or16#7002(Receiving) without assertingERROR = 1. - Open
DB_Modbus_Bufferin dynamic monitor mode. Confirm that live measurement data for each slave updates at expected polling intervals.
Limitations and Operational Precautions
- Serial Polling Latency: On a 9600 baud serial bus, reading 20 registers typically requires 150 to 250 ms per slave. Polling nine slaves sequentially results in a cycle refresh time of ~2 seconds. Do not utilize single-port serial gateways for high-speed sub-second interlocking.
- Set gateway serial communication timeouts realistically (typically 500 ms to 1000 ms). If one offline slave times out,
MB_REDCLmust not hang; configure timeout retry counts to 1 or 2 so the sequence advances quickly to healthy slaves. - For multi-drop RS-485 buses, ensure proper 120 Ω bus termination resistors are enabled at both physical physical ends of the cable.
Engineer FAQ
- Can I speed up polling by adding a second gateway?
Yes. Splitting the nine slaves across two separate gateways allows you to configure two independent TCP connections in NetPro, executing parallel polling across two separate serial networks simultaneously. - Why did the Modbus Wizard reject my second parameter DB?
The wizard enforces a 1:1 relationship between a local connection ID in NetPro and the parameter DB. To configure another parameter DB, you must establish an independent connection in NetPro. - What happens if one Modbus slave is powered off?
The gateway returns a Modbus Exception 0x0B (Gateway Target Device Failed to Respond) or times out.MB_REDCLlogs an error for that specific job and advances immediately to the next job in the list.
Technical References
- SIMATIC Modbus/TCP Redundant Communication via CP 443-1 Manual (A5E01099652-AA).
- Moxa MGate MB3180 / MB3280 Modbus Gateway User Manual.
- Modbus Application Protocol Specification V1.1b3.
Related Articles
- Sizing Baud Rates and Polling Cycle Times on Industrial Modbus RS-485 Networks.
- Implementing High-Availability Redundant Modbus/TCP Master Architectures in PCS 7.
Related Tags
PCS 7, Modbus TCP, Modbus RTU, CP 443-1, Moxa MGate, MB_REDCL, JOBLST, S7-400