Skip to main content

Modbus

The following is a complete overview of the Modbus registers and functions for your STATOTEST-LASER device:

πŸ“‹ MODBUS REGISTERS AND FUNCTIONS​

πŸ“– READ HOLDING REGISTERS (0x03)​

AddressTypeDescriptionUnitRangeExample
0uint16Device status-0-11 (active)
1uint16Firmware version-0-655351
2uint16Hardware version-0-655352
3uint16Measurement state-0-40=idle, 2=measuring, 3=done, 4=continuous
4uint16Distance (low part)0.1mm0-6553512345 (=1.2345m)
5uint16Distance (high part)0.1mm0-655350
6uint16Laser state-0-10=OFF, 1=ON
7uint16Temperature0.1Β°C-400-800235 (=23.5Β°C)
8uint16Voltage0.1V0-10033 (=3.3V)
9uint16Signal quality%0-10085
10uint16Device address-1-2541
11uint16Baudrate code-1-74 (=19200)
12uint16Error code-0-170=OK
13uint16Bluetooth state-0-11=enabled
14uint16WiFi state-0-10=disabled

Special distance reading:​

  • Address 4, 2 words: Returns the complete 32-bit distance (low + high part)
  • Address 4, 1 word: Returns only the low part of the distance
  • Address 5, 1 word: Returns only the high part of the distance

πŸ”§ WRITE SINGLE REGISTER (0x06)​

AddressFunctionValuesDescriptionExample
3Measurement control0=stop, 1=single, 4=continuousStarts/stops a measurement1
5Laser control0=OFF, 1=ONTurns the laser on/off1
10Address setting1-254Changes the Modbus address5
11Baudrate setting1-7Changes the RS485 speed4
13Bluetooth control0=disable, 1=enableTurns BT on/off1
14WiFi control0=disable, 1=enableTurns WiFi on/off1

Baudrate codes (address 11):​

CodeBaudrate
12400
24800
39600
419200
538400
657600
7115200

πŸ”€ WRITE SINGLE COIL (0x05)​

AddressFunctionValuesDescription
13 (0x0D)Start measurement0x0000=stop, 0xFF00=startAlternative way to start a measurement

βš™οΈ COMMUNICATION CONFIGURATION​

ParameterValue
Default address1
Default baudrate19200
Data bits8
ParityNone
Stop bits1
Broadcast address255 (supported)

πŸ“ MEASUREMENT DATA FORMAT​

Distance (32-bit):​

  • Unit: 0.1 mm (0.0001 m)
  • Range: 0 - 4294967295 (0-429496.7295 m)
  • Example: 12345 = 1.2345 m

Temperature:​

  • Unit: 0.1Β°C
  • Range: -40.0Β°C to +80.0Β°C
  • Example: 235 = 23.5Β°C

Voltage:​

  • Unit: 0.1V
  • Range: 0.0V to 10.0V
  • Example: 33 = 3.3V

🚨 ERROR CODES (Address 12)​

CodeDescription
0No error
1Low voltage
2Internal error
3Low temperature
4High temperature
5Target out of range
6Invalid result
7Background too strong
8Weak reflected signal
9Strong reflected signal
10-14Hardware errors
15Vibration too high
16-17Hardware errors

πŸ“‹ COMMAND EXAMPLES​

Reading the distance (32-bit):​

Command: 01 03 00 04 00 02 CRC
Response: 01 03 04 30 39 00 00 CRC
Result: 12345 = 1.2345 m

Starting a measurement:​

Command: 01 06 00 03 00 01 CRC
Response: 01 06 00 03 00 01 CRC

Turning the laser on:​

Command: 01 06 00 05 00 01 CRC  
Response: 01 06 00 05 00 01 CRC

Setting the address to 5:​

Command: 01 06 00 0A 00 05 CRC
Response: 01 06 00 0A 00 05 CRC

Starting a measurement via Write Coil:​

Command: 01 05 00 0D FF 00 CRC
Response: 01 05 00 0D FF 00 CRC

πŸ”„ MEASUREMENT STATES (Address 3)​

StateDescription
0Idle
2Measurement in progress
3Measurement completed
4Continuous measurement

⚠️ NOTES​

  • Broadcast address 255 is supported for all functions
  • Configuration changes are saved to the flash memory
  • A measurement automatically resets the state to 0 after it is read
  • Continuous measurement runs until it is stopped
  • All registers are read-only except addresses 3, 5, 10, 11, 13, 14