Use the Modbus client
Scan Modbus devices through the gateway, interpret and write registers, and add devices and registers as data points in Evolo.
Written By Evolo Support
Last updated 9 days ago
With the Modbus client, you can read the registers in a Modbus TCP device through the gateway, determine the correct interpretation of the values, and add the registers as data points in Evolo. This works for both devices that are already in Evolo and devices that haven’t been set up yet.
Whatever you enter in the Modbus client goes directly to the device in the building. In other words, it changes the device itself, not just Evolo.
Open the Modbus client
Open the gateway
Go to Configuration → Gateway and click on the gateway.
Select the tab
Select the Modbus Client tab.
The Modbus client requires Evolo Gateway 2.9.0 or later. It supports Modbus TCP. Devices on RTU (serial) can be accessed via a TCP-to-RTU gateway.
Select a device
Under Devices, the Modbus interfaces on the gateway are listed in the In Evolo group. The dot next to each device indicates whether it is responding. Click on a device to open it.
For a device that hasn’t been set up in Evolo yet:
Scan for a new device
Click Scan for New Device and enter the IP address, Port (usually 502), and Unit ID.
Connect
Click Connect. The device is now listed under Manual.
Find Unit IDs
If there are multiple devices behind a single IP address—for example, behind a TCP-to-RTU gateway—enable Find Unit IDs. Select From Unit ID and To Unit ID, then click Search for Unit IDs. The matching Unit IDs will appear as selectable options.
The search stops after 50 seconds. Click Continue from here to continue searching.
Device Information
When no register is selected, the panel on the right displays the address, unit ID, word order, and connection settings. Use Read Identification to retrieve the manufacturer, product, and version from the device (FC 43/14). Many devices do not respond to this, but the scan will still work.
The client uses its own connection, so data collection to Evolo continues as usual while you scan.
Scan the Registers
Select a function code
Select Function Code: FC 1 Coils, FC 2 Discrete Inputs, FC 3 Holding Registers, or FC 4 Input Registers.
Select range
Enter the Start Address and Count, then click Scan. You can scan up to 10,000 addresses at a time.
The addresses are 0-based protocol addresses. Holding register 40001 in the manufacturer’s register map is address 0. The table shows both.
If the device does not respond across the entire range, or if the scan takes more than 50 seconds, only the data that was read is displayed. Click Continue from address to read the rest.
Interpret the Values
The table shows the raw value, hex value, and interpreted value for each address. Select Data Type for All or the data type per row, and choose Normal or Swapped word order for 32- and 64-bit values. A 32-bit value uses two registers, and a 64-bit value uses four.
Unsure of the data type? Click on a row. Under Interpretations, you’ll see the same raw value interpreted in every possible way. Select the one that yields a reasonable number, and the table will use that.
Registers that are already data points in Evolo display the name of the data point.
Change a value
Coils (FC 1) and holding registers (FC 3) can be written to. Click on a row, select “Change Value,” enter the new value, and click “Write.” The value is read back after writing, so you can see that the device accepted it. If the device rejects the value, you’ll see the Modbus exception, such as 03 (Illegal Data Value).
Add to Evolo
Add the device
If the device is not in Evolo, click Add next to the device in the list. Give it a name and select the word order. It will be added as a device and a Modbus TCP interface.
Select the registers
Select the registers you want as data points, or enter a name in the Name column. Click Add in Evolo.
Review the data points
A prefix (optional) is added before the name, for example, VP1 . Check the data type, unit, and weighting. The Value column in Evolo shows what the value will be. Check Log values and select Interval to start logging immediately.
Add
Click Add.
Select a register from a data point
When editing a Modbus data point, you can click Select in the Modbus client. Scan to find the register, then click “Select.” The function code, address, and data type are then populated in the data point.
Scanning and reading require the "Read Gateways" permission. Writing values and adding devices require "Configure Gateways," and adding data points requires "Configure Data Points."
Troubleshooting
“The device did not accept the connection”
“The device did not accept the connection”
Probable cause:
Many Modbus devices accept only one connection at a time, and the gateway is already connected to collect data.
Solution:
Increase the number of allowed connections on the device if possible. Otherwise, turn off “Enabled” on the interface while scanning, and turn it back on afterward. While the interface is off, values are not collected from the device.
“The device did not respond”
“The device did not respond”
Probable cause:
Incorrect IP address, port, or unit ID, or the device is responding slower than the timeout.
Solution:
Check the address. Behind a TCP-to-RTU gateway, you can use “Find Unit IDs.” Increase the timeout for slow devices.
No addresses are responding
No addresses are responding
Probable cause:
The device has no registers in that range, or is using a different function code.
Solution:
Check the manufacturer’s register map. Remember that addresses are 0-based, so 40001 is address 0 on FC 3. Try FC 4 if FC 3 does not respond.
The value looks incorrect
The value looks incorrect
Probable cause:
Incorrect data type, word order, or weighting.
Solution:
Click on the row and look under Interpretations. Switch between normal and swapped for 32- and 64-bit values. Use Weighting when the device sends, for example, tenths.
The tab is requesting an update
The tab is requesting an update
Probable cause:
The gateway is older than version 2.9.0.
Solution:
Update the Evolo Gateway to version 2.9.0 or later.
Was this helpful?
More in Gateway
Add Evolo GatewayNetwork Requirements for the Evolo GatewaySet up Gateway on Balena OSSet Up Gateway on LinuxStill need help? Ask the team