Re: constructing modbus tcp messages for float and 32 bit integers



On 28 Nov 2005 23:14:23 -0800, "prasi" <kp.prasanna@xxxxxxxxx> wrote:


>Can anyone please Explain me how to handle float and 32 bit values in
>modbusTCP protocol.

Put 16 bits in e.g. register 1000 and the rest 16 bits into register
1001. Use two adjacent registers for the 32 bit and/or floating point
data.

Which 16 bits (and in what byte order) should be put into reg 1000 and
what into reg 1001 that you have to figure out yourself. The
convention varies from device to device. Some device might even expect
non-IEEE floating point formats :-).

Paul

.



Relevant Pages

  • Re: weird problem
    ... I already told you that the comparison between an integer and a float ... And now a question about something else: why do you use floating ... use then to copy a float into a char *1. ... binary representation doesn't resemble a string like "123.46343" ...
    (comp.lang.c)
  • Re: Safer of 2 methods for very long doc
    ... I use wrapped objects so seldom that I have to think about how I've handled that when I have used them, and I guess, as you say, I've moved the anchor. ... paragraph and the picture move to the next page. ... in Word the text does not flow from after a 'floating' ... >I'd appreciate knowing how you "float" a table, ...
    (microsoft.public.word.docmanagement)
  • Re: float vs. double?
    ... There have been repeated myths that float is faster than double. ... In antique machines, the ... Note that the floating-point ALU of Intel chips supports an 80-bit floating point number, ... is different precision being stored? ...
    (microsoft.public.vc.mfc)
  • Re: Rounding of the double
    ... I still think you can do what you want using DWORDs and just assume the decimal position rather than using floats of doubles. ... I think you're going to have the same problem in any language as the floating point technology is not specific to C++ or unmanaged C++. ... /* Round a double or float to 'sig' places to the left or right of the decimal. ... As Joe says "there is no accurate representation of 0.80 in IEEE floating ...
    (microsoft.public.vc.mfc)
  • Re: converting float to double
    ... necessarily the one preferred for financial transactions. ... What he has is a float that approximates the desired value. ... I'd say eschew floating point except where necessary ... cents = lrint ...
    (comp.lang.c)