Skip to content

Modbus RTU Protocol ​

Models supporting Modbus RTU respond on COM1 (some models also respond on COM2 using the same slave ID). Defaults: 115200 bps, 8N1 (no parity, 1 stop bit), slave ID 80 (0x50).

WARNING

Before using a non-RS-485 model as a Modbus slave, disable periodic serial streaming via ASCII commands (LOG HI91 ONTIME 0 + SAVECONFIG for permanent use; LOG DISABLE for quick tests), otherwise binary frames collide with Modbus replies. RS-485 models ship with streaming disabled.

Framing & Rules ​

  • 16-bit registers are big-endian (MSB first); 32-bit values span two consecutive registers, high word first (PLC ABCD order). Checksum is standard Modbus CRC-16 (init 0xFFFF, poly 0xA001, low byte first).
  • Use FC03 (0x03, Read Holding Registers, 1–125 registers per read — not FC04) and FC06 (0x06, Write Single Register).
  • Transmit all bytes of a frame contiguously; disable inter-byte delays on USB-RS485 adapters.
  • Configuration writes may erase/write Flash: set host write timeout ≥ 1 s and never write configuration registers periodically.
  • Use slave IDs 1–247; do not use broadcast address 0.
  • A reply function code with MSB set (0x83 / 0x86) indicates rejection. Reading undefined or write-only registers returns 0 without an error. Echoed writes do not prove acceptance — read back critical settings to confirm.

Reference master code and multi-node polling examples: Python SDK modbus.py and modbus_multinode.py.

Register Map ​

Addresses below are 0-based protocol hex addresses; for PLC 4xxxx addressing, compute 40001 + decimal address (e.g. 0x0034 = 52 → 40053). After writing settings, write 0x0000 to 0x0000 to save; for entries marked "Reboot", also write 0x00FF to 0x0000. Writes of 0x00FF or 0x0001 reset immediately before replying — wait ~1 s before resuming communication.

Control & Configuration Registers ​

AddrNameTypeR/WDescriptionEffective
0x0000CTRLu16W0x0000 save; 0x0001 factory reset (may revert link settings); 0x00FF rebootImmediate
0x0004UART1_BAUDu16R/WBaud rate code 0–9 (see "Change Baud Rate")Reboot
0x0005MD_IDu16R/WModbus slave ID (1–247, default 0x50); shared as I2C address (0x08–0x77) on -I2C modelsImmediate
0x0006PROFILEu16R/WOperating mode: 0 6-axis, 1 9-axis, 4 humanoid, 5 low-speed robot, 7 low-dynamic/inclinometerReboot
0x0007COORDu16R/WOutput axes: 0 RFU (default), 4 ROS (FLU)Reboot
0x0008MCAL_STARTu16WStart magnetic calibration: 1 = 3D, 2 = 2DImmediate
0x0009MAIN_STATUSu16RMain status word; see MAIN_STATUS Status Word (bit12 always 0)—
0x000AMCAL_STATUSu16RMagnetic calibration state: 0 idle, 1 running, 3 done, 4 failed—
0x000BMCAL_PROGRESSu16RMagnetic calibration progress (0–99%, 100 on success)—
0x00A5ATT_RSTu16WAttitude zeroing: 0 zero all, 1 temp zero yaw, 2 level only, 3 auto-level, 5 clear zeroImmediate
0x00A6URFRu16R/WMounting code as decimal value (e.g. 024 → 24 = 0x0018; see URFR Table)Reboot

Real-Time Data Registers (Read-Only) ​

Reading a contiguous block in one FC03 transaction (e.g. 0x0034–0x004D, 26 registers) guarantees a coherent snapshot. Physical value = raw × scale. Acceleration, gyro, and magnetometer scale to ±16 G, ±2000 deg/s, and ±1000 μT and saturate at those limits (use HI91/HI83 for extended range).

AddrNameTypeScale & UnitDescription
0x0034–0x0036ACC X/Y/Zi16× 0.00048828 G3-axis acceleration (16 / 32768)
0x0037–0x0039GYR X/Y/Zi16× 0.061035 deg/s3-axis angular rate (2000 / 32768)
0x003A–0x003CMAG X/Y/Zi16× 0.030517 μT3-axis magnetic field (1000 / 32768)
0x003D–0x003EROLLi32× 0.001 degRoll angle (high word first)
0x003F–0x0040PITCHi32× 0.001 degPitch angle (high word first)
0x0041–0x0042YAWi32× 0.001 degYaw angle, ±180°, CCW positive (high word first)
0x0043TEMPi16× 0.01 °CModule temperature
0x0044–0x0045PRSi32× 0.01 PaBarometric pressure (high word first)
0x0046–0x0049Q0–Q3i16× 0.0001Quaternion W, X, Y, Z
0x004A–0x004BINCLI_X / Yi16× 0.011 degX (roll) / Y (pitch) inclination, fixed Right-Front-Up
0x004C–0x004DCPUTIMEu321 msSample uptime in ms (unaffected by UTC sync; wraps ~49.7 days)
0x004E–0x0050HEAVE / SURGE / SWAYi16× 0.01 mMRU 3-axis displacement (MRU models only)
0x0051–0x0053HEAVE / SURGE / SWAY_FRQi16× 0.01 HzMRU 3-axis frequency (MRU models only)

