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: DFRobot) |
| Input Register | 0x0001 | PID | R | 0x0010 | 0x0010 | PID Vendor ID |
| Input Register | 0x0002 | Device Address | R | 0x004A ~ 0x004D | 0x004A | MODBUS device address, configurable via DIP switch |
| Input Register | 0x0003 | Reserved | R | 0x0000 ~ 0xFFFF | 0xFFFF | Reserved |
| Input Register | 0x0004 | Parity (H) Stop Bits (L) | R | 0x0001 | 0x0001 | Module parity (high byte) and stop bits (low byte)0x00 – None 0x01 – 1 Byte |
| Input Register | 0x0005 | Software Version Number | R | 0x0000 ~ 0xFFFF | 0x1000 | 0x1000 means firmware version V1.0.0.0 |
| Input Register | 0x0006 | Acceleration X | R | 0x0000 ~ 0xFFFF | 0x0000 | Accelerometer X-axis data for 10DOF IMU |
| Input Register | 0x0007 | Acceleration Y | R | 0x0000 ~ 0xFFFF | 0x0000 | Accelerometer Y-axis data for 10DOF IMU |
| Input Register | 0x0008 | Acceleration Z | R | 0x0000 ~ 0xFFFF | 0x0000 | Accelerometer Z-axis data for 10DOF IMU |
| Input Register | 0x0009 | Gyroscope X | R | 0x0000 ~ 0xFFFF | 0x0000 | Gyroscope X-axis data for 10DOF IMU |
| Input Register | 0x000A | Gyroscope Y | R | 0x0000 ~ 0xFFFF | 0x0000 | Gyroscope Y-axis data for 10DOF IMU |
| Input Register | 0x000B | Gyroscope Z | R | 0x0000 ~ 0xFFFF | 0x0000 | Gyroscope Z-axis data for 10DOF IMU |
| Input Register | 0x000C | Magnetometer X Low Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Magnetometer X-axis low word for 10DOF IMU |
| Input Register | 0x000D | Magnetometer X High Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Magnetometer X-axis high word for 10DOF IMU |
| Input Register | 0x000E | Magnetometer Y Low Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Magnetometer Y-axis low word for 10DOF IMU |
| Input Register | 0x000F | Magnetometer Y High Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Magnetometer Y-axis high word for 10DOF IMU |
| Input Register | 0x0010 | Magnetometer Z Low Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Magnetometer Z-axis low word for 10DOF IMU |
| Input Register | 0x0011 | Magnetometer Z High Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Magnetometer Z-axis high word for 10DOF IMU |
| Input Register | 0x0012 | Barometer Low Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Barometer low word for 10DOF IMU |
| Input Register | 0x0013 | Barometer High Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Barometer high word for 10DOF IMU |
| Input Register | 0x0014 | INT1 Status | R | 0x0000 ~ 0x3000 | 0x0000 | Interrupt pin 1 status for 10DOF IMU 0x0001 – No‑motion detect 0x0002 – Any‑motion detect 0x0004 – Flat detect 0x0008 – Orientation detect 0x0010 – Step detect 0x0040 – Significant motion detect 0x0080 – Tilt detect 0x0100 – Tap detect 0x3000 – Basic data ready |
| Input Register | 0x0015 | INT2 Status | R | 0x0000 ~ 0x3000 | 0x0000 | Interrupt pin 2 status for 10DOF IMU 0x0001 – No‑motion detect 0x0002 – Any‑motion detect 0x0004 – Flat detect 0x0008 – Orientation detect 0x0010 – Step detect 0x0040 – Significant motion detect 0x0080 – Tilt detect 0x0100 – Tap detect 0x3000 – 6DOF data ready |
| Input Register | 0x0016 | INT3 Status | R | 0x0000 ~ 0x0001 | 0x0000 | Interrupt pin 3 status for 10DOF IMU 0x0001 – Magnetometer data ready |
| Input Register | 0x0017 | INT4 Status | R | 0x0000 ~ 0x0002 | 0x0000 | Interrupt pin 4 status for 10DOF IMU 0x0001 – Data ready 0x0002 – Barometer threshold exceed |
| Input Register | 0x0018 | Pedometer Low Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Pedometer low word for 10DOF IMU |
| Input Register | 0x0019 | Pedometer High Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Pedometer high word for 10DOF IMU |
| Input Register | 0x001A | Tap Status | R | 0x0000 ~ 0x0003 | 0x0000 | Tap status for 10DOF IMU 0x0001 – Single tap 0x0002 – Double tap 0x0003 – Triple tap |
| Input Register | 0x001B | Orientation Data | R | 0x0000 ~ 0xFFFF | 0x0000 | Orientation data for 10DOF IMU Orientation (H) 0x01 – Portrait up 0x02 – Landscape left 0x03 – Landscape right 0x04 – Portrait down Face (L) 0x00 – Face forward 0x01 – Face backward |
| Input Register | 0x001C | Roll Low Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Roll angle low word for 10DOF IMU attitude |
| Input Register | 0x001D | Roll High Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Roll angle high word for 10DOF IMU attitude |
| Input Register | 0x001E | Pitch Low Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Pitch angle low word for 10DOF IMU attitude |
| Input Register | 0x001F | Pitch High Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Pitch angle high word for 10DOF IMU attitude |
| Input Register | 0x0020 | Yaw Low Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Yaw angle low word for 10DOF IMU attitude |
| Input Register | 0x0021 | Yaw High Word | R | 0x0000 ~ 0xFFFF | 0x0000 | Yaw angle high word for 10DOF IMU attitude |
| Holding Register | 0x0000 | Reserved | R/W | 0x0000 ~ 0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0001 | Reserved | R/W | 0x0000 ~ 0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0002 | Reserved | R/W | 0x0000 ~ 0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0003 | 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 Others – 115200 |
| Input Register | 0x0004 | Reserved | R | 0x0000 ~ 0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0005 | Reserved | R/W | 0x0000 ~ 0xFFFF | 0xFFFF | Reserved |
| Holding Register | 0x0006 | Operating Mode | R/W | 0x0000 ~ 0x0003 | 0x0002 | 0x0000 – Sleep (lowest power, sensor config lost) 0x0001 – Low power (low power measurement) 0x0002 – Normal (balance accuracy & power) 0x0003 – High performance (highest accuracy, highest power) |
| Holding Register | 0x0007 | Factory Reset | R/W | 0x0000 ~ 0x0001 | 0x0001 | Factory resetWrite 0x0001 to trigger factory reset |
| Holding Register | 0x0008 | Accel Range | R/W | 0x0000 ~ 0x0003 | 0x0002 | Accelerometer measurement range 0x0000 – ±2G 0x0001 – ±4G 0x0002 – ±8G 0x0003 – ±16G |
| Holding Register | 0x0009 | Gyro Range | R/W | 0x0000 ~ 0x0004 | 0x0004 | Gyroscope measurement range 0x0000 – ±125 DPS 0x0001 – ±250 DPS 0x0002 – ±500 DPS 0x0003 – ±1000 DPS 0x0004 – ±2000 DPS |
| Holding Register | 0x000A | Baro Threshold Low | R/W | 0x0000 ~ 0xFFFF | 0x0000 | Barometer threshold low word for 10DOF IMU |
| Holding Register | 0x000B | Baro Threshold High | R/W | 0x0000 ~ 0xFFFF | 0x0000 | Barometer threshold high word for 10DOF IMU |
| Holding Register | 0x000C | Baro Threshold Window | R/W | 0x0000 ~ 0xFFFF | 0x0000 | Barometer threshold window for 10DOF IMU |
| Holding Register | 0x000D | Baro Threshold Count | R/W | 0x0000 ~ 0x0003 | 0x0000 | Barometer threshold count limit for 10DOF IMU 0x0000 – 1 time 0x0001 – 3 times 0x0002 – 7 times 0x0003 – 15 times |
| Holding Register | 0x000E | INT1 Config | R/W | 0x0000 ~ 0x0009 | 0x0000 | Interrupt pin 1 config for 10DOF IMU 0x0000 – Interrupt disabled 0x0001 – 6DOF data ready enable 0x0002 – Any‑motion detect enable 0x0003 – No‑motion detect enable 0x0004 – Significant motion detect enable 0x0005 – Step detect enable 0x0006 – Flat detect enable 0x0007 – Orientation detect enable 0x0008 – Tap detect enable 0x0009 – Tilt detect enable |
| Holding Register | 0x000F | INT2 Config | R/W | 0x0000 ~ 0x0009 | 0x0000 | Interrupt pin 2 config for 10DOF IMUSame as INT1 |
| Holding Register | 0x0010 | INT3 Config | R/W | 0x0000 ~ 0x0001 | 0x0000 | Interrupt pin 3 config for 10DOF I MU0x0000 – Interrupt disabled 0x0001 – Mag data ready enable |
| Holding Register | 0x0011 | INT4 Config | R/W | 0x0000 ~ 0x0002 | 0x0000 | Interrupt pin 4 config for 10DOF IMU 0x0000 – Interrupt disabled 0x0001 – Baro data ready enable 0x0002 – Baro threshold exceed enable |
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
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?
