Skip to content

ML MODBUS Protocol Version 1

Please mind, that not all registers are supported on all device types.

Accessing RAM

    READ  function 0x03 (16 bit words) / 0x46 (bytes)
    WRITE function 0x10 (16 bit words) / 0x47 (bytes)

Using functions 0x03 and 0x10 reads and writes MODBUS address in word-lengths (2 bytes). This means, that defining MODBUS register to read must always be even. On the other hand, functions 0x46 and 0x47 reads and writes data in byte-lengths (1-byte), which makes it more flexible to access data which would otherwise be padded. The following tables show both register addresses - either accessible through word address or byte address.

Fnc 0x03/0x10   Fnc 0x46/0x47   Description                                       Value type
address [DEC]   address [DEC]
0               0               Filtered value of primary ADC (RO)              32bit float
2               4               Filtered value of secondary ADC (RO)            32bit float
4               8               Output DAC (RO)                                 16bit int
5               10              Raw primary value without correction (RO)       32bit float
7               14              Raw secondary value (RO)                        32bit float
9               18              Primary measurement value (RO)                  32bit float
11              22              Secondary measurement value (RO)                32bit float
13              26              Output value (RO)                               32bit float
17              34              Primary value without autozero correction (RO)  32bit float
-               55              measurement_interval_hours (RW)                 uint8_t
28              56              measurement_interval_minutes (RW)               uint8_t
-               57              measurement_interval_seconds (RW)               uint8_t

RO denotes read-only register, RW denotes read-write register.

Example of reading from RAM

Requesting 2x 16 bit registers (4 bytes) from device number 1 starting on index 9 using function 0x03. CRC is 0x1409.

=> 01 03 0009 0002 1409
This is the same as:
=> 01 46 0018 0004 09C1

In both cases the device will return 4 bytes (2 registers), which are the primary measurement value and shall be interpreted as 32-bit float.

Accessing ROM / EEPROM

READ  16-bit words function: 0x41
READ   8-bit bytes function: 0x44
WRITE 16-bit words function: 0x42
WRITE  8-bit bytes function: 0x45

Using functions 0x41 and 0x42 reads and writes MODBUS address in word-lengths (2 bytes). This means, that defining MODBUS register to read must always be even. On the other hand, functions 0x44 and 0x45 reads and writes data in byte-lengths (1-byte), which makes it more flexible to access data which would otherwise be padded. The following tables show both register addresses - either accessible through word address or byte address.

Fnc 0x41/0x42   Fnc 0x44/0x45      Description                            Value type
address [DEC]   address [DEC]
0               0                  Protocol (0:MODBUS RTU; 1:SDI12) (RW)  uint8_t
-               1                  Databits (0:5, 1:6, 2:7, 3:8) (RW)     uint8_t
1               2                  Parity (0:none, 1:even, 2:odd) (RW)    uint8_t
-               3                  Stopbits (0:1, 1:2) (RW)               uint8_t
2               4                  Baud rate (in baud/s) (RW)             uint32_t
4               8                  MODBUS address (RW)                    uint8_t
-               121                Primary reading minimum (RO)           32bit float
-               125                Primary reading maximum (RO)           32bit float
-               14561              Scale factor of primary reading (RO)   uint8_t
7281            14562              Unit of primary reading (RO)           uint8_t
-               14563              Scale factor of secondary reading (RO) uint8_t
7282            14564              Unit of secondary unit (RO)            uint8_t
7362            14724              Location ID (RW)                       uint16_t
7363            14726              Sensor ID (RO)                         uint32_t
7365            14730              Measurements per packet (RW)           uint8_t
7368            14736              Primary measurement type (RO)          uint8_t
7369            14738              Measurement ID (RW)                    uint8_t

RO denotes read-only register, RW denotes read-write register.

Example of writing to ROM

Writing 1 byte of value 0xAA to device number 1 starting on index 8 using function 0x45.

=> 01 45 0008 0001 01 AA A4ED
0008 = start index to write to
0001 = number of 8-bit bytes to write
01 = number of bytes which follow in this packet

Writing 4 bytes of value 0xAABBCCDD to device number 1 starting on index 2 using function 0x42. CRC is 0x1409.

=> 01 42 0002 0002 04 AABBCCDD 1459
00002 = start index to write to
0002 = number of 16-bit registers to write
04 = number of bytes which follow in this packet

Measurement type lookup table

Pressure Absolute (against vacuum)                          0
Pressure Relative (against atmosphere (gauge pressure))     1
Temperature                                                 2
Binary (open / close; yes / no; 1 / 0)                      3
Pulses                                                      4

Units of measurements and scale factors lookup tables

Units

°K - Kelvin (temperature) = 0
°C - Celsius (temperature) = 1
°Ré - Réaumur (temperature) = 2
°F - Fahrenheit (temperature) = 3
°R - Rankine (temperature) = 4
Pa - Pascal (pressure) = 5
bar (pressure) = 6
atm (pressure) = 7
torr (pressure) = 8
mmHg (pressure) = 9
psi (pressure) = 10
m (level) = 11
reserved = 12
m3 (volume) = 13
l (volume) = 14
m3/s (flow) = 15
m3/h (flow) = 16
l/s (flow) = 17
l/h (flow) = 18
A (current) = 19
V (voltage) = 20
% (humidity) = 21

Unit scale factors

This is the unit scale factor. For example, if the unit is Pa and the scale factor is KILO, then the reading is in kPa.

no scale factor = 0
a (atto) = 1
f (femto) = 2
p (piko) = 3
n (nano) = 4
u (mikro) = 5
m (mili) = 6
c (centi) = 7
d (deci) = 8
da (deka) = 9
h (hekto) = 10
k (kilo) = 11
M (Mega) = 12
G (Giga) = 13
T (Tera) = 14
P (Peta) = 15
E (exa) = 16