Combine both 16-bit registers of ROLL, PITCH, YAW, PRS, and CPUTIME into a 32-bit value before multiplying by the scale factor.

Version & Identity Registers (Read-Only) ​

Read 19 registers from 0x0070 (request 50 03 00 70 00 13 08 5D, returns 38 data bytes):

RegistersData Byte OffsetContent
0x0070–0x00770–15Model name PNAME (ASCII, high byte first per word)
0x0078 / 0x007916–17 / 18–19Firmware SW_VER (matches APP_VER) / Bootloader BL_VER
0x007A–0x007E20–29Reserved, ignore
0x007F–0x008230–37Unique chip ID (UUID)

Common Operations ​

All frames below assume default slave ID 0x50; recalculate the trailing 2-byte CRC if you change the ID or data.

Change Baud Rate (0x0004) ​

Write the baud code, save (50 06 00 00 00 00 84 4B), and reboot (50 06 00 00 00 FF C4 0B). After reboot, switch the host to the new baud rate and read back 0x0004:

CodeBaud RateWrite Frame (ID = 0x50)CodeBaud RateWrite Frame (ID = 0x50)
0480050 06 00 04 00 00 C5 8A511520050 06 00 04 00 05 05 89
1960050 06 00 04 00 01 04 4A623040050 06 00 04 00 06 45 88
21920050 06 00 04 00 02 44 4B746080050 06 00 04 00 07 84 48
33840050 06 00 04 00 03 85 8B892160050 06 00 04 00 08 C4 4C
45760050 06 00 04 00 04 C4 49925600050 06 00 04 00 09 05 8C

Note that 256000 is code 9, out of ascending rate order.

Change Slave ID (0x0005) ​

The new ID takes effect immediately (connect only one module when changing IDs). Example changing 0x50 → 0x51:

text
→ 50 06 00 05 00 51 55 B6    write 0x0005 = 0x0051
← 50 06 00 05 00 51 55 B6    echo on old ID
→ 51 03 00 05 00 01 98 5B    read back with new ID 0x51
← 51 03 02 00 51 B9 B4
→ 51 06 00 00 00 00 85 9A    save with new ID

Read Live IMU & Attitude Data (0x0034, 15 Registers) ​

text
→ 50 03 00 34 00 0F 49 81
← 50 03 1E FF 01 03 B0 06 50 FC C9 FF 7C 00 91 01 D5 FD DB FD 27 00 00 21 FF 00 00 7F F6 FF FD 73 E7 3F 04

Decoded values:

  • Acc: FF 01 (−255) → −0.1245 G, 03 B0 (944) → 0.4609 G, 06 50 (1616) → 0.7891 G
  • Gyro: FC C9 (−823) → −50.232 deg/s, FF 7C (−132) → −8.057 deg/s, 00 91 (145) → 8.850 deg/s
  • Mag: 01 D5 (469) → 14.312 μT, FD DB (−549) → −16.754 μT, FD 27 (−729) → −22.247 μT
  • Euler: Roll 00 00 21 FF (8703) → 8.703°, Pitch 00 00 7F F6 (32758) → 32.758°, Yaw FF FD 73 E7 (−166937) → −166.937°

Magnetic Calibration via Modbus ​

Prepare the site and mounting per Magnetic Calibration, then run:

  1. Write 1 to 0x0006 (PROFILE) → save (0x0000 = 0x0000) → reboot (0x0000 = 0x00FF) and wait ~1 s.
  2. Write 1 (3D) or 2 (2D) once to 0x0008 (MCAL_START), then rotate the vehicle without rewriting 0x0008.
  3. Poll 0x000A (MCAL_STATUS) and 0x000B (MCAL_PROGRESS) every 1–2 s until status becomes 3 (succeeded, auto-saved) or 4 (failed).
  4. Rotate 360° level and verify heading closure error ≤ 5°.

Last updated:

IMU · AHRS · INS · RTK Support Center