From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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 Control.Can somebody give some advice?
0 Kudos
Message 1 of 8
(14,776 Views)
What type of data you get from GPIB: 1d string array or 1 string, that consist many numbers. From your question i understand this is last case.
Look attached example.
0 Kudos
Message 2 of 8
(14,776 Views)
I am attaching a vi called Extract Numbers.vi. You input a string of numbers, separated by commas, and it outputs an array of the numbers. You may want to take a look at this. You can find this on National Instruments' website in their example program database. This should be what you're looking for.
J.R. Allen
0 Kudos
Message 3 of 8
(14,776 Views)
Mark_Wang wrote in message news:<5065000000080000009C4F0000-1023576873000@exchange.ni.com>...
> 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 Spre
adsheet 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.
0 Kudos
Message 4 of 8
(14,776 Views)
This thread was started so long ago I hope I get a reply.
 
So first off Sash, those were excellent directions. I however get stuck at the last step, I don't know which graph VI to send the output to in order to get a XY graph (see attachment for how far I got...).
I am using LabView 7. 1
All I have is 2 inputs:
X axis will be channel numbers (coming from my mux module)--I get this in string format
Y axis will be a bunch of voltage readings (from my DMM)
 
Please let me know what the last step is so I can complete my waveform. Thanks!!!
 
0 Kudos
Message 5 of 8
(14,341 Views)

Show below is the basics for what you would do. Since all that you have provided is a image of a small piece of code, I have no idea how the data is your 2D array is arranged. The example below gets column 0 for the x array and column 1 for the y array. You may need to switch these around or to use the rows instead.



Message Edited by Dennis Knutson on 02-12-2008 07:40 AM
0 Kudos
Message 6 of 8
(14,319 Views)
Your VI is now obsolete and cannot be used...
0 Kudos
Message 7 of 8
(11,588 Views)

@CU Boulder wrote:
Your VI is now obsolete and cannot be used...

Who is your comment directed towards?  And why in a 9-year old thread that hasn't been replied to in the last 3-1/2 years?

Message 8 of 8
(11,581 Views)