General Discussions
Convert Return from Float Decimal to Usuable Decimal

Complete newbie here and am self teaching myself VTScada and SCADA in general. I am getting a float variable back from the MODBUS expressed in exponential form. I now need to convert this to its actual value that the float represents. Is there a function in VTScada that does this or do I need to write a function to go to binary, decodes the binary and then convert back to decimal.

Complete newbie here and am self teaching myself VTScada and SCADA in general. I am getting a float variable back from the MODBUS expressed in exponential form. I now need to convert this to its actual value that the float represents. Is there a function in VTScada that does this or do I need to write a function to go to binary, decodes the binary and then convert back to decimal.

Floating point values in Modbus will need to read two registers. Essentially, you'll need to append the address with /float to tell VTScada the datatype to expect. VTScada's Modbus driver makes a guess at the type based on the address (per the modbus protocol) but you can append the address to specify something else.

You can read about that a bit more in the help files here: https://www.vtscada.com/help/Content/D_Tags/Dev_DataSuffixesForTagIO.htm

Floating point values in Modbus will need to read two registers. Essentially, you'll need to append the address with /float to tell VTScada the datatype to expect. VTScada's Modbus driver makes a guess at the type based on the address (per the modbus protocol) but you can append the address to specify something else. You can read about that a bit more in the help files here: https://www.vtscada.com/help/Content/D_Tags/Dev_DataSuffixesForTagIO.htm

Trihedral Engineering Ltd.

Dave, thank you for your answer. I guess I was not clear. I have added /float to my register address and am getting a string representing what I believe is the decimal equivalent representation of the floating variable in binary, although the negative scientific notation has me confused.. For example. The return from the first register / float is 2.3873921936702E-41. I need to convert this to the actual number it represents.

I am sure I am missing something, but as I said I am self taught, so my knowledge level is low

Cheers,

Darrell

Dave, thank you for your answer. I guess I was not clear. I have added /float to my register address and am getting a string representing what I believe is the decimal equivalent representation of the floating variable in binary, although the negative scientific notation has me confused.. For example. The return from the first register / float is 2.3873921936702E-41. I need to convert this to the actual number it represents. I am sure I am missing something, but as I said I am self taught, so my knowledge level is low Cheers, Darrell

Forget this. I just figured out my error. Sorry to bother you.

Forget this. I just figured out my error. Sorry to bother you.
60
3
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