Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2008
    Posts
    8

    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. #2
    Join Date
    Feb 2005
    Posts
    1,226
    make and model of the field device?

  3. #3
    Join Date
    Jan 2003
    Location
    USA
    Posts
    1,685
    >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. #4
    Join Date
    Jan 2003
    Location
    USA
    Posts
    1,685
    almost forgot....

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

  5. #5
    Join Date
    Aug 2008
    Posts
    8

    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)

    Thanks in advance for your help ;-)
    Last edited by bridgeIT; 09-03-2008 at 10:03 PM.

  6. #6
    Join Date
    Jan 2003
    Location
    USA
    Posts
    1,685
    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. Im 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. #7
    Join Date
    Nov 2007
    Location
    CA
    Posts
    28
    Try and get your info here.

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

  8. #8
    Join Date
    Aug 2008
    Posts
    8

    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
  •  
Comfortech Show Promo Image

Related Forums

Plumbing Talks | Contractor Magazine
Forums | Electrical Construction & Maintenance (EC&M) Magazine
Comfortech365 Virtual Event