07-04-2024 04:14 AM
Hi,
I have been trying to convert data from a modbus register but still could not do it. I have tried the cast function it did not work.
Does someone has experience with these conversion?
Thanks
Solved! Go to Solution.
07-04-2024 04:20 AM
Hi,
Have you tried reading 4 registers ?
As DBL is 64 bits long, it require 4 uint16.
07-04-2024 04:35 AM
I have just tried the 4 registers and it did not work.
In the attached picture, the value in green is the real value in the device. The value in " *(type *) & " is what comes from the type cast.
07-04-2024 04:37 AM - edited 07-04-2024 04:43 AM
Hi Henk,
most (all?) Modbus implementations I worked with so far use the IEEE-SGL format for "floats", so you should convert 2 U16 values into a SGL value in LabVIEW…
Edit:
Thanks for posting actual values:
Do you expect a value of 60 for the Modbus register reading?
07-04-2024 05:57 AM - edited 07-04-2024 05:59 AM
Hi GerdW,
Thank you very much for taking your time to help me. It works.