Convert 1D string Array to Numeric Array
Author Message
Convert 1D string Array to Numeric Array

I read a number of strings from GPIB card.They were divided by
comma.What i do is saving them in numeric form and plot in waveform

Sun, 19 Dec 2004 11:54:13 GMT
Convert 1D string Array to Numeric Array

Quote:

> I read a number of strings from GPIB card.They were divided by
> comma.What i do is saving them in numeric form and plot in waveform
> Control.Can somebody give some advice?

Hi Mark,
if I've understood you correctly, you have say 5 elements in 1D
arrays of strings. Each element is related to a particular plot, so
each element is a comma deliminated string. You want to split this
into 5 1D numeric arrays, i.e. interpret each array element into a 1D
array, and pass this as an individual plot to a Waveform graph.

If this is so, try the following :
Place a for loop on the diagram. Wire the 1D array of strings to the
edge of the loop. Inside the loop place the Spreadsheet sting to
array.vi (found under the string functions). To this, wire the 1D
array, with indexing ON to the spreadsheet string input. To the format
string input, wire a string constant of "%f" (without the quotes). To
the deliminator, wire a string constant of "," (without the quotes),
and to the Array type input, wire a 1D array of double precision
numerics (easiest way is to use the wiring tool, right click on the
input and create constant. Then select the constant, and remove a
dimension.
Wire the output of the Spreadsheet string to array.vi to the for loop
edge, and (with indexing ON on this point too) wire this output
directly to the waveform graph.
If that's a bit confusing, e-mail me direct, and I have the .vi I've
proved it on.

Hope that helps

Sash.

Sat, 25 Dec 2004 17:13:52 GMT

 Page 1 of 1 [ 2 post ]

Relevant Pages