Ad Widget

Collapse

Interpreting 32bit floats that are stored in modbus registers as 16bit Integers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wispman
    Junior Member
    • Jun 2007
    • 10

    #1

    Interpreting 32bit floats that are stored in modbus registers as 16bit Integers

    Modbus stores floating point numbers using two consecutive 16-bit registers, which together form a 32-bit value. This method is based on the IEEE 754 standard for floating point representation.
    The storage of floating point numbers in Modbus can be summarized as follows:
    Register 1 Most Significant Word (MSW) Holds the upper 16 bits of the 32-bit float
    Register 2 Least Significant Word (LSW) Holds the lower 16 bits of the 32-bit float
    I am able to query the modbus registry fine, but I am not able to figure out how to combine the two 16bit values to get the real number.
    I am also not able to find documentation or examples of this common scenario.
    Any help would be appreciated,
    Thanks!
  • wispman
    Junior Member
    • Jun 2007
    • 10

    #2
    Anyone have a tip for me? Since zabbix supports modbus, it would seem like this question would have been addressed?

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4904

      #3
      3rd item, calculated, concat 2 values?
      But then again, I may be talking about things, I have no idea .. : D

      Comment

      • wispman
        Junior Member
        • Jun 2007
        • 10

        #4
        The way I understand the problem is that there are two 16bit INT and they need to be interpreted as binary and then the binary values need to be concatenated in the right order, then this 32bit binary needs to be converted to Float 32bit decimal.
        I may be incorrect in my understanding, so looking for guidance and also a solution here from someone more experienced than I.

        Comment

        Working...