Modbus TCP communication setup with a PLC 


Rheonics Sensors support Modbus RTU and TCP. For Modbus TCP, ethernet connection is required.

The example below shows the connection steps and configuration of Modbus registers on a PLC. This example uses B&R X20 PLC and B&R Automation studio to configure the communication.


Prerequisite:


A PLC which supports Modbus TCP either natively or through an expansion module

Rheonics Sensor Electronics (SMET) with Ethernet and Modbus TCP enabled

Ethernet on SMET should be set to either DHCP or Static IP through RCP

IP address of the Rheonics SMET - this can be read out from the SMET using RCP software


Ethernet Connection

The sensor electronics (SMET) can be connected directly to the B&R control with an RJ45 Ethernet cable. Alternatively, a router, switch or hub can be used to connect the sensor and PLC to the factory LAN.


PLC configuration steps for establishing Modbus communication

This project uses B&R Automation Studio to setup Modbus TCP commenucation between the Sensor electronics and a B&R PLC. A project has already been created in Automation Studio and the corresponding PLC from B&R has been added.


Interface configuration


The numbers in front of the text are highlighted in front of the steps performed.


1, 2         Select Physical View and select the desired interface for the Modbus configuration. 

3             Open Configuration of the interface.

4             Select Mode: enter IP address manually. (For direct connection of the sensor to the PLC) Enter an IP address with a suitable subnet mask for the interface. 

5             Activate Modbus communication = on    



Addition of TCP_any interface

1              Select the interface in the Physical View.

2              Search for Modbus in the Toolbox.

3              Add Modbus Tcp_any by double-clicking.

4              Modbus Tcp_any appears graphically in the System Designer.



Configuration of Modbus Tcp_any

1              Select Modbus Tcp_any.

2              Call up the configuration of Modbus Tcp_any.

3              Specify the IP address for the sensor. (Same range as the address of the interface)

                Specify TCP Port 502.



Configuration of Modbus Tcp_any according to the example form the Modbus manual

 

Define Block 1 in the Tcp_any configuration according to the example of the Rheonics Modbus-Manual - Commands and use.


Define channels according to the Rheonics Modbus-Manual - Input Registers - specify data to be read


Repeat steps for all the measurement parameters from the sensor you want to access from your PLC.


Modbus related downloads & links


The following is a list of modbus manuals, register tables, and configuration files that are provided here to simplify the integration of Rheonics sensors with a PLC when using Modbus TCP.


Rheonics Modbus TCP Manual

Rheonics Modbus registers support articles


Modbuspoll configuration file for input registers [download link, for use with modbuspoll software]

  • input registers
  • extended input registers (externally writable modbus register and estimated parameters)
  • 4-20mA configuration registers
  • Location configuration registers
  • Ethernet configuration registers
  • Sensor s/n, Hardware and Firmware version registers



Troubleshooting


How to connect ethernet cable to Rheonics electronics?

See the support knowledge article on connecting ethernet cable to sensor electronics.


How to get the IP address of the Rheonics Sensor connected to the LAN?

Using RCP software, you can both check the assigned IP address and also assign a static IP address or switch the unit to DHCP.


How to check Modbus registers on the Rheonics sensor using PC?

Users can use Modbus polling software to check the modbus registers on the Rheonics sensor using a PC. Modbuspoll is an external software that can be used.


[We do not imply any guarantee or undertake any liability for your use of the software, use of any third party software is up to the customer]


Rheonics sensor electronics SMET does not get an IP address

Check that the sensor was ordered with ethernet and Modbus TCP option.

Check the ethernet setting on the network where the sensor is connected.

If a direct connection is used to PLC then ensure the sensor is assigned an IP address and subnet as needed by the PLC. Refer to the Modbus TCP support article to configure static IP address for the sensor.


References


Rheonics Control Panel software manual 

Rheonics Modbus TCP manual

Rheonics SRV, SRD, DVP and DVM product manuals

Inline viscometer SRV product page

Inline density and viscosity meter SRD product page

HPHT probe density and viscosity meter DVP product page

HPHT inline flow through density meter and viscometer DVM product page