Basic Blueprint: Integrating Modbus TCP Indicators with Siemens PLCs (Register Mapping Guide)
Introduction: The Integration Challenge in Industrial Weighing
In modern industrial automation, the core function of a weighing indicator extends beyond simple weight display; it must communicate measurement data reliably to the central control system, typically a Programmable Logic Controller (PLC). Modbus TCP is a common protocol used for this data exchange due to its widespread compatibility and simplicity. However, integrating a Modbus TCP weighing indicator with a sophisticated PLC platform, like Siemens S7-1500 or S7-1200, requires careful configuration and, most critically, accurate register mapping. This guide provides a blueprint for ensuring seamless and robust data flow.
Understanding the Modbus TCP Protocol
Modbus TCP/IP is an application layer messaging protocol that provides client/server communication between devices connected on an Ethernet network. In a weighing application:
- The Siemens PLC typically acts as the Client (Master), initiating requests for data.
- The Weighing Indicator acts as the Server (Slave), holding the weight data in specific memory addresses (registers).
Key Modbus Register Types
The PLC interacts with the indicator's memory using standard function codes:
- Holding Registers (Function Code 03/16): Used for reading/writing configuration parameters and reading the primary weight value. These are the most common registers for weight data.
- Input Registers (Function Code 04): Used for reading discrete input data, often read-only diagnostic or status codes.
Step-by-Step Siemens PLC Configuration (Blueprint)
Integrating the Modbus TCP client function into a Siemens PLC (using TIA Portal) involves three main steps:
Step 1: Network Setup
- Assign the weighing indicator a static IP address.
- In the TIA Portal hardware configuration, ensure the PLC’s Ethernet module and the Modbus server (indicator) are on the same subnet.
Step 2: Implementing the Modbus Client Block
- The primary function block is typically MB_CLIENT. This block handles the communication handshake and data request/response.
- Key Parameters:
- CONNECT_ID: A unique ID for the communication connection.
- IP_ADDR: The static IP address of the weighing indicator (the Modbus Server).
- PORT: The standard Modbus TCP port (typically 502).
Step 3: Execution Logic
The MB_CLIENT block must be called cyclically (e.g., every PLC scan). The logic must manage the REQ (Request), DONE, and ERROR outputs to ensure continuous, non-blocking communication.
The Critical Step: Register Mapping Guide
The process of Register Mapping is the single most important step. It defines where the indicator stores its data and where the PLC should look.
| Weighing Data | Modbus Address (Dec) | Data Type (Indicator) | Data Type (PLC Read) |
|---|---|---|---|
| Net Weight (Primary) | 40001 (Example) | 32-bit Float | PLC reads 2 consecutive Holding Registers. |
| Gross Weight | 40003 (Example) | 32-bit Float | PLC reads 2 consecutive Holding Registers. |
| Status Word / Flags | 40010 (Example) | 16-bit Integer | PLC reads 1 Holding Register. |
| Target Weight Value (Write) | 40020 (Example) | 32-bit Float | PLC writes 2 consecutive Holding Registers. |
Addressing Caveat: Modbus addressing conventions vary (zero-based vs. one-based). Always consult the specific weighing indicator's technical manual to confirm the starting address (e.g., 40001 vs. 40000) and the byte swap order (Endianness).
Data Handling and Optimization
Since Net Weight is typically a 32-bit Floating Point value (requiring two 16-bit Modbus registers), the Siemens PLC must correctly handle the data concatenation and conversion:
- Data Block (DB): The received raw 16-bit integer data must be transferred to a temporary DB in the PLC.
- Conversion: Use the PLC's built-in P_R_F (Packed to Real Float) instruction to combine the two 16-bit integers back into a single 32-bit floating-point number that the PLC can use for scaling and logic.
- Error Handling: Implement logic to check the ERROR output of the MB_CLIENT block. If an error is detected, the PLC should use the last known good weight value and signal an alarm, preventing the automation process from using corrupt data.
Successful Modbus TCP integration is achieved not by protocol knowledge alone, but by rigorous adherence to the specific register definitions provided by the weighing instrument manufacturer, ensuring that the PLC and the indicator speak the exact same data language.





