Modbus over RS-485
MWEB and MiroWEB controller units support status reporting through the Modbus protocol running over the RS-485 link.
Controller devices are configured as slave devices, and will respond to the master request, if the message contains the matching address byte.
RS-485 link is configured as a half-duplex, at 9600 baud, 8-data bits, 1 start bit, 2 stop bits, no parity. Each packet is terminated with a 16-bit CRC value.
The devices Modbus address can be configured in the “General settings” panel:
The controller device responds to the requests sent from the Modbus master. Currently only supported command is Command 3: Read Holding Registers.
In the query header the Starting Address High represents the controller circuit number (1..63), and the Starting Address Low indicates first device on the specified circuit (1..126). Maximum number of register values returned is 96, which corresponds to maximum of 48 devices returning the status in a single response packet.
For the small systems, with less then 250 units installed, the “simple” access mode could be used. With circuit number 0, controller will enumerate all existing devices in the system from 0 to number of devices – 1, regardless of the physical bus address.
Each device returns two bytes of the status.
First byte indicates status of the device transmitter. Currently returned values are:
- 0 – Device Not installed
- 1 – Transmitter OK
- 2 – Battery Low
- 3 – 24hr communications loss
Second byte shows the status of the Emergency Lighting Unit (ELU):
- 0 – Device Not Installed
- 1 – Last Test OK
- 2 – General Fault
- 3 – Battery Fault
- 4 – Lamp Fault
- 5 – Mains Fault
Modbus protocol request
Slave addr | Function | Start addr MSB | Start addr LSB | Reg count MSB | Reg count LSB | CRC LSB | CRC MSB |
---|---|---|---|---|---|---|---|
0x80 | 3 | 4 | 1 | 0 | 18 | 0x8b | 0x26 |
Modbus protocol response for 2 devices
Slave addr | Function | Reg1 data MSB | Reg2 data LSB | Reg2 data MSB | Reg2 data LSB | CRC LSB | CRC MSB |
---|---|---|---|---|---|---|---|
0x80 | 3 | 1 | 1 | 1 | 4 | 0x0b | 0xb4 |