From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-28-2019 03:19 AM
Hi everyone,
Would you please tell me how to convert this kind of string data (that is from spectrum analyzer) to numbers? the picture is attached.
Many Thanks,
Marjan
Solved! Go to Solution.
03-28-2019 03:35 AM
Hi Marjan,
please tell me how to convert this kind of string data (that is from spectrum analyzer) to numbers?
Simple answer: read the manual of your SpectrumAnalyzer to know how to convert that string…
the picture is attached.
You're kidding: you want help on string conversion with your VI - and all you attach is an image of its frontpanel?
It's like bringing a photo of your car to the repairshop when you want help with it…
03-28-2019 03:57 AM
Hi GerdW,
Thanks for your reply.
In the user manual doesn't say anything for converting in the Labview!!
I just wanted somebody tell me how to convert this kind of data and I thought no need to send the real data. If you think is better to have it as vi, here is attached.
03-28-2019 04:08 AM - edited 03-28-2019 04:09 AM
Hi Samamiri,
In the user manual doesn't say anything for converting in the Labview!!
I don't expect that.
But I expect a clear description of how the data is encoded in this string. And you need to know that encoding to be able to decode the string!
You still wasn't able to name the exact type of your analyzer. You didn't tell us how you received that string (using which command and parameters)!
And the VI you attached is empty as you forgot to set some meaningful data as default value…
03-28-2019 04:13 AM
OK, Thanks, I will find out how the data is encoded and then back to you.
03-28-2019 05:10 AM
Hi,
I used a simple read and write vi which is attached, the Spectrum analyzer is Hantek, and there are two formats for output data:
ASCII : The data point is ASCII character, separated by comma.
REAL: The data point is 32 bit binary number.
Thanks
Marjan
03-28-2019 07:40 AM
Strip off the first 11 ASCII characters. Typecast the remaining to Single Floating Point
03-28-2019 08:28 AM
Hi,
Thank you very much for your suggestion. It seems it work but when I plot the data it is slightly different from that one which shows by the spectrometer unit. You can see both the vi with the graph and the screen shot of the spectrum in the attachments. And also this result comes by real format and when I change it to the ASCII format that completely gives a different result.
Thanks again
03-28-2019 08:29 AM
Attached another file
03-28-2019 09:08 AM
Hi,
Now it works perfectly and the graphs are matched, just I have changed some scales. Thanks for your help.