Support Forums
32bit float displays as 2 registers of decimal

I can read MODBUS 32bit floating point values into the DataTaker. Using p56=4, I can also see the hex code coming in and it is correctly coded up as 32bit floating point data. And I can even get that 32bit hex code to span across two Channel Variables. This is my simple code: 1MODBUS(AD1,R4:2001,=1..2CV)

BUT, I cannot then get that floating point data to display as anything other than two seperate channel variables giving decimals equivalents of the hex values stored in them.

That is, declaring "1CV" returns a decimal value, and equivalent "2CV" returns another decimal value!?

How do I do something like "1..2CV %f" to get it to show the floating point data, stored across both channel variables?

Kind of the same issue, I also have ASCII coming in over MODBUS and can store the characters as binary in CV's. But I cannot display it as ASCII, it always displays as decimal. Declaring "1CV" always displays the decimal value of the ASCII code. What am I missing?

I can read MODBUS 32bit floating point values into the DataTaker. Using p56=4, I can also see the hex code coming in and it is correctly coded up as 32bit floating point data. And I can even get that 32bit hex code to span across two Channel Variables. This is my simple code: 1MODBUS(AD1,R4:2001,=1..2CV) BUT, I cannot then get that floating point data to display as anything other than two seperate channel variables giving decimals equivalents of the hex values stored in them. That is, declaring "1CV" returns a decimal value, and equivalent "2CV" returns another decimal value!? How do I do something like "1..2CV %f" to get it to show the floating point data, stored across both channel variables? Kind of the same issue, I also have ASCII coming in over MODBUS and can store the characters as binary in CV's. But I cannot display it as ASCII, it always displays as decimal. Declaring "1CV" always displays the decimal value of the ASCII code. What am I missing?

Hi BillyBob,

The CV can host only 16-bit number, if you wish to retrieve a floating point number from the sensor you need to set it into 32-bit using MBF option.
1MODBUS(AD1,R4:2001,=1CV,MBF)

The default conversion is big endian (MES option), in case the number uses a little endian format you can change the script into
1MODBUS(AD1,R4:2001,=1CV,MBF,MER)

If you wish to retrieve the register address 2001, 2003 and 2005, you can use this command:
1MODBUS(AD1,R4:2001,=1..3CV,MBF)

Best regards,
dataTaker Expert

Hi BillyBob, The CV can host only 16-bit number, if you wish to retrieve a floating point number from the sensor you need to set it into 32-bit using MBF option. 1MODBUS(AD1,R4:2001,=1CV,MBF) The default conversion is big endian (MES option), in case the number uses a little endian format you can change the script into 1MODBUS(AD1,R4:2001,=1CV,MBF,MER) If you wish to retrieve the register address 2001, 2003 and 2005, you can use this command: 1MODBUS(AD1,R4:2001,=1..3CV,MBF) Best regards, dataTaker Expert
26
1
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft