What products are involved?
Rheonics SRV viscometer, SRD density-viscosity meter, DVP gas density-viscosity meter, and DVM HPHT density viscosity meter
What is the purpose of this article?
This article describes the procedure for integrating Rheonics Smart Module Electronics unit (SME) with the Modbus TCP protocol into a LOGO! Siemens.
1. Overview
Rheonics viscosity and density meters bring fluid intelligence and process control to a broad range of customer applications. Each sensor is equipped with an SME, which drives the sensor, evaluates its response, and enables communication through all major communication protocols
This article guides integrating an SME's digital Modbus TCP signal with a Siemens LOGO! controller, with a special emphasis on LOGO! Soft Comfort configuration.
Figure 1. LOGO! Siemens. Image sourced from Siemens website.
2. LOGO! Limitations
Rheonics SME provides several Modbus Input Registers that customers control needs. The information can be found at Rheonics Support: Modbus TCP input registers . Each of the 22 parameters is available in Float32 and SInt16, with SInt16 values scaled by 100.
When using a Siemens LOGO! controller, there are some limitations to consider:
- No Support for Floats: LOGO! does not support floating-point numbers, so all calculations must use integer values.
- 16-Bit Signed Range: LOGO! operates within a range of -32,768 to 32,767 (16-bit signed integers).
At first glance, it seems necessary to choose SInt16 registers; however, this would limit the maximum viscosity value to around 327 cP (since LOGO! operates in a range of -32,768 to 32,767, and SInt16 values are scaled by 100). For instance, a sensor reading of 327 cP would be represented as 32,700, which uses nearly the entire range.
Fortunately, LOGO! offers a workaround by providing a feature to convert 32-bit values into a 16-bit format which will be explained in later steps.
3. SME’s Modbus TCP
Rheonics SME offers Modbus TCP over an Ethernet interface. The Modbus protocol provides client/server communication between devices connected to 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.
4. Modbus TCP on LOGO! Siemens
Modbus compatibility, especially with older versions of LOGO! can be confusing. LOGO! 8 and LOGO! 8.1 devices share the 0BA8 order number but are differentiated by firmware versions. Firmware versions FS01-FS03 are initial releases. Only units starting from LOGO! 8 FS:04 support Modbus.
Device | Order Number and FS Number | LOGO!Soft Comfort Version |
LOGO! BM | 6ED1052-xxxxx-0BA8 / FS01-FS03 | LOGO!Soft Comfort V8.4 and later versions |
6ED1052-xxxxx-0BA8 / FS04-FS06 | ||
6ED1052-xxx08-0BA0 | ||
6ED1052-xxx08-0BA1 | ||
6ED1052-xxx08-0BA2 |
Table 1. LOGO! Versions from Order Number.
5. Setting up the Ethernet Network
The first objective is to successfully connect the Siemens LOGO! and Rheonics SME on the same Ethernet network. The specific network topology will depend on the use case and customer requirements. No matter which setup is used, both the SME and the LOGO! need to be configured properly. During the configuration process, the user will need to change the PC's IP address to match the IP address range of the device being configured, this procedure is well documented in the first part of the following article: Connecting to your SME using ethernet
5.1 Network Configuration on Rheonics SME
Rheonics SME is 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: How to connect the computer to the SME; there are two options for this: USB or Ethernet communication, both of which are described on the article.
Regardless of the communication method chosen, the network configuration remains the same. The detailed network configuration procedure can be found at: Connecting to your SME using ethernet
5.2 Network Configuration on LOGO! Siemens
The LOGO! comes with a default IP address of 192.168.000.003. If it has an in-built display, the user can navigate through the screens and configure the network address directly on the device. Figure 3 shows the Network Configuration screen.
Make sure to enter the appropriate IP Address and Subnet Mask. It should be on the same subnet as the SME (same Ethernet network). An incorrect network configuration may prevent the device from communicating with others on the network.
Another option is to configure the IP address using LOGO! Soft Comfort and then upload the program. This approach requires the user to set the computer's IP address to the default range of the LOGO! at the start of the configuration process. This is described in the next section.
6. LOGO! Soft Comfort
6.1 New Device Configuration
After opening LOGO! Soft Comfort, go to Network View to add a new device, and enter the LOGO! configuration.
6.2 Add a New Modbus Device
Now that's a LOGO! device has been added. The user needs to add the Rheonics SME as a Modbus Server: a device that responds to Modbus requests from the clients. Select a new Device as a Modbus-compatible device, as seen in Figure 5. Make sure to enter the appropriate configuration that was set on the RCP.
Figure 5. Add a new Device: SME
Once the configuration is set click OK. Soft Comfort will add a new device to the project’s network view.
The boxes marked with a red square indicate a Modbus connection. A connection must be established between the devices to communicate via Modbus. Click and hold one of the single boxes on the LOGO! device, then drag it to one of the boxes from the SME.
A new Modbus connection will be created, as shown in Figure 7.
6.3 Modbus Mapping
When creating the connection, dragging from the LOGO! to the SME assigns roles differently than dragging in the opposite direction. Make sure the SME is configured as the Server, as shown in Figure 7. If it is not, delete the connection and create it again.
The Modbus Connection screen is also where the Modbus registers are mapped to LOGO! memory addresses. To illustrate how it works, let's assume the user wants to read the Viscosity value. All Modbus TCP Input Registers are available on the Rheonics Support Portal at Modbus TCP - Input Registers.
Additionally, in-depth protocol documentation on data types, response types, testing with Modbus Poll, and troubleshooting can be found on the Rheonics Support Portal - Modbus TCP (Ethernet).
From Rheonics documentation the information from Table 2 is known:
Address | Register | Length | Type | Description |
40 | 300041 | 2 | Float32 | Parameter 0 value as float (Viscosity) |
Table 2. Viscosity Modbus Register
Add a new field with the Input Register address, direction, and length, as shown in Figure 8. For the memory address type, several options are available. For Rheonics applications where only Input Registers are being mapped, VW is always selected.
Figure 8. Selecting VW for new Input Register Mapping
Now, the LOGO! will request Input Register 41 from the SME and store the Float32 value in two words: VW0 and VW2. Add as many Input Registers as needed, based on the project requirements, taking care to avoid overlapping words when new registers are added.
6.4 Reading Modbus Data
As shown previously, Rheonics Input Registers are mapped to Siemens LOGO! at the specified word, allowing the user to retrieve data from the sensor for process monitoring or control. To make use of this data, LOGO! needs specific instruction blocks in the program. Two key blocks for this are:
- Analog Input Block
- Float/Integer Converter Block (Recommended)
Each block serves a specific purpose, depending on the Input Register data type. As shown in Modbus TCP - Input Registers, there are two types: Float32 and SInt16. The Analog Input Block is more suitable for SInt16 registers, while the Float/Integer Converter Block is ideal for Float32 registers.
6.4.1 Network Analog Input
To read a word (VW) stored in local variable memory, the Network Analog Input Block is used. This block allows the user to read a word and use it in the program. To add the block, select Network Analog Input on the left side, under Network, and click and drag the block to add it to the diagram.
Network Analog Input works with SInt16 type variables, which utilize single-word data. It is suitable for reading registers shown on Modbus TCP - Input Registers: with a SInt16 type. To read a Float32 the Float/Integer Converter block is needed.
Figure 9. Analog Input Block on LOGO! Soft Comfort
6.4.2 Float/Integer Converter
Since LOGO! does not natively support floating-point numbers and can only perform logic and calculations using integers, the Float/Integer Converter block is the only available option to work with a Float32 data type stored in local variable memory (2 words). To add it, select Float/Integer Converter under the Miscellaneous section on the left side. Then, click and drag the block to place it in the diagram.
Figure 10. Float/Integer converter block on LOGO! Soft Comfort
The block takes a floating-point value stored in the VM Address, divides it by a setting called “resolution”, and outputs an integer that LOGO! can use. All remaining decimals are discarded. Figure 11 shows the settings for the Float/Integer converter.
Figure 11. Float/Integer converter block settings
Typical ranges for viscosity, density, and temperature in default units available on Modbus are shown in Tables 3, 4, and 5 with recommended resolutions and the resulting Integer value (LOGO! column).
Resolution | Viscosity Range | LOGO! |
1 | 0 - 3,000 cP | 0 - 3,000 |
0.1 | 0.0 - 3,000.0 cP | 0 - 30,000* |
Table 3. Viscosity Range Based on Resolution Settings
*The range 0 to 30,000 corresponds to 0 g/cc to 3,000.0 g/cc as integers. The user must account for the decimals properly in the program.
For viscosity, resolutions 1 and 0.1 are suitable for most applications. A resolution of 0.1 would allow the user to represent single-decimal values as integers (LOGO! column).
Resolution | Density Range | LOGO! |
0.1 | 0.0 - 1.5 g/cc | 0 - 15* |
0.01 | 0.00 - 1.50 g/cc | 0 - 150* |
Table 4. Density Range Based on Resolution Settings
*The range 0 to 15 corresponds to 0 g/cc to 1.5 g/cc as integers. The user must account for the decimals properly in the program. The same applies to 0 - 150.
Density readings from Modbus TCP are represented in g/cc. For precise control, at least one decimal place should be considered (0.1 resolution).
Resolution | Temperature Range | LOGO! |
1 | -20°C - 150 °C | -20 - 150 |
0.1 | -20.0°C - 150.0 °C | -200 - 1,500* |
0.01 | -20.00°C - 150.00 °C | -2,000 - 15,000* |
Table 5. Temperature Range Based on Resolution Settings
*The range -200 to 1,500 corresponds to -20.0°C to 150.0°C as integers. The user must account for the decimals properly in the program. The same applies to -2,000 to 15,000.
For the temperature, as in previous cases, the choice would depend on the decimals needed for the application.
Figure 12 shows the configuration for the block chosen for this example, a Float (Viscosity) stored at VM Address 0 and a resolution of 1.
Figure 12. Float/Integer Converter Block on LOGO! Soft Comfort
6.4.3 Analog Block
To successfully run the program, an Analog Block is needed to complete the circuit and display the value to the user. Click Analog Flag, under Analog, and drag it to the diagram to add it to the program.
Figure 13. Analog Flag Block
7. Uploading the Program to LOGO!
With the program ready and the SME configured, the final step is to upload the program to the LOGO! by clicking the icon shown in Figure 14.
A pop-up window will appear. If needed, enter the LOGO IP address and click OK.
Figure 15. Connection PC - LOGO!
8. Online Test
Finally, for easy visualization of the process, the online test feature will display the Modbus Registers in real-time.
Figure 16. Online Test Button
During the online test, the LOGO! the system successfully reads a value of 34 cP from a Modbus register, which can be used for further control actions. If a different resolution, such as 0.1, is applied, values like 341 cP or 345 cP will appear with the last digit representing a decimal place (e.g., 34.1 cP or 34.5 cP).
Figure 17. Online Test
Since LOGO! doesn’t support floating-point values, we can work with scaled integers as a workaround (e.g., representing 10.5 as 105 or 20.2 as 202). However, for display purposes, it’s often more appropriate to show the actual values instead of the scaled numbers. Certain blocks, like the Analog Amplifier (Figure 18), allow the user to specify the number of decimal places shown in the LOGO! Display
Figure 18. Analog Amplifier
The message text block allows the user to display both text and variable values. In Figure 19, a Float/Integer converter with a resolution of 0.100 is used, so a value of 293 is displayed as 29.3 cP. The Analog Amplifier Block (B002) is configured to show one decimal place on the message block, and in a live test, the LOGO! display correctly shows 29.3 cP.
Figure 19. Message Text and showing decimal numbers
9. Troubleshooting
One of the most common issues, especially in the early stages of configuration, is incorrect network settings. A helpful tool for testing connectivity is the ping command (ping <LOGO! IP address>), which can be run in the command prompt. A successful ping response indicates that the network configuration is likely correct.
Figure 20. Ping Command on Command Prompt
The two most common causes for connectivity issues are:
- A damaged or improperly crimped Ethernet cable.
- Misconfiguration, such as incorrect IP addresses or subnet masks.
10. Rheonics Digital Signals
Digital communication protocols like Modbus TCP have significantly improved industrial communication by addressing the limitations of traditional analog signals. While analog communication, such as 4-20 mA current loops, has been a longstanding standard due to its simplicity and low cost for basic measurements, it falls short in several critical areas.
- Multiple Data Transmission: Unlike analog signals that transmit only one piece of information per channel, digital protocols allow multiple data types to be sent over a single interface simultaneously.
- Resistance to Electrical Interference: Digital signals are inherently less susceptible to electrical noise, making them ideal for industrial environments with high electromagnetic interference.
- Scalability and Flexibility: Digital networks enable multiple devices to communicate over a single network cable or wireless connection. This scalability reduces wiring complexity and facilitates system expansion.
The choice between analog and digital communication ultimately depends on the application. However, for precise and dependable viscosity control, the use of digital communication is highly recommended. For detailed information on all available communication options for Rheonics viscosity and density meters, visit Communication: Rheonics Support Portal.
11. References
- Rheonics, "SRV Inline Viscometer." [Online]. Available: Rheonics SRV » inline online Viscometer for fluid viscosity monitoring . [Accessed: Nov. 26, 2024].
- Rheonics, "SRD Inline Density Meter." [Online]. Available: rheonics SRD » Density Meter inline online specific gravity concentration. [Accessed: Nov. 26, 2024].
- Rheonics, "Electronics and Communication." [Online]. Available: Electronics and Communication » rheonics:: viscometer and density meter. [Accessed: Nov. 26, 2024].
- Rheonics, "Modbus TCP Input Registers." [Online]. Available: Modbus TCP - Input Registers. [Accessed: Nov. 26, 2024].
- Siemens, LOGO! Soft Comfort Online Help Operating Instructions, Version 08/2024. [Embedded Manual].
- Siemens, LOGO! – Modbus/TCP Communication using the Example of SENTRON PAC, Entry ID: 109779762, Version 1.0, July 2020. [Online]. Available: SIOS. [Accessed: Nov. 26, 2024].