Interpreting Modbus Registers Written in Hexadecimal Format

Updated Apr 3, 2023

Reported In

Software

  • Lookout Server
  • Lookout Client
  • LabVIEW Datalogging and Supervisory Control Module

Issue Details

I have a device that communicates through the Modbus protocol. The manual for the device gives the registers in hexadecimal format. LabVIEW and Lookout use decimal format for the register addresses. I tried simply converting them from hexadecimal to decimal, but that does not seem to work.

Solution

The Modbus protocol addressing scheme contains various ranges as well as raw addresses. For example, there is the 30000 range and the 40000 range. Each range has raw addresses within them as well as different data types (some are Boolean but others are 16 bit numbers). In order to convert hexadecimal register values into their decimal equivalents, you must first figure out which range the addresses are supposed to be in. Then convert the hex to decimal and add it with the range. Refer to the example below for the G7 Yasawa Drive. 

The manual for the G7 Drive from Yasawa might say use 05Ah address for a configuration register. It turns out that the G7 drive use the 40000 range (read/write 16-bit). Convert the hex (05A) to decimal you get 90. Combine that with the range and you get an address of 40090. Write or Read from this register to control that configuration register on the G7 through Modbus.