Modbus
Modbus is a serial communication protocol developed for use with its programmable logic controllers (PLCs). bOS Modbus device is usually used for industrial solutions such as energy consumption metering and more advanced HVAC systems.
Table of contents
Connection Settings
Modbus driver acts as a Modbus master device. Driver offers two types of connections (TCP or RTU) defined by the Connection Type setting. TCP connection has IP and Port settings. RTU connection has serial port settings (Serial Port, Baud Rate, Data Bits, Parity, Stop Bits and Handshake). RS-232 or RS-485 serial communication can be used with a suitable USB converter. Reading the instructional manual is crucial for integrating Modbus into bOS as it contains all information (connection type, additional settings, modbus addresses, etc). Additional timeout delay can be set.
Modbus slave devices store data in four Modbus tables:
Discrete Output Coils: Read, Write
Discrete Input Contacts: Read only
Analog Input Registers: Read only
Analog Output Holding Registers: Read, Write
Very important thing to note is that, bOS starts counting Modbus addresses or devices with address number 0 and not with 1 like many other modbus softwares. If the manual of the device starts modbus addresses with 1 and the modbus address is e.g. 2001, bOS address would be 2000. This can also be changed by enabling Address Offset option.
Each table has 9999 values. Each coil or contact is 1 bit and assigned a data address between 0000 and 9998. Each register is 1 word = 16 bits = 2 bytes and also has data address between 0000 and 9998.
Modbus data is converted by the following data point nodes: DPT Boolean, DPT Double, DPT Integer, DPT UInt. The appropriate data Address should be entered for each data point.
Slave addressing can be used for each data point. Use Slave Addressing and Slave Address settings are available. The data point nodes offers Value value to use on user interface and in tasks.
Folder node can be used to group different zones and partitions.
Full integration of Daiking RTD device with every step, from reading the manual to set the connection settings and all addresses is available in the video below:
https://www.youtube.com/watch?v=lwEkxwGGYyYAddress Types
Modbus Slave address
Masters can address individual slaves, or can initiate a broadcast message to all slaves. Slaves return a response to all queries addressed to them individually, but do not respond to broadcast queries. Checking the manual should provide information about the slave address, specially if device supports multiple slave addresses. If there is no information about individual slave address, you can leave the slave address at default (Value = 1).
DPT Boolean Node converts the data from Coils and Inputs table, defined by the Table setting.
DPT Double Node converts the data from Input Registers and Holding Registers table, defined by the Table setting. The data can be converted from IEEE 32 Bit Float, Signed 16 Bit Integer, Unsigned 16 Bit Integer or Signed 32 Bit Integer. In case of IEEE 32 Bit Float and Signed 32 Bit Integer, 2 holding registers (4 bytes) will be read.
DPT Integer Node converts the data from Input Registers and Holding Registers table, defined by the Table setting. The appropriate data Address should be entered. The data can be converted from Signed 16 Bit Integer, Unsigned 16 Bit Integer or Signed 32 Bit Integer. In case of Signed 32 Bit Integer, 2 holding registers (4 bytes) will be read.
DPT Unsigned Integer Node converts the data from Input Registers and Holding Registers table, defined by the Table setting. The appropriate data Address should be entered. The data can be converted from Unsigned 32 Bit Integer. 2 holding registers (4 bytes) will be read.
Address Settings
Selecting each Modbus address provides additional information and settings. Checking the device's manual is crucial, so the correct address, type and format is used so we receive correct response from the device. bOS Starts the modbus count with 0, not with 1 like many other modbus programs and device's manual, so make sure you correct the address accordingly (this can also be changed by enabling Address Offset in the main Modbus node. Enabling this function will make bOS start the address count with 1.
Send Data Cyclically
This function allows us to contantly send current sentpoint value to the device. Minimum cyclical delay is 1minute.
Data
Each Modbus address can either be:
Holding register - Read/write type.
Input register - Read only.
Depending on the address type, different format data can be selected.
IEEE32Bit
Unsigned16Bit
Signed16Bit
Signed32Bit
Signed64Bit
Unsigned32Bit
Unsigned64Bit
Depending on what type of values the device is sending to Modbus, change the data type accordingly. If for any reason the data received is offset, you can tweak the Scale Factor function to receive the correct data.
Status
We can use the different Modbus address to receive current status or feedback of the address, by enabling Use Status Address function. Same as with the normal address, cyclical read and status table can be tweaked.
Address Import Process
Starting with bOS version 4.12, Modbus supports importing addresses from a .csv file.
For now, ComfortClick provides an online Modbus import template that can be used to generate the correct CSV file. In future versions, the Modbus import process will become more similar to the KNX ETS import process.
Creating the CSV File
To generate the CSV file, open the online Modbus Import Table template. You can find it in the URL: https://docs.google.com/spreadsheets/d/1yNkJ1DwQlpAU5JzKYMjCjFQ5pLDd-0qBAb7_8BlSh7c/edit?gid=757598541#gid=757598541
Because this is an online template, first download a copy and edit it locally.
The template allows you to configure the required Modbus address information, including:
Slave ID
Path
Node name
Node type
Modbus address
Data format
Scale factor
Status address
Status table
Template
When all required fields are configured correctly, the Row Status will turn green and the status will show Ready for bOS!
If there is an error, the row will turn red and the status will show Error, together with information about what needs to be corrected.
Exporting the CSV File
After the Modbus addresses are configured, open the Export tab. The configured addresses should be listed there.
To export the file:
Click File.
Select Download.
Choose .csv format.
Importing the CSV File into bOS
In bOS Configurator, select the main Modbus node and run the CSV Import function.
Locate and select the exported CSV file. The Modbus import wizard will open.
The import process allows you to:
Select or deselect values before importing
Review imported addresses
Adjust templates
Change units
Prepare the values for final import
After everything is configured, bOS will automatically create the required slave addresses, folders, and Modbus datapoints. The imported addresses will be placed under the correct slave devices and folders according to the CSV structure.