Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How do I Interpret Modbus Registers Written in Hexadecimal Format?

Primary Software: LabVIEW Modules>>DSC Module
Primary Software Version: 8.0
Primary Software Fixed Version: N/A
Secondary Software: Lookout

Problem:

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 combine 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 (5A) 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.



Related Links:
[External Link] Conversion between Hex and Decimal
Developer Zone Tutorial: Getting started with Modbus in Lookout

Attachments:





Report Date: 04/27/2006
Last Updated: 08/22/2007
Document ID: 3WQB83XJ

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit