1. What is Modbus TCP?

Modbus TCP is an open industrial Ethernet protocol based on the Modbus standard, enabling communication between devices over TCP/IP networks. It uses Ethernet as the physical layer (defined by IEEE802.3) and encapsulates the traditional Modbus message structure within TCP frames.

It's a request-response protocol, where clients (masters) send requests to servers (slaves) to read or write data. Modbus TCP supports real-time communication for tasks such as reading sensor data or controlling actuators with minimal delays.


2. How does Modbus TCP work with Rheonics Inline Viscometers?

Rheonics inline viscometers and density meters support Modbus TCP out of the box, thanks to its Smart Measurement Electronics (SME), making the integration of our SRV and SRD sensors into customers' processes straightforward and seamless.

Modbus TCP communicates over Rheonics SME's Ethernet port, utilizing the standard TCP/IP stack for digital communication. The protocol supports function code 04 (Input Registers), which reads input registers to retrieve data such as viscosity, temperature, and density measurements from our viscosity and density sensors.


If you are looking for additional information about Modbus TCP for Rheonics Viscometers, visit Rheonics Support Portal



3. Modbus TCP Frame Structure

The structure of the request and response body in Modbus TCP connections, from the function code to the end of the data portion, has exactly the same layout and meaning as in the other MODBUS variants, such as Modbus RTU or Modbus ASCII. The only differences in these other cases are the form of any ‘framing’ sequence, error check pattern, and address interpretation.

The command and response are prefixed by eight bytes as follows:


Byte
Description
byte 0:transaction identifier – copied by server – usually 0
byte 1:transaction identifier – copied by server – usually 0
byte 2:protocol identifier = 0
byte 3:protocol identifier = 0
byte 4:length field (upper byte) 
byte 5:length field (lower byte) 
byte 6:unit identifier 
byte 7:MODBUS function code
byte 8 onwards:Data


Table 1. Modbus TCP framing

To learn more about the command and response, take a look at Modbus TCP/IP Command and Response Examples: Rheonics Support.



4. Input Registers and Parameter Mapping


The SME responds to Modbus function code 0x04, allowing Modbus TCP Clients to read the input registers where all the parameters are mapped. All other Modbus TCP function codes are not used and are therefore not covered in this article.

 
Function Code (Dec
Name
Description
04Read Input RegistersRead Analog Inputs (AI)


Table 2: Supported Modbus Function Code

The measured parameters are mapped into the Modbus input registers; the variable associated with each parameter is listed in Table 3. 


ParameterMeasurandDescription
Parameter 0Viscosity median Takes the median of the last 5 sensor measurements points
Parameter 1Density median
Parameter 2Temperature median
Parameter 3Kinematic Viscosity
Parameter 4Density averageCalculates the average of the last 5 measurement points
Parameter 5Viscosity raw ‘process measurement’Reads the direct measurement taken by the sensor.
Parameter 6Density raw
Parameter 7Temperature raw
Parameter 12Viscosity Last GoodKeeps the last-good median measurement in memory when there is a measurement error
Parameter 13Density Last Good
ErrorError StateError state of the sensor


Table 3. Measured parameters list


A detailed list of Input Registers is available on the Rheonics Support Portal in the article: Modbus TCP - Input Registers.


If you are having issues with Modbus TCP, take a look at our Modbus TCP Troubleshooting Article



5. References


  1. MODBUS Organization, MODBUS Application Protocol Specification V1.1b, June 2006. [Online]. Available: https://www.modbus.org/specs.php [Accessed: Jan. 8, 2025].
  2. Rheonics, "SRV Inline Viscometer." [Online]. Available: Rheonics Inline Viscometer - SRV [Accessed: Jan. 8, 2025].
  3. Rheonics, "SRD Inline Density Meter." [Online]. Available: Rheonics Inline Viscosity-Density Meter. [Accessed: Jan. 8, 2025].
  4. Rheonics, "Electronics and Communication." [Online]. Available: Rheonics Electronics and Communications. [Accessed: Jan. 8, 2025].
  5. Rheonics, "Modbus TCP Input Registers." [Online]. Available: Modbus Input Registers. [Accessed: Jan. 8, 2025].