Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert output data (string?) from GPIB-read to an 1D array?

Hello all,

I am reading a displayed waveform from my Tektronix Oscilloscope (TDS3032) via the GPIB Read VI. The format of the waveform data is: positive integer data-point representation with the most significant byte transferred first (2 bytes per data point).

The output data of GPIB-Read looks like a string(?) where the integer numbers and a sign like the euro-currency sign are seperated by spaces e.g. #5200004C3 4 4 4 4 3C3C3........ (C represents the euro-currency sign).

How can I convert this waveform data into a 1D/2D array of real double floatingpoint numbers (DBL) so I can handle the waveform data for data-analysis?

It would be very nice if someone know the solution for this.

t
hanks
0 Kudos
Message 1 of 2
(3,452 Views)
Hi,

First of all, I'm assuming you are using LabVIEW.

The first you need to do is parse the string returned by the instrument. In this case you need to search for the known symbols in the string (like the euro sign) and chop the string to get the numeric strings. Here are some examples on parsing from www.ni.com:

Keyword Search: parsing

Once you parse the numeric strings you can use the "String/number conversion VIs" in the String pallette.

Hope this helps.

DiegoF.

Message Edited by Molly K on 02-18-2005 11:01 PM

0 Kudos
Message 2 of 2
(3,453 Views)