Modbus Register Definitions
This guide details Modbus Register Definitions, covering both input and holding registers. Learn about function codes and how to read 3-axis acceleration data from a 10DOF IMU sensor.
Register Definitions
| Register Type | Register Address | Name | R/W | Data Range | Default Value | Description |
|---|---|---|---|---|---|---|
| Input Register | 0x0000 | VID | R | 0x3343 | 0x3343 | VID (Manufacturer code for DFRobot) |
| Input Register | 0x0001 | PID | R | 0x0010 | Model dependent | 0x0010 represents 10DOF IMU sensor |
| Input Register | 0x0002 | Device Address | R | 0x004A~0x004D | Determined by DIP switch | Modbus device address, configurable via DIP switch |
| Input Register | 0x0003 | Reserved | R | 0x0000~0xFFFF | 0xFFFF | Reserved |
| Input Register | 0x0004 | Module Parity Bit(H) Stop Bit(L) | R | 0x0001 | 0x0001 | Module Parity Bit(H) Stop Bit(L) 0x00 = None 0x01 = 1 Byte |
| Input Register | 0x0005 | VERSION | R | 0x0000~0xFFFF | 0x1000 | 0x1000 indicates firmware version V1.0.0.0 |
| Input Register | 0x0006 | Accelerometer X-axis Data | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU accelerometer X-axis data |
| Input Register | 0x0007 | Accelerometer Y-axis Data | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU accelerometer Y-axis data |
| Input Register | 0x0008 | Accelerometer Z-axis Data | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU accelerometer Z-axis data |
| Input Register | 0x0009 | Gyroscope X-axis Data | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU gyroscope X-axis data |
| Input Register | 0x000A | Gyroscope Y-axis Data | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU gyroscope Y-axis data |
| Input Register | 0x000B | Gyroscope Z-axis Data | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU gyroscope Z-axis data |
| Input Register | 0x000C | Magnetometer X-axis Low Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU magnetometer X-axis low word data |
| Input Register | 0x000D | Magnetometer X-axis High Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU magnetometer X-axis high word data |
| Input Register | 0x000E | Magnetometer Y-axis Low Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU magnetometer Y-axis low word data |
| Input Register | 0x000F | Magnetometer Y-axis High Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU magnetometer Y-axis high word data |
| Input Register | 0x0010 | Magnetometer Z-axis Low Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU magnetometer Z-axis low word data |
| Input Register | 0x0011 | Magnetometer Z-axis High Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU magnetometer Z-axis high word data |
| Input Register | 0x0012 | Barometer Low Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU barometer low word data |
| Input Register | 0x0013 | Barometer High Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU barometer high word data |
| Input Register | 0x0014 | Pedometer Low Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU pedometer low word data |
| Input Register | 0x0015 | Pedometer High Word | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU pedometer high word data |
| Input Register | 0x0016 | Tap Status | R | 0x0000~0x0003 | 0x0000 | 10DOF IMU tap status 0x0001 = Single tap interrupt 0x0002 = Double tap interrupt 0x0003 = Triple tap interrupt |
| Input Register | 0x0017 | Orientation Detection Data | R | 0x0000~0xFFFF | 0x0000 | 10DOF IMU orientation statusOrientation(H) 0x01 — Portrait Front 0x02 — Landscape Left 0x03 — Landscape Right 0x04 — Portrait Upside Down Facing(L) 0x00 — Face Forward 0x01 — Face Backward |
| Holding Register | 0x0000 | Reserved | R/W | 0x0000~0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0001 | Reserved | R/W | 0x0000~0xFFFF | 0x0000 | Reserved |
| Holding Register | 0x0002 | Reserved | R/W | 0x0000~0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0003 | Device Baud Rate | R/W | 0x0000~0x00FF | 0x0003 | Device baud rate 0x0001 = 2400 0x0002 = 4800 0x0003 = 9600 0x0004 = 14400 0x0005 = 19200 0x0006 = 38400 0x0007 = 57600 0x0008 = 115200 Other values default to 115200 |
| Input Register | 0x0004 | Reserved | R | 0x0000~0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0005 | Reserved | R/W | 0x0000~0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0006 | Device Working Mode | R/W | 0x0000~0x0003 | 0x0002 | 0x0000 = Sleep Mode (Lowest power consumption, sensor config lost) 0x0001 = Low Power Mode (Low power measurement) 0x0002 = Normal Mode (Balance of precision and power) 0x0003 = High Performance Mode (Highest precision, maximum power) |
| Holding Register | 0x0007 | Factory Reset | R/W | 0x0000~0x0001 | 0x0001 | Factory reset functionWrite 0x0001 to trigger factory reset |
| Holding Register | 0x0008 | Accelerometer Range | R/W | 0x0000~0x0003 | 0x0002 | Accelerometer measurement range 0x0000 = ±2G 0x0001 = ±4G 0x0002 = ±8G 0x0003 = ±16G |
| Holding Register | 0x0009 | Gyroscope Range | R/W | 0x0000~0x0004 | 0x0004 | Gyroscope measurement range 0x0000 = ±125DPS 0x0001 = ±250DPS 0x0002 = ±500DPS 0x0003 = ±1000DPS 0x0004 = ±2000DPS |
| Holding Register | 0x000A | Barometer Threshold Low Word | R/W | 0x0000~0xFFFF | 0x0000 | 10DOF IMU barometer threshold low word configuration |
| Holding Register | 0x000B | Barometer Threshold High Word | R/W | 0x0000~0xFFFF | 0x0000 | 10DOF IMU barometer threshold high word configuration |
| Holding Register | 0x000C | Barometer Threshold Range | R/W | 0x0000~0xFFFF | 0x0000 | 10DOF IMU barometer threshold range configuration |
| Holding Register | 0x000D | Barometer Threshold Count Limit | R/W | 0x0000~0x0003 | 0x0000 | 10DOF IMU barometer threshold count limit 0x0000 = 1 time 0x0001 = 3 times 0x0002 = 7 times 0x0003 = 15 times |
| Holding Register | 0x000E | Interrupt Pin 1 Configuration | R/W | 0x0000~0x0009 | 0x0000 | 10DOF IMU INT1 configuration 0x0000 = Interrupt disable 0x0001 = Enable 6DOF data ready interrupt 0x0002 = Enable any motion detect interrupt 0x0003 = Enable still detect interrupt 0x0004 = Enable significant motion detect interrupt 0x0005 = Enable pedometer detect interrupt 0x0006 = Enable plane detect interrupt 0x0007 = Enable orientation detect interrupt 0x0008 = Enable tap detect interrupt 0x0009 = Enable tilt detect interrupt |
| Holding Register | 0x000F | Interrupt Pin 2 Configuration | R/W | 0x0000~0x0009 | 0x0000 | 10DOF IMU INT2 configuration Same function as INT1 |
| Holding Register | 0x0010 | Interrupt Pin 3 Configuration | R/W | 0x0000~0x0001 | 0x0000 | 10DOF IMU INT3 configuration 0x0000 = Interrupt disable 0x0001 = Enable magnetometer data ready interrupt |
| Holding Register | 0x0011 | Interrupt Pin 4 Configuration | R/W | 0x0000~0x0002 | 0x0000 | 10DOF IMU INT4 configuration 0x0000 = Interrupt disable 0x0001 = Enable barometer data ready interrupt 0x0002 = Enable barometer threshold exceed interrupt |
Common Function Codes for Modbus-RTU:
| Function Code | Name | Function |
|---|---|---|
| 0x03 | Read Multiple Registers | Read integer, character, status word, floating-point (read N words) --- Read holding registers, byte operation |
| 0x04 | Read Input Registers | Read integer, status word, floating-point (read N words) --- Read input registers, byte operation |
| 0x06 | Write Single Holding Register | Write integer, character, status word, floating-point (write one word) --- Write holding register, byte operation |
| 0x10 | Write Multiple Holding Registers | Write multiple holding registers --- Load specific binary values into a series of consecutive holding registers |
Input and holding registers can be read and written using the above commands.
Example of Reading 3-Axis Acceleration Data
Objective
Read the current acceleration values detected by the 10-axis IMU sensor via the Modbus RTU protocol.
Hardware Preparation
- TEL0190 RainbowLink V2 ×1
- SEN0696 Gravity:10 DOF IMU Sensor ×1
Wiring Diagram

Connect the 10 DOF IMU sensor to the RainbowLink V2 as shown in the diagram. The main connections are as follows:
- Sensor pin “+” → RainbowLink V2 5V
- Sensor pin “-” → RainbowLink V2 GND
- Sensor UART pin “RX” → RainbowLink V2 TX
- Sensor UART pin “TX” → RainbowLink V2 RX
- Sensor DIP switch configuration: Set the communication mode to UART, and set the address to 0x4A
General Operation Steps
-
Hardware Connection: Connect the sensor to the host (computer) via the RainbowLink USB protocol converter. Switch the sensor's communication mode to UART and the address to 0x4A.
-
Parameter Configuration: Set the following parameters in the serial port debugging tool (must match the sensor settings):
- Baud rate: 9600 (default)
- Data bits: 8 bits
- Stop bits: 1 bit
- Parity: None
-
Send Command: Enter the following hexadecimal command in the "Transmission Area" of the debugging tool, check "Send in Hexadecimal", and send the command.
Command Transmission and Parsing
| Field Name | Hexadecimal Value | Description |
|---|---|---|
| Device Address | 4A | MODBUS device address, default 0x4A (modifiable via DIP switch) |
| Function Code | 04 | Read Input Registers (fixed command) |
| Starting Register Address | 00 06 | Acceleration X-axis register address (0x0006) |
| Number of Registers | 00 03 | Read 3 registers (Acceleration X, Y, Z) |
| CRC Check | 5F B1 | CRC16 check value of the command |
Complete Command to Send: 4A 04 00 06 00 03 5F B1
Return Data and Parsing
After receiving the command, the sensor returns the following data (example):
| Field Name | Hexadecimal Value | Description |
|---|---|---|
| Device Address | 4A | Matches the device address in the sent command |
| Function Code | 04 | Confirm execution of "Read Input Registers" operation |
| Number of Bytes | 06 | Total number of bytes in the returned data (6 bytes) |
| Read Data | FF AD FF DD EF E1 | Raw values of acceleration X, Y, Z axes (2 bytes each) |
| CRC Check | B7 E1 | CRC16 check value of the returned data |
Complete Returned Data: 4A 04 06 FF AD FF DD EF E1 B7 E1

