Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB data format

Hello,

I am trying to get data off of a spectral analyzer via a GPIB connection. I am trying to get an ASCII file with the data for the current plot. However, the data seems to be in scientific format, and I am losing data because there is not enough precision. Is there anyway to change the format in LabView, or does this need to be done on the instrument itself?

The data shows up in LabView as a string, but I'd like to get it into an array so that I could manipulate it. Is there a way to convert a string into an array or numbers?

Thanks.
Kasey
0 Kudos
Message 1 of 2
(3,331 Views)
There's a couple of reasons that you don't see the precision you need. It may be that the instrument doesn't return it. You need to look at the actual string that the instrument is returning. If it's something like 1.6e-2, then it's an issue with the instrument. If it returns 1.62374e-2 and what you see in a numeric indicator on the front panel, then all you may have to do is change the format & precision of the indicator. The other possiblity is that the conversion from string to numeric is set for a specific precision. You would need to find the function that does the conversion from string to numeric and see what is specified. The other place to loose precision is in the writing to file. What function are you using to write the data? A function like Write to Spreadsheet File has by default, a format specifier of %.3f which sets the text to only have three decimal digits.

Converting a string to an array is possible. If the string has values that are comma, tab, space delimited, then Spreadsheet String to Array is the easiest thing to use.

If you have further questions, it would help if you provided more details such as the instrument make and model, the actual strings being returned, and posting your code.
0 Kudos
Message 2 of 2
(3,328 Views)