Skip to content

Modbus

Modbus

Modbus Sensor RTU (RS485)

It is possible to operate up to 5 independent devices on a single Modbus bus. The configuration consists in selecting the module and entering its slave ID.

Support for the following modules is built-in:

  • SDM120
  • SDM72D-M
  • Epever Tracer
  • Sofarsolar
  • SDM630/72D-v2
  • CHINT-DTSU666

In addition, it is possible to add support for other Modbus devices using the adding own/custom modules feature.

Custom devices

The function allows you to configure data reading from any module that supports the Modbus protocol. To do this, open the configuration panel by clicking the Configure custom modules button. You can save up to 5 different configurations.

In the form, enter your own name for module, communication data (bitrate, parity bit, stop bit, delay between register reads (in s)) and define the list of readings. For each reading, specify the name, unit, divisor, register address, function code, type (kind) and endian. After completing the configuration, confirm with the Save changes button. Then the configuration can be selected on each of the five slots.

The configuration can be exported to a file by clicking the Export configuration button and loaded by clicking Import configuration (save changes after import).

More configuration files are available at our forum. However, please be aware that these configurations might have been contributed by other users, and as such, we cannot guarantee their accuracy or proper functioning. While we strive to curate and verify the content, we encourage you to exercise caution when using these configurations. Your feedback and experiences with these configurations are valuable to the community and can help ensure their reliability.

Modbus - custom configuration

Readings mapping

In order to use readings from Modbus modules in other LK functions (such as HTTP client, MQTT client, OLED, VOLED, LTE Modem) apart from the Modbus tab, you must configure mapping of readings to variables m1 - m30. On the Modbus page there is a Configure mapping to variables m1-m30 button that opens a configuration form (shown in the image below). The reading is assigned to the m variable, and more precisely the reading position (this is important when changing Modbus modules, because the mapping to a specific slot number and reading number remains, so a slot without a selected module can be indicated).

Readings mapping

The variables m1 - m30 can be used later in the HTTP client, MQTT client, OLED, VOLED, Modem LTE. The first 10 m1-m10 are available in Events too. The first 4 variables m1 - m4 are also available as an option I (power reading) and U (voltage reading) in Power and Energy tab.

Modbus TCP Server

Form for enabling Modbus TCP Server and table with information about available data.

Modbus TCP Server