Data Parsing Steps
The returned raw data (FF AD, FF DD, EF E1) are 16-bit signed integers (two's complement). Convert them to actual acceleration values (unit: g) following these steps:
-
Convert Hexadecimal to Signed Decimal
-
X-axis raw value:
FF AD
Unsigned value =0xFFAD= 65453
Signed value = 65453 − 65536 = -83 -
Y-axis raw value:
FF DD
Unsigned value =0xFFDD= 65493
Signed value = 65493 − 65536 = -43 -
Z-axis raw value:
EF E1
Unsigned value =0xEFE1= 61409
Signed value = 61409 − 65536 = -4127
-
-
Convert to Physical Values Based on Range and Sensitivity
The default range of the BMI323 accelerometer is ±8 g, with a sensitivity of 4096 LSB/g (see Table 3 on Page 9 of the datasheet).
Formula:
Acceleration (g) = Signed raw value / Sensitivity
- X-axis: −83/4096 ≈ −0.0203 g
- Y-axis: −43/4096 ≈ −0.0105 g
- Z-axis: −4127/4096 ≈ −1.0076 g
-
Result Interpretation
- X and Y axes are close to 0 g, indicating the sensor is level with no tilt on the horizontal plane.
- Z-axis is approximately -1 g, indicating the direction of gravity is negative (sensor front side up, Z-axis pointing to the center of the Earth).
- This data is consistent with the expected output when the sensor is stationary.
Why This Processing?
- Digital Output: The sensor converts analog signals to digital signals internally and outputs them as 16-bit binary two's complement. The sensitivity defined in the datasheet must be used to convert these values back to physical quantities.
- Range Impact: Sensitivity is related to the selected range (different ranges correspond to different LSB/g values). Confirm the current range setting before parsing (default ±8 g; if modified, read via holding register 0x0008).
- Significance: Acceleration has direction, so signed numbers are used. Two's complement format requires subtracting 65536 to convert to negative values.
Notes
- If the accelerometer range is modified (e.g., ±2 g, ±4 g, ±16 g), the sensitivity will change accordingly, and the denominator in the parsing formula must be adjusted synchronously.
- The CRC check in the returned data can verify transmission integrity (CRC is correct in this example, so the data is reliable).
- For continuous reading, repeat sending the same command directly—the sensor will return the latest sampled values.
Was this article helpful?
