Modbus Communication Protocol
Modbus Communication Instructions for use:
The serial port sending command must be completed within 10S, otherwise it will be
automatically locked. In order to avoid automatic locking, the following steps can be performed first.
Enter the unlock command
Enter the command that needs to modify or read the data
Save the command
Register
ADD R
(Hex
)
ADD R
(Dec
)
REGISTER NAME
FUNCTION
SERI AL
I/F
Bit1 5
Bit1 4
Bit1 3
Bit1 2
Bit1 1
Bit1 0
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit0
00
00
SAVE
save/reboot/ reset
R/W
SAVE[15:0]
01
01
CALSW
Calibration mode
R/W
CALSW[3:0]
04
04
BAUD
Serial port baud rate
R/W
BAUD[3:0]
05
05
AXOFFSET
Acceleration X zero bias
R/W
AXOFFSET[15:0]
06
06
AYOFFSET
Acceleration Y zero bias
R/W
AYOFFSET[15:0]
07
07
AZOFFSET
Acceleration Z zero bias
R/W
AZOFFSET[15:0]
08
08
GXOFFSET
Angular velocity X zero bias
R/W
GXOFFSET[15:0]
09
09
GYOFFSET
Angular velocity Y zero bias
R/W
GYOFFSET[15:0]
0A
10
GZOFFSET
Angular velocity Z zero bias
R/W
GZOFFSET[15:0]
0B
11
HXOFFSET
Magnetic field X zero bias
R/W
HXOFFSET[15:0]
0C
12
HYOFFSET
Magnetic field Y zero bias
R/W
HYOFFSET[15:0]
0D
13
HZOFFSET
Magnetic Field Z zero Bias
R/W
HZOFFSET[15:0]
1A
26
IICADDR
Device address
R/W
IICADDR[7:0]
1B
27
LEDOFF
Turn off the LED lights
R/W
LEDO FF
1C
28
MAGRANG X
Magnetic Field X Calibration Range
R/W
MAGRANGX[15:0]
1D
29
MAGRANG Y
Magnetic Field Y Calibration Range
R/W
MAGRANGY[15:0]
1E
30
MAGRANGZ
Magnetic Field Z Calibration Range
R/W
MAGRANGZ[15:0]
1F
31
BANDWIDT H
Bandwidth
R/W
BANDWIDTH[3:0
]
20
32
GYRORAN GE
Gyroscope range
R/W
GYRORANGE[3: 0]
21
33
ACCRANGE
Acceleration range
R/W
ACCRANGE[3:0]
22
34
SLEEP
Sleep
R/W
SLEE P
23
35
ORIENT
Installation direction
R/W
ORIE NT
24
36
AXIS6
algorithm
R/W
AXIS6
25
37
FILTK
Dynamic filtering
R/W
FILTK[15:0]
26
38
GPSBAUD
GPS baud rate
R/W
GPSBAUD[3:0]
27
39
READADDR
read register
R/W
READADDR[7:0]
2A
42
ACCFILT
acceleration filter
R/W
ACCFILT[15:0]
2E
46
VERSION
version number
R
VERSION[15:0]
30
48
YYMM
Year/monthSl eep
R/W
MOUTH[15:8]
YEAR[7:0]
31
49
DDHH
day/time
R/W
HOUR[15:8]
DAY[7:0]
32
50
MMSS
minutes/seco nds
R/W
SECONDS[15:8]
MINUTE[7:0]
33
51
MS
millisecond
R/W
MS[15:0]
34
52
AX
AccelerationX
R
AX[15:0]
35
53
AY
Acceleration Y
R
AY[15:0]
36
54
AZ
Acceleration Z
R
AZ[15:0]
37
55
GX
Angular velocity X
R
GX[15:0]
38
56
GY
Angular velocity Y
R
GY[15:0]
39
57
GZ
Angular velocity Z
R
GZ[15:0]
3A
58
HX
Magnetic FieldX
R
HX[15:0]
3B
59
HY
Magnetic field Y
R
HY[15:0]
3C
60
HZ
Magnetic field Z
R
HZ[15:0]
3D
61
Roll
Roll angle
R
Roll[15:0]
3E
62
Pitch
Pitch angle
R
Pitch[15:0]
3F
63
Yaw
Heading
R
Yaw[15:0]
40
64
TEMP
Temperature
R
TEMP[15:0]
45
69
PressureL
Air pressure low 16 bits
R
PressureL[15:0]
46
70
PressureH
Air pressure high 16 bits
R
PressureH[15:0]
47
71
HeightL
Height lower 16 bits
R
HeightL[15:0]
48
72
HeightH
Height high 16 bits
R
HeightH[15:0]
49
73
LonL
Longitude lower 16 bits
R
LonL[15:0]
4A
74
LonH
Longitude high 16 bits
R
LonH[15:0]
4B
75
LatL
Latitude lower 16 bits
R
LatL[15:0]
4C
76
LatH
Latitude high 16 bits
R
LatH[15:0]
4D
77
GPSHeight
GPS Altitude
R
GPSHeight[15:0]
4E
78
GPSYAW
GPS heading angle
R
GPSYAW[15:0]
4F
79
GPSVL
GPS ground speed low 16 bits
R
GPSVL[15:0]
50
80
GPSVH
GPS ground speed high 16 bits
R
GPSVH[15:0]
51
81
q0
Quaternion 0
R
q0[15:0]
52
82
q1
Quaternion 1
R
q1[15:0]
53
83
q2
Quaternion 2
R
q2[15:0]
54
84
q3
Quaternion 3
R
q3[15:0]
55
85
SVNUM
Number of satellites
R
SVNUM[15:0]
56
86
PDOP
Position accuracy
R
PDOP[15:0]
57
87
HDOP
Horizontal accuracy
R
HDOP[15:0]
58
88
VDOP
vertical accuracy
R
VDOP[15:0]
59
89
DELAYT
Alarm signal delay
R/W
DELAYT[15:0]
5A
90
XMIN
X-axis angle alarm minimum value
R/W
XMIN[15:0]
5B
91
XMAX
X-axis angle alarm maximum value
R/W
XMAX[15:0]
5D
93
ALARMPIN
Alarm Pin Mapping
R/W
X-ALARM[15:12]
X+ALARM[11: 8]
Y- ALARM[7:4]
Y+ALARM[3:0]
5E
94
YMIN
Y-axis angle alarm minimum value
R/W
YMIN[15:0]
5F
95
YMAX
Y-axis angle alarm maximum value
R/W
YMAX[15:0]
61
97
GYROCALIT HR
Gyro Still Threshold
R/W
GYROCALITHR[15:0]
62
98
ALARMLEV EL
Angle alarm level
R/W
ALARMLEVEL[3: 0]
63
99
GYROCALTI ME
Gyro auto calibration time
R/W
GYROCALTIME[15:0]
68
104
TRIGTIME
Alarm continuous trigger time
R/W
TRIGTIME[15:0]
69
105
KEY
unlock
R/W
KEY[15:0]
6A
106
WERROR
Gyroscope change value
R
WERROR[15:0]
6B
107
TIMEZONE
GPS time zone
R/W
TIMEZONE[7:0]
6E
110
WZTIME
Angular velocity continuous rest time
R/W
WZTIME[15:0]
6F
111
WZSTATIC
Angular velocity integral threshold
R/W
WZSTATIC[15:0]
74
116
MODDELAY
485 data response delay
R/W
79
121
XREFROLL
Roll angle zero reference value
R
XREFROLL[15:0]
7A
122
YREFPITCH
Pitch angle zero reference value
R
YREFPITCH[15:0]
7F
127
NUMBERID 1
Device No.1- 2
R
ID2[15:8]
ID1[7:0]
80
128
NUMBERID 2
Device No. 3-
4
R
ID4[15:8]
ID3[7:0]
81
129
NUMBERID 3
Device No. 5-
6
R
ID6[15:8]
ID5[7:0]
82
130
NUMBERID 4
Device No. 7-
8
R
ID8[15:8]
ID7[7:0]
83
131
NUMBERID 5
Device No. 9-
10
R
ID10[15:8]
ID9[7:0]
84
132
NUMBERID 6
Device No. 11-12
R
ID12[15:8]
ID11[7:0]
Protocol format
Read Register Format
Data is sent in hexadecimal, not ASCII.
Each register address, the number of read registers, and the read data are represented by two bytes. The high and low bits of the register address are represented by ADDRH and ADDRL, the high and low bits of the number of registers to be read are represented by LENH and LENL, and the high and low bits of the read data are represented by DATA1H and DATA1L.
The last two bits of the read command are standard CRC check bits. It can be calculated using the CRC check digit calculation tool, and the CRC online calculation website.
command send
Modbus address
Function code
Register upper 8 bits
Register lower 8 bits
Read length high 8 bits
Read length lower 8 bits
Check digit high 8 bits
Check digit lower 8 bits
ID
0x03
(read)
ADDRH[15:8]
ADDRL[7:0]
LENH[15:8]
LENL[7:0]
CRCH[15:8]
CRCL[7:0]
Data return
Modbus address
Function code
read length
Data high 8 bits
Data lower 8 bits
Data high 8
bits
Data lower 8 bits
Data high 8 bits
Data lower 8 bits
Check digit high 8 bits
Check digit lower 8 bits
ID
0x03
(read)
LEN[7:0]
DATA1H[15:8]
DATA1L[7:0]
……
……
DATAnH
DATAnL
CRCH[15:8]
CRCL[7:0]
Write Register Format
Data is sent in hexadecimal, not ASCII.
For each register address, write data is represented by two bytes. The high and low bits of the register address are represented by ADDRH and ADDRL, and the high and low bits of the written data are represented by DATAH and DATAL.
Command send
Modbus address
Function code
Register upper 8 bits
Register low 8 bits
Data high 8 bits
Data lower 8 bits
Check digit high 8 bits
Check digit lower 8 bits
ID
0x06
(write)
ADDRH[15:8]
ADDRL[7:0]
DATAH[15:8]
DATAL[7:0]
CRCH[15:8]
CRCL[7:0]
Data return
Modbus
地址
Function code
Register upper 8 bits
Register low 8 bits
Data high 8 bits
Data lower 8 bits
Check digit high 8 bits
Check digit lower 8 bits
ID
0x06
(write)
ADDRH[15:8]
ADDRL[7:0]
DATAH[15:8]
DATAL[7:0]
CRCH[15:8]
CRCL[7:0]
Register Description
All the following examples are commands when the Modbus address is 0x50 (default). If you change the Modbus address, you need to change the address and CRC check bit in the command accordingly.
SAVE(save/reboot/reset)
Register Name: SAVE Register Address: 0 (0x00) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:0
SAVE[15:0]
Save: 0x0000 Reboot: 0x00FF
Reset: 0x0001
Example:
Send:50 06 00 00 00 FF C4 0B(reboot)
Return:50 06 00 00 00 FF C4 0B
Register Name: CALSW Register Address: 1 (0x01) Read and write direction: R/W
Defaults: 0x0000
Bit
NAME
FUNCTION
15:4
3:0
CAL[3:0]
To set the calibration mode: 0000(0x00): normal working mode 0001(0x01): Auto adder calibration 0011(0x03): height reset
0100(0x04): Set the heading angle to zero
0111(0x07): Magnetic Field Calibration (Spherical Fitting)
1000(0x08): set angle reference
1001(0x09): Magnetic Field Calibration (Dual Plane Mode)
Example:
Send: 50 06 00 01 00 04 D4 48 (the heading angle is set to zero)
Return: 50 06 00 01 00 04 D4 48
Register Name: BAUD Register Address: 4 (0x04) Read and write direction: R/W
Default: 0x0002
Bit
NAME
FUNCTION
15:4
3:0
BAUD[3:0]
Set the serial port baud rate: 0001(0x01): 4800bps
0010(0x02): 9600bps
0011(0x03): 19200bps
0100(0x04): 38400bps
0101(0x05): 57600bps
0110(0x06): 115200bps
0111(0x07): 230400bps
1000(0x08): 460800bps (only supported by WT931/JY931/HWT606/HWT906)
1001(0x09): 921600bps (only supported by WT931/JY931/HWT606/HWT906)
Example:Send:50 06 00 04 00 06 45 88(Set the serial port baud rate:115200)
Return:50 06 00 04 00 06 45 88
Register Name: AXOFFSET~HZOFFSET Register Address: 5~13 (0x05~0x0D) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:0
AXOFFSET[15:0]
Acceleration X-axis bias, actual acceleration offset=AXOFFSET[15:0]/10000(g)
15:0
AYOFFSET[15:0]
Acceleration Y-axis bias, actual acceleration offset=AYOFFSET[15:0]/10000(g)
15:0
AZOFFSET[15:0]
Acceleration Z-axis bias, actual acceleration offset=AZOFFSET[15:0]/10000(g)
15:0
GXOFFSET[15:0]
Angular velocity X-axis bias, actual angular velocity offset=GXOFFSET[15:0]/10000(°/s)
15:0
GYOFFSET[15:0]
Angular velocity Y-axis bias, actual angular velocity offset=GYOFFSET[15:0]/10000(°/s)
15:0
GZOFFSET[15:0]
Angular velocity Z-axis bias, actual angular velocity offset=GZOFFSET[15:0]/10000(°/s)
15:0
HXOFFSET[15:0]
Magnetic field X-axis zero bias
15:0
HYOFFSET[15:0]
Magnetic field Y axis zero bias
15:0
HZOFFSET[15:0]
Magnetic field Z axis zero bias
Example: Send: 50 06 00 05 03 E8 94 F4 (set acceleration X-axis zero bias 0.1g), 0x03E8=1000, 1000/10000=0.1(g)
Return: 50 06 00 05 03 E8 94 F4
Register Name: IICADDR Register Address: 26 (0x1A) Read and write direction: R/W
Default: 0x0050
Bit
NAME
FUNCTION
15:8
7:0
IICADDR[7:0]
Set the device address for I2C and Modbus communication
0x01~0x7F
Example:
Send: 50 06 00 1A 00 02 24 4D (set the device address to 0x02)
Return: 50 06 00 1A 00 02 24 4D
Register Name: LEDOFF Register Address: 27 (0x1B) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:1
0
LEDOFF
1: Turn off the LED light
0: Turn on the LED light
Example:
Send: 50 06 00 1B 00 01 35 8C (turn off the LED light)
Return: 50 06 00 1B 00 01 35 8C
Range)
Register Name: MAGRANGX~MAGRANGZ Register Address: 28~30 (0x1C~0x1E) Read and write direction: R/W
Default: 0x01F4
Bit
NAME
FUNCTION
15:0
MAGRANGX[15:0]
Magnetic field calibration X-axis range
15:0
MAGRANGY[15:0]
Magnetic field calibration Y-axis range
15:0
MAGRANGZ[15:0]
Magnetic field calibration Z-axis range
Example:
Send: 50 06 00 1C 01 F4 45 9A (set the magnetic field calibration X-axis range to 500)
Return: 50 06 00 1C 01 F4 45 9A
Register Name: BANDWIDTH Register Address: 31 (0x1F) Read and write direction: R/W
Default: 0x0004
Bit
NAME
FUNCTION
15:4
3:0
BANDWIDTH[3:0]
Set Bandwidth 0000(0x00): 256Hz
0001(0x01): 188Hz
0010(0x02): 98Hz
0011(0x03): 42Hz
0100(0x04): 20Hz
0101(0x05): 10Hz
0110(0x06): 5Hz
Example:
Send: 50 06 00 1F 00 01 74 4D (set the bandwidth to 188Hz)
Return: 50 06 00 1F 00 01 74 4D
Register Name: GYRORANGE Register Address: 32 (0x20) Read and write direction: R/W
Default: 0x0003
Bit
NAME
FUNCTION
15:4
3:0
GYRORANGE[3:0]
Set the gyro range 0011(0x03): 2000°/s
The default is 2000°/s, fixed and cannot be set
Example:
Send: 50 06 00 20 00 03 C5 80 (set the gyro range to 2000°/s)
Return: 50 06 00 20 00 03 C5 80
Register Name: ACCRANGE Register Address: 33 (0x21) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:4
3:0
ACCRANGE[3:0]
Set the accelerometer range 0000(0x00): ±2g
0011(0x03): ±16g
This parameter cannot be set. The internal adaptive acceleration range of the product will automatically switch to 16g when the acceleration exceeds 2g.
Example:
Send: 50 06 00 21 00 03 94 40 (set the accelerometer range to 16g)
Return: 50 06 00 21 00 03 94 40
SLEEP
Register Name: SLEEP Register Address: 34 (0x22) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:1
0
SLEEP
set hibernate 1(0x01): sleep
Any serial port data, can wake up
Example:
Send: 50 06 00 22 00 01 E5 81 (go to sleep)
Return: 50 06 00 22 00 01 E5 81
ORIENT(Installation direction)
Register Name: ORIENT Register Address: 35 (0x23) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:1
0
ORIENT
Set the installation direction
0 (0x00): horizontal installation
1(0x01): vertical installation (the Y-axis arrow of the coordinate axis must be upward)
Example:
Send: 50 06 00 23 00 01 B4 41 (set vertical installation)
Return: 50 06 00 23 00 01 B4 41
AXIS6(algorithm)
Register Name: AXIS6 Register Address: 36 (0x24) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:1
0
AXIS6
set algorithm
0(0x00): 9-axis algorithm (magnetic field solution navigation angle, absolute heading angle)
1(0x01): 6-axis algorithm (integral solution navigation angle, relative heading angle)
Example:
Send: 50 06 00 24 00 01 05 80 (set the 6-axis algorithm mode)
Return: 50 06 00 24 00 01 05 80
Register Name: FILTK Register Address: 37 (0x25) Read and write direction: R/W
Default: 0x001E
Bit
NAME
FUNCTION
15:0
FILTK[15:0]
Range: 1~10000, the default is 30 (it is not recommended to modify, once modified, if the angle does not meet the requirements for use, please modify it to 30)
The smaller the FILTK[15:0], the stronger the seismic performance and the weaker the real-time performance.
The larger the FILTK[15:0], the weaker the seismic performance and the stronger the real-time performance.
Example:
Send: 50 06 00 25 00 1E 15 88 (set K value filter to 30)
Return: 50 06 00 25 00 1E 15 88
Register Name: ACCFILT Register Address: 42 (0x2A) Read and write direction: R/W
Default: 0x01F4
Bit
NAME
FUNCTION
15:0
ACCFILT[15:0]
Range: 1~10000, the default is 500 (it is not recommended to modify, once modified, if the angle does not meet the requirements for use, please modify it to 500)
The smaller the ACCFILT[15:0], the stronger the seismic performance and the weaker the real-time performance.
The larger the ACCFILT[15:0], the weaker the seismic performance and the stronger the real-time performance.
This parameter is an empirical value, which needs to be debugged according to different environments. In the tractor environment,
ACCFILT[15:0] can be adjusted to 100, because the vibration of the tractor is serious and the anti- vibration performance needs to be improved
Example: Send: 50 06 00 2A 01 F4 A5 94 (set acceleration filter 500)
Return: 50 06 00 2A 01 F4 A5 94
Register Name: VERSION Register Address: 46 (0x2E) Read and write direction: R
Default: none
Bit
NAME
FUNCTION
15:0
VERSION[15:0]
Different products, different version numbers
Example:
Send: 50 03 00 2E 00 01 E9 82 (read version number)
Return: 50 03 00 02 VH VL CRCH CRCL VERSION[15:0]=(short)(((short)VH<<8)|VL)
Register Name: YYMM~MS
Register address: 48~51 (0x30~0x33) Read and write direction: R/W Default: 0x0000
Bit
NAME
FUNCTION
15:8
YYMM[15:8]
mouth
7:0
YYMM[7:0]
year
15:8
DDHH[15:8]
hour
7:0
DDHH[7:0]
day
15:8
MMSS[15:8]
second
7:0
MMSS[7:0]
minute
15:0
MS[15:0]
millisecond
Example: Send: 50 06 00 30 03 16 05 7A (set year 22-03)
Return: 50 06 00 30 03 16 05 7A
Send: 50 06 00 31 09 0C D3 D1 (set date 12-09)
Return: 50 06 00 31 09 0C D3 D1
Send: 50 06 00 32 3A 1E B7 2C (set minutes and seconds 30:58)
Return: 50 06 00 32 3A 1E B7 2C
Send: 50 06 00 33 01 F4 74 53 (set milliseconds 500)
Return: 50 06 00 33 01 F4 74 53
Register Name: AX~AZ
Register address: 52~54 (0x34~0x36) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
AX[15:0]
Acceleration X=AX[15:0]/32768*16g (g is the acceleration of gravity, preferably 9.8m/s2)
15:0
AY[15:0]
Acceleration Y=AY[15:0]/32768*16g (g is the acceleration of gravity, preferably 9.8m/s2)
15:0
AZ[15:0]
Acceleration Z=AZ[15:0]/32768*16g (g is the acceleration of gravity, preferably 9.8m/s2)
Example:
Send: 50 03 00 34 00 03 49 84 (read three-axis acceleration) Return: 50 03 06 AXH AXL AYH AYL AZH AZL CRCH CRCL AX[15:0]=((short)AXH <<8)|AXL;
AY[15:0]=((short)AYH <<8)|AYL;
AZ[15:0]=((short)AZH <<8)|AZL;
Register Name: GX~GZ
Register address: 55~57 (0x37~0x39) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
GX[15:0]
Angular velocity X=GX[15:0]/32768*2000°/s
15:0
GY[15:0]
Angular velocity Y=GY[15:0]/32768*2000°/s
15:0
GZ[15:0]
Angular velocity Z=GZ[15:0]/32768*2000°/s
Example:
Send: 50 03 00 37 00 03 B9 84 (read triaxial angular velocity) Return: 50 03 06 GXH GXL GYH GYL GZH GZL CRCH CRCL GX[15:0]=((short)GXH <<8)|GXL;
GY[15:0]=((short)GYH <<8)|GYL;
GZ[15:0]=((short)GZH <<8)|GZL;
Register name: HX~HZ
Register Address: 58~60 (0x3A~0x3C) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
HX[15:0]
Magnetic field X=HX[15:0] (unit: LSB)
15:0
HY[15:0]
Magnetic field Y=HY[15:0] (unit: LSB)
15:0
HZ[15:0]
Magnetic field Z=HZ[15:0] (unit: LSB)
Example:
Send: 50 03 00 3A 00 03 28 47 (reading the three-axis magnetic field) Return: 50 03 06 HXH HXL HYH HYL HZH HZL CRCH CRCL HX[15:0]=((short)HXH <<8)|HXL;
HY[15:0]=((short)HYH <<8)|HYL;
HZ[15:0]=((short)HZH <<8)|HZL;
Register Name: Roll~Yaw
Register address: 61~63 (0x3D~0x3F) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
Roll[15:0]
Roll angle X=Roll[15:0]/32768*180°
15:0
Pitch[15:0]
Pitch angle Y=Pitch[15:0]/32768*180°
15:0
Yaw[15:0]
Heading angle Z=Yaw[15:0]/32768*180°
Example:
Send: 50 03 00 3D 00 03 99 86 (read three-axis angle)
Return: 50 03 06 RollH RollL PitchH PitchL YawH YawL CRCH CRCL Roll[15:0]=((short)RollH <<8)|RollL;
Pitch[15:0]=((short)PitchH <<8)|PitchL;
Yaw[15:0]=((short)YawH <<8)|YawL;
Register Name: TEMP Register Address: 64 (0x40) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
TEMP[15:0]
temperature=TEMP[15:0]/100℃
Example:
Send: 50 03 00 40 00 01 88 5F (read chip temperature)
Return: 50 03 02 TEMPH TEMPL CRCH CRCL TEMP[15:0]=((short)TEMPH <<8)|TEMPL ;
Register Name: PressureL~HeightH Register address: 69~72 (0x45~0x48) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
PressureL[15:0]
Air pressure=((int)PressureH[15:0]<<16)|PressureL[15:0](Pa)
15:0
PressureH[15:0]
15:0
HeightL[15:0]
Altitude=((int)HeightH[15:0]<<16)|HeightL[15:0](cm)
15:0
HeightH[15:0]
Register Name: LonL~LatH
Register address: 73~76 (0x49~0x4C) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
LonL[15:0]
Lon[31:0]=((int)LonH[15:0]<<16)|LonL[15:0](Pa)
15:0
LonH[15:0]
15:0
LatL[15:0]
Lat[31:0]=((int)LatH[15:0]<<16)|LatL[15:0](cm)
15:0
LatH[15:0]
Example:
Send: 50 03 00 49 00 04 98 5E (read latitude and longitude)
Return: 50 03 06 LonL0 LonL1 LonH0 LonH1 LatL0 LatL1 LatH0 LatH1 CRCH CRCL LonL=((short)LonL0<<8)|LonL1;
LonH=((short)LonH0<<8)|LonH1; LatL=((short)LatL0<<8)|LatL1; LatH=((short)LatH0<<8)|LatH1;
The NMEA8013 standard stipulates that the longitude output format of GPS is ddmm.mmmmm (dd is degrees, mm.mmmmm is minutes), and the decimal point is removed from the longitude/latitude output, so the degrees of longitude/latitude can be calculated as follows:
dd=Lon[31:0]/10000000;
dd=Lat[31:0]/10000000;
The longitude/latitude fraction can be calculated like this: mm.mmmmm=(Lon[31:0]%10000000)/100000; (% means remainder operation) mm.mmmmm=(Lat[31:0]%10000000)/100000; (% means remainder operation)
Register Name: GPSHeight~GPSVH Register address: 77~80 (0x4D~0x50) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
GPSHeight[15:0]
GPS Altitude=GPSHeight[15:0]/10(m)
15:0
GPSYAW[15:0]
GPS heading=GPSYAW[15:0]/100(°)
15:0
GPSVL[15:0]
GPS ground speed=(((int)GPSVH[15:0]<<16)|GPSVL[15:0])/1000(km/h)
15:0
GPSVH[15:0]
Example:
Send: 50 03 00 4D 00 04 D9 9F (read GPS data)
Returns: 50 03 06 GPSHH GPSHL GPSYAWH GPSYAWL GPSVL0 GPSVL1 GPSVH0 GPSVH1 CRCH CRCL
GPSHeight=((short)GPSHH <<8)|GPSHL ; GPSVL=((short)GPSVL1<<8)|GPSVL0 ; GPSVL=((short)GPSVL0<<8)|GPSVL1 ;
GPSVH=((short)GPSVH0<<8)|GPSVH1 ;
Register name: q0~q3
Register address: 81~84 (0x51~0x54) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
q0[15:0]
Quaternion 0=q0[15:0]/32768
15:0
q1[15:0]
Quaternion 1=q1[15:0]/32768
15:0
q2[15:0]
Quaternion 2=q2[15:0]/32768
15:0
q3[15:0]
Quaternion 3=q3[15:0]/32768
Example:
send: 50 03 00 51 00 04 18 59 (read quaternion)
Return: 50 03 08 q0H q0L q1H q1L q2H q2L q3H q3L CRCH CRCL
q0[15:0]=((short)q0H <<8)|q0L ; q1[15:0]=((short)q1H <<8)|q1L ; q2[15:0]=((short)q2H <<8)|q2L ;
q3[15:0]=((short)q3H <<8)|q3L ;
Register Name: SVNUM~VDOP Register address: 85~88 (0x55~0x58) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
SVNUM[15:0]
Number of GPS satellites = SVNUM[15:0]
15:0
PDOP[15:0]
Position positioning longitude=PDOP[15:0]/100
15:0
HDOP[15:0]
Horizontal positioning longitude=HDOP[15:0]/100
15:0
VDOP[15:0]
Vertical positioning longitude=VDOP[15:0]/100
Example:
Send: 50 03 00 55 00 04 59 98 (read GPS positioning accuracy)
return:50 03 08 SVNUMH SVNUML PDOPH PDOPL HDOPH HDOPL VDOPH VDOPL CRCH CRCL
q0SVNUM15:0]=((short)SVNUMH <<8)|SVNUML; PDOP[15:0]=((short)PDOPH<<8)|PDOPL ; HDOP[15:0]=((short)HDOPH<<8)|HDOPL;
VDOP[15:0]=((short)VDOPH<<8)|VDOPL;
Register Name: DELAYT Register Address: 89 (0x59) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:0
DELAYT[15:0]
Unit: ms
After the angle alarm occurs, the port will generate a corresponding alarm signal. When the alarm disappears, the alarm signal will last for a delay of DELAYT[15:0] before disappearing.
Example:
Send: 50 06 00 59 03 E8 54 E6 (set the alarm signal delay 1000ms)
Return: 50 06 00 59 03 E8 54 E6
Register Name: XMIN~XMAX Register address: 90~91 (0x5A~0x5B) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:0
XMIN[15:0]
Set the X-axis angle alarm minimum value
X-axis angle alarm minimum value=XMIN[15:0]*180/32768(°)
15:0
XMAX[15:0]
Set the X-axis angle alarm maximum value
X-axis angle alarm maximum value=XMAX[15:0]*180/32768(°)
Example:
Send: 50 06 00 5A FC 72 65 7D (set -5 degrees), 0xFC72=-910, -910*180/32768=-5
Return: 50 06 00 5A FC 72 65 7D
Send: 50 06 00 5B 03 8E 75 0C (set 5 degrees), 0x038E=910, 910*180/32768=5
Return: 50 06 00 5B 03 8E 75 0C
The X axis will not alarm between -5°~5°, once it exceeds this range, an alarm will occur
Register Name: ALARMPIN Register Address: 93 (0x5D) Read and write direction: R/W
Default: 0x4365
Bit
NAME
FUNCTION
0001(0x01): D0
0010(0x02): D1
0011(0x03): D2
15:12
X-ALARM[15:12]
0100(0x04): D3
0101(0x05): SCL
0110(0x06): SDA
0001(0x01): D0
0010(0x02): D1
0011(0x03): D2
11:8
X+ALARM[11:8]
0100(0x04): D3
0101(0x05): SCL
0110(0x06): SDA
0001(0x01): D0
7:4
Y-ALARM[7:4]
0010(0x02): D1
0011(0x03): D2
0100(0x04): D3
0101(0x05): SCL
0110(0x06): SDA
3:0
Y+ALARM[3:0]
0001(0x01): D0
0010(0x02): D1
0011(0x03): D2
0100(0x04): D3
0101(0x05): SCL
0110(0x06): SDA
Example:
Set X-alarm signal to output on D3 port
Set the X+ alarm signal to output at port D1
Set the Y-alarm signal to output on the SCL port Set the Y+ alarm signal to output at the SCL port Example:
Send: 50 06 00 5D 42 55 E5 06
Return: 50 06 00 5D 42 55 E5 06
Register Name: YMIN~YMAX Register address: 94~95 (0x5E~0x5F) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:0
YMIN[15:0]
Set the Y-axis angle alarm minimum value
Y axis angle alarm minimum value=YMIN[15:0]*180/32768(°)
15:0
YMAX[15:0]
Set the Y-axis angle alarm maximum value
Y-axis angle alarm maximum value=YMAX[15:0]*180/32768(°)
Example:
Send: 50 06 00 5E FC 72 24 BC (set -5 degrees), 0xFC72=-910, -910*180/32768=-5
Return: 50 06 00 5E FC 72 24 BC
Send: 50 06 00 5F 03 8E 34 CD (set 5 degrees), 0x038E=910, 910*180/32768=5
Return: 50 06 00 5F 03 8E 34 CD
The Y axis will not alarm between -5°~5°, once it exceeds this range, an alarm will occur
Register Name: GYROCALITHR Register Address: 97 (0x61) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:0
GYROCALITHR[15:0]
Set the gyroscope inactivity threshold:
Gyro static threshold=GYROCALITHR[15:0]/1000(°/s)
Example:
Send: 50 06 00 61 00 32 54 40 (set the gyro static threshold to 0.05°/s)
Return: 50 06 00 61 00 32 54 40
When the angular velocity change is less than 0.05°/s and lasts for the time of "GYROCALTIME", the sensor recognizes it as stationary and automatically resets the angular velocity less than 0.05°/s to zero
The setting rule of the static threshold of the gyroscope can be determined by reading the value of the "WERROR" register. The general setting rule is: GYROCALITHR=WERROR*1.2, unit: °/s
This register needs to be used in conjunction with the GYROCALTIME register
Register Name: ALARMLEVEL Register Address: 98 (0x62) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:4
3:0
ALARMLEVEL[3:0]
To set the alarm level:
0000(0x00): Low level alarm (high level when not alarming, low level when alarming)
0001(0x01): High level alarm (low level when not alarming, high level when alarming)
Example:
Send: 50 06 00 62 00 01 E4 55 (set high level alarm)
Return: 50 06 00 62 00 01 E4 55
Register Name: GYROCALTIME Register Address: 99 (0x63) Read and write direction: R/W
Default: 0x03E8
Bit
NAME
FUNCTION
15:0
GYROCALTIME[15:0]
Set gyroscope auto-calibration time
Example: Set gyroscope auto-calibration time to 500ms Send: 50 06 00 63 01 F4 74 42 (set high level alarm)
Return: 50 06 00 63 01 F4 74 42
When the angular velocity change is less than "GYROCALITHR" and lasts for 500ms, the sensor recognizes that it is stationary and automatically resets the angular velocity less than 0.05°/s to zero
This register needs to be used in conjunction with the GYROCALITHR register
Register Name: TRIGTIME Register Address: 104 (0x68) Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:0
TRIGTIME[15:0]
Set the alarm continuous trigger time
Example: Set the alarm continuous trigger time to 500ms Send: 50 06 00 68 01 F4 05 80 (set high level alarm)
Return: 50 06 00 68 01 F4 05 80
When the angle alarm occurs, the alarm signal will not be output immediately, and the alarm signal can be output only when the angle alarm lasts for 500ms. This register is used to filter out alarms caused by malfunctions
Register Name: KEY Register Address: 105 (0x69)
Read and write direction: R/W
Default: 0x0000
Bit
NAME
FUNCTION
15:0
KEY[15:0]
Unlock register: When performing a write operation, you need to set this register first
Example:
Send: 50 06 00 69 B5 88 22 A1 (unlocked)
Return: 50 06 00 69 B5 88 22 A1
Unlock, write 0xB588 to this register (other values are invalid)
Register Name: WERROR Register Address: 106 (0x6A) Read and write direction: R
Default: 0x0000
Bit
NAME
FUNCTION
15:0
WERROR[15:0]
Gyroscope change value=WERROR[15:0]/1000*180/3.1415926(°/s)
When the sensor is stationary, the "GYROCALITHR" register can be set by changing this register
Register Name: TIMEZONE Register Address: 107 (0x6B) Read and write direction: R/W
Default: 0x0014
Bit
NAME
FUNCTION
15:8
Set GPS time zone:
00000000(0x0000): UTC-12
00000001(0x0001): UTC-11
00000010(0x0002): UTC-10
00000011(0x0003): UTC-9
00000100(0x0004): UTC-8
7:0
TIMEZONE[7:0]
00000101(0x0005): UTC-7
00000110(0x0006): UTC-6
00000111(0x0007): UTC-5
00001000(0x0008): UTC-4
00001001(0x0009): UTC-3
00001010(0x000A): UTC-2
00001011(0x000B): UTC-1
00001100(0x000C): UTC
00001101(0x000D): UTC+1
00001110(0x000E): UTC+2
00001111(0x000F): UTC+3
00010000(0x0010): UTC+4
00010001(0x0011): UTC+5
00010010(0x0012): UTC+6
00010011(0x0013): UTC+7
00010100(0x0014): UTC+8(Default East 8th District)
00010101(0x0015): UTC+9
00010110(0x0016): UTC+10
00010111(0x0017): UTC+11
00011000(0x0018): UTC+12
Example:
Send: 50 06 00 6B 00 15 34 58 (set GPS time zone to East 9)
Return: 50 06 00 6B 00 15 34 58
Register Name: WZTIME Register Address: 110 (0x6E) Read and write direction: R/W
Default: 0x01F4
Bit
NAME
FUNCTION
15:0
WZTIME[15:0]
Angular velocity continuous rest time
Example:
Send: 50 06 00 6E 01 F4 E5 81 (set the angular velocity continuous static time 500ms) Return: 50 06 00 6E 01 F4 E5 81
When the angular velocity is less than "WZSTATIC" and lasts for 500ms, the angular velocity output is 0, and the Z-axis heading angle is not integrated
This register needs to be used in conjunction with the "WZSTATIC" register
Register Name: WZSTATIC Register Address: 111 (0x6F) Read and write direction: R/W
Default: 0x012C
Bit
NAME
FUNCTION
15:0
WZSTATIC[15:0]
Angular velocity integral threshold=WZSTATIC[15:0]/1000(°/s)
Example:
Send: 50 06 00 6F 01 F4 E5 81 (set the angular velocity integration threshold to 0.5°/s) Return: 50 06 00 6F 01 F4 E5 81
When the angular velocity is greater than 0.5°/s, the Z-axis heading angle starts to integrate the acceleration
When the angular velocity is less than 0.5°/s, and the duration set by the register "WZTIME", the angular velocity output is 0, and the Z-axis heading angle is not integrated
This register needs to be used in conjunction with the "WZTIME" register
Register Name: MODDELAY Register Address: 116 (0x74) Read and write direction: R/W
Default: 0x0BB8
Bit
NAME
FUNCTION
15:0
MODDELAY[15:0]
Set 485 data response delay, default 3000, unit: us
Example:
Send: 50 06 00 74 03 E8 C4 EF (set 485 data response delay 1000us)
Return: 50 06 00 74 03 E8 C4 EF
When the sensor receives the Modbus read command, the sensor delays 1000us and returns data
This register only supports Modbus version of the sensor
Register Name: XREFROLL~YREFPITCH Register address: 121~122 (0x79~0x7A) Read and write direction: R/W
Default: 0x00000
Bit
NAME
FUNCTION
15:0
XREFROLL[15:0]
Roll angle zero reference value=XREFROLL[15:0]/32768*180(°)
15:0
YREFPITCH[15:0]
Pitch angle zero reference value=YREFPITCH[15:0]/32768*180(°)
Example: The current roll angle is 2°, set the roll angle zero, subtract 2°, then XREFROLL[15:0]=2*32768/180=364=0x016C
FFAA 79 6C 01
Example: The current roll angle is 2°, set the roll angle zero, subtract 2°, then XREFROLL[15:0]=2*32768/180=364=0x016C
Send: 50 06 00 79 01 6C 54 2F
Return: 50 06 00 79 01 6C 54 2F
Register Name: NUMBERID1~NUMBERID6 Register address: 127~132 (0x7F~0x84) Read and write direction: R
Default: none
Bit
NAME
FUNCTION
15:0
NUMBERID1[15:0]
15:0
NUMBERID2[15:0]
15:0
NUMBERID3[15:0]
15:0
NUMBERID4[15:0]
15:0
NUMBERID5[15:0]
15:0
NUMBERID6[15:0]
Device label:WT4200000001
Last updated