10-06-2015 12:15 AM
Hello,
My hardware is sending floating piont values on serial port.
I want to present these values to the Labview.
The values are like 24.35 30.1 etc
each value to be plotted on the display seperately.
Regards
10-06-2015 12:21 AM
How do you expect you get help if you do not give enough info? What is your hardware? A vacuum cleaner? A mass spectroscope? A multimeter?
Specify the name/model of your hardware, it is easily possible too that it has LabVIEW drivers. If not, you should search for its manual to see what it uses for communication (SCPI)?
10-06-2015 03:39 AM - edited 10-06-2015 03:39 AM
And how does it send those values? Most measurement instruments send values in ASCII Text which is pretty trivial to parse! LabVIEW has in its string palette ready made functions to do that for most non-execotic string formats.
10-06-2015 05:13 AM
Thanks alot to all for replying.
I am getting numbers from the arduino board. So its not in the ascii format.
Regards
10-06-2015 05:43 AM
That's still very unclear. The Arduino board sends whatever your firmware (sketch) has been programmed to send. That could be a binary floating point number, or a binary integer that you have to scale to floating point yourself on the LabVIEW side, or really a string anyways despite you claiming it is not in ASCII. Show us what you have done so far and what your VI has been receiving.
10-06-2015 06:43 AM
"Floating Point real numbers" exist in a variety of formats, with a variety of byte orderings. LabVIEW has at least three "native" Float representations -- Single (32 bits/4 bytes), Double (64 bits/8 bytes), and Extended (in Windows, 128 bits/16 bytes). If your device is using one of these formats and you know the number of bytes and their order (sometimes called the "Endian-ness", as in Big-Endian and Little-Endian), you can accumulate the bytes (as U8s) into an appropriately-sized Array of Bytes and then use LabVIEW's TypeCast function to convert this Array of Bytes into a Float.
If your device outputs data in a slightly different "flavor" of Float, you may need to convert it to the IEEE format (which is that I think LabVIEW uses). For example, I used to get data from a PDP-11, whose floating point was (as I recall) byte-reversed from IEEE and used a different "rule" for the exponent that resulted in a "factor of 4" difference on conversion. As I recall, I chose to convert then do the factor-of-4 adjustment (rather than adding/subtracting 2 to the exponent part of the representation).
Bob Schor