# Thread: Jace & ModbusRTU Conversion

1. Regular Guest
Join Date
Aug 2008
Posts
8
Post Likes

## Jace & ModbusRTU Conversion

I was hoping that I could find some help in converting Modbus Data.
The System has a Jace and the ModbusRTU driver. I have the AI's scaled and working properly, however the Modbus Device use High and Low Byte data for Setpoints. This data is in Decimal and needs to be converted to hex before splitting the Hi and Lo bytes. Does anyone know of a conversion from Decimal to Hex?

2. make and model of the field device?

3. >Does anyone know of a conversion from Decimal to Hex?

Do you know what type of point is it. 32bit integer, 32bit IEEE float or some other 32bit float? All three of these can be used in Modbus.

4. almost forgot....

Just to keep it simple it could be 32bit signed or unsigned interger also.

5. Regular Guest
Join Date
Aug 2008
Posts
8
Post Likes

## Modbus Device

The Modbus Device is a York Simpicity 3-25 Ton Roof Top Unit.
It uses a 16 bit Unsigned Integer.
Ex. Register returns Decimal Value: 18500
Hex Value: 4844
Hex High Byte: 48 Decimal High Byte: 72
Hex Low Byte: 44 Decimal Low Byte: 68

In this same example if I read Register as A string value: HD
String High Byte: (Ascii 72=H)
String Low Byte: (Ascii 68=D)

Last edited by bridgeIT; 09-03-2008 at 10:03 PM.

6. Roger I had the idea you where talking about 32bit numbers. To convert this over to this over to hex you will need to do a bit work. I’m not familiar with the Jace, but pending you can write some line code in it this should be simple enough.

You need to divide the number 16 and figure out the remainder each step along the way.

18500 / 16 = 1156 with a remainder of 4
1156 / 16 = 72 with a remainder of 4
72 / 16 = 4 with a remainder of 8
4 / 16 = 0 with a remainder of 4

Take your remainders and convert them to hex 0-F with a lookup table. In this case all the remainders are below 11, so there is no change. Reverse the order and you come up with the answer 4844h.

Using a loop-while structure keep dividing unitil you have a result that is zero, and then convert your remainders to hex. Hope this helps give you an idea on how to convert decimal to hex.

7. Regular Guest
Join Date
Nov 2007
Location
CA
Posts
28
Post Likes
Try and get your info here.

http://www.onlineconversion.com/base.htm

8. Regular Guest
Join Date
Aug 2008
Posts
8
Post Likes

## Modbus Setpoint Registers

Thanks for all of your replies. A friend sent me a custom palette that took care of the conversion.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

## Related Forums

The place where Electrical professionals meet.