Read a voltage value from the response message

S

Thread Starter

Susan

Dear all,

I am writing a small application to communicate with VMU-M and VMU-S devices by using Visual Basic.

This is my request sent to VMU devices: 02-03-03-0A-00-01-A4-7F where:

+ 02: Physical Address
+ 03: Function code to read holding register
+030A: Address to request the voltage value
+ 00-01: Quantity of register (in this case N = 1)
+ A4-7F: CRC16 value

After sending this message to VMU devices, this is the response message that I received:

02-03-02-00-ED-3C-09. I have known from this message that:
+ 02: Module code, this is 2 = VMU-S
+ 03: Function code
+ 02: 2 bytes
+ 00-ED: the voltage value
+3C09: CRC16 check

However, based on this message, I don’t know how to convert/understand the voltage value as float point. Could you please help me on this issue? Thank you so so much.

Best regards,
Susan
 
Modbus does not specify number formats. Formats are specified by the product vendor.

Most references to floating point (FP) used with Modbus are for IEEE 754 floating point.

The huge majority of FP is 32 bit, single precision floating point.

32 bits is 4 bytes, or 2 registers in Modbus.
There are 2 common and 2 uncommon ways to order the 4 bytes, but that's on page 5 and we're only page 2, because your response provided only 2 bytes, or one register.

So, either you have an example of extremely rare, IEEE 754 half precision 16 bit floating point, or maybe it isn't floating point, or maybe you didn't read enough bytes/registers.

If it isn't floating point, but an integer, then 00ED is decimal 237.

But whether it is 0.237V or 2.37V depends on an assumed decimal point.

And integer values are frequently scaled by a fixed factor.

Wikipedia has an overview of IEEE 754 floating point:
http://en.wikipedia.org/wiki/IEEE_754-2008
 
Top