1. Overview
KEPServerEX is an industrial connectivity platform that bridges industrial devices with control systems. For Rheonics viscosity and density sensors, the included Smart Module Electronics (SME) enables communication across major protocols, including Modbus, facilitating the integration with customer hardware and needs. This article will walk through setting up KEPServerEX 6 to read Modbus input registers from Rheonics sensors.
KEPSeverEX 6 can be downloaded from its official website as a 100% functional demo.
Figure 1. KEPServer Diagram. Image Sourced from Kepware Website
2. Rheonics SME: Modbus TCP
The Rheonics SME offers Modbus TCP over an Ethernet interface. The Modbus protocol provides client/server communication between devices connected on an Ethernet network. As shown in Figure 2, an SME (Modbus Server) connected to a network with several Modbus clients is able to send process and status data upon request to multiple clients such as PLCs, HMIs, and more.
Figure 2. Modbus TCP Communication
KEPServer can be a viable solution for building a centralized data management system, as well as providing protocol conversion from Modbus to OPC, MQTT, or other industry-standard protocols.
3. Setting up the Ethernet Network
The first step is to successfully connect the Rheonics SME to the KEPServer Ethernet network. This involves not only creating a physical connection but also ensuring proper communication by configuring both devices on the same subnet. The exact network topology will depend on the use case and customer requirements.
3.1 Network Configuration on Rheonics SME
The Rheonics SME can be configured with the RCP software; to aid the user, Rheonics Support Portal - RCP provides several articles about minimum requirements, installing the software and most importantly: Running the RCP Program; there are two options for this: USB or Ethernet communication, both of which are described on the article.
Regardless of the communication method used, the network configuration remains the same. The detailed configuration procedure can be found at: Connecting to your SME using ethernet
3.2 Network Configuration on KEPServer
The KEPServer must be on the same local network as the SME. This procedure is well documented on the first part of the following article: Connecting to your SME using ethernet
4. KEPServerEX Settings
In KEPServerEX, setting up a Modbus connection involves several steps. It begins by creating a communication channel that defines the data path. Next, a Modbus device is added to this channel with the appropriate network settings. Finally, tags are configured to read specific Input Registers from the SME which then can be used for data logging, monitoring, or integrating with other applications.
Usually, the default settings in KEPServerEX are correct; the general recommendation is that if the user is not sure about any parameters or settings, it's best to leave them at their default values. If needed, the settings can be modified later.
4.1 Creating a Modbus Channel
Create a New KEPServerEX project or open an existing one. Start by creating a Modbus Channel, see Figure 3. Select the option Modbus TCP/IP Ethernet.
Figure 3. Creating a Modbus Channel
Make sure to select the correct Network Adapter for the Ethernet Network.
Figure 4. Network Adapter Selection
Accept all the default values suggested by KEPServer. Press Finish to add the Modbus Channel
Figure 5. End of Channel Configuration
Create as many channels as needed but take into account that multiple devices can also be added to a single channel. If the user needs to retrieve data from several Rheonics sensors, they can all be added to the same channel if they share compatible communication settings.
4.2 Adding a New Device: SME
Add a new device, which in this example will be named "SME." Choose a device name that makes sense, such as the sensor's serial number, especially if multiple devices will be added.
Figure 6. Adding a New Device
Select “Modbus” model option for general Modbus-compatible devices.
Figure 7. Modbus as Type of Device
Device IDs are specified as <HOST>.XXX. For this case HOST is the SME’s IP address. XXX is the Modbus Bridge Index, a number from 0 to 255. Since KEPServer and the SME are directly connected via Ethernet, the Modbus Bridge Index should be set to 0.
Figure 8. Device Modbus ID
For Rheonics SME, the Modbus Port is 502. It cannot be changed by the user. If a different port is needed, contact Rheonics Support.
Figure 9. Default Port 502 for Modbus
The Modbus Data Access and Data Encoding Settings configurations define how data is accessed and encoded for communication with Modbus devices. These settings define address conventions, bit-level access, supported Modbus functions, and byte order. The options for Figure 10 and Figure 11 are the default values and will work for Rheonics Sensors.
Figure 10. Data Access Settings
Figure 11. Data Encoding Settings
Click Finish to end the New Device configuration.
Figure 12. End of New Device Configuration
4.3 Creating Data Tags
Once the device has been added, the user can create as many tags as Input Registers needed. The Input Registers available are shown on Rheonics Support Portal: Modbus TCP - Input Registers. For this example, Median Viscosity (Float32) will be selected.
Figure 13. Data Tags Creation
Make sure to set the correct address and select the appropriate data type for Viscosity, as shown in Figure 14. Rheonics input registers use two data types: Float32 and SInt16. For Float32, choose "Float" as the data type; for SInt16, select "Word."
Figure 14. New Data Tag Configuration
It's possible to import and export CSV files to manage predefined tags. By pressing Export, users can save the currently created tags as a backup. Pressing Import allows users to add new tags from the imported file.
Figure 15. Importing Tags from CSV File
Figure 16 shows the tags for viscosity, temperature, and density, created for both Float and Int16 data types by importing a CSV file (SME.csv). This CSV file contains predefined configurations for the three main Rheonics parameters and will work with KEPServer's default configuration settings or if the article's guidelines are followed.
Figure 16. Tags Created on KEPServer
4.4 QuickClient
The Quick Client in KEPServerEX is a tool used to test and monitor the tags that the user has configured. It allows users to verify if the setup process was successful. To access it, select the Quick Client option from the navigation bar. A new window will open with several options.
When clicking <Channel Name>.<Device>, the tags that were created will be displayed. If live data for the configured registers appears and is continuously updating, it indicates that the configuration is correct and that the data type and input registers are properly set up.
Figure 17. Tags Created on KEPServer
5. Troubleshooting
This section addresses common issues with input registers, connectivity, and Modbus configuration. Users can follow these steps to identify and resolve typical Ethernet/Modbus communication issues with Rheonics Sensors.
Electronics Issues | |
No LED lights, display, or output signals | 1. Check power supply and cabling |
Viscosity is not stable | 2. The sensor is not fully submerged in the liquid |
Probe Issues | |
NaN values are displayed on the RCP software | 1. Check wiring from the probe to SME is correct. |
2. Measure the internal resistance of the probe. Contact Rheonics support team for detailed instructions. | |
Communication Issues | |
No data is visible | 1. Try to reset the SME and/or restart the devices |
2. Try to use the ping command to get a response from either the KEPServer or SME. | |
3. Verify there is no duplicated address in the network | |
4. Check all settings are correct with the RCP | |
5. Check that communication settings (protocol, port 502, network adapter, and device IP) are correct on KEPServer side | |
6. Look for hardware malfunction, broken cable or bad Ethernet Port | |
Data issues | |
The measured value is different from my reference standards | 1. If the fluid is non-Newtonian, the viscosity readings may vary due to the fluid's characteristics (shear rate). For more information: Non-Newtonian fluid viscosity measurement with inline viscometer SRV |
Wrong parameter reading | 1. Verify Modbus register address. It might be off due to 0/1 indexing. |
2. Verify the data type matches the expected configuration. | |
Sensor Status does not match any bit from the sensor status table | 1. Sensor status byte is swapped. |
Density value displayed is always constant | 1. The density value on the SRV is constant value set with the RCP software. |
6. References
- Rheonics, "SRV Inline Viscometer." [Online]. Available: Rheonics SRV » inline online Viscometer for fluid viscosity monitoring . [Accessed: Nov. 27, 2024].
- Rheonics, "SRD Inline Density Meter." [Online]. Available: Rheonics SRD » Density Meter inline online specific gravity concentration. [Accessed: Nov. 27, 2024].
- Rheonics, "Electronics and Communication." [Online]. Available: Electronics and Communication » rheonics :: viscometer and density meter. [Accessed: Nov. 27, 2024].
- Rheonics, "Modbus TCP Input Registers." [Online]. Available: Modbus TCP - Input Registers . [Accessed: Nov. 27, 2024].