# Re: string to array urgent~! - labview

This is a discussion on Re: string to array urgent~! - labview ; Just before you wire these to the graph, you need to convert the string to numeric, most likely &quot;double&quot;, because of fractions. See attached the image. &lt;img src=&quot;http://forums.ni.com/attachments/ni/170/270149/1/convertToNumeric.PNG&quot;&gt; Message Edited by JoeLabView on 09-06-2007 03:28 PM convertToNumeric.PNG: http://forums.ni.com/attachments/ni/...tToNumeric.PNG...

1. ## Re: string to array urgent~!

Just before you wire these to the graph, you need to convert the string to numeric, most likely "double", because of fractions.
See attached the image.
<img src="http://forums.ni.com/attachments/ni/170/270149/1/convertToNumeric.PNG"> Message Edited by JoeLabView on 09-06-2007 03:28 PM

convertToNumeric.PNG:
http://forums.ni.com/attachments/ni/...tToNumeric.PNG

2. ## Re: string to array urgent~!

I would do it even simpler:
<img src="http://forums.ni.com/attachments/ni/170/270150/1/XYSimpler.png">
Or even simpler than that!
<img src="http://forums.ni.com/attachments/ni/170/270150/2/XYSimpler1.png"> Message Edited by altenbach on 09-06-2007 12:39 PM

XYSimpler.png:
http://forums.ni.com/attachments/ni/.../XYSimpler.png

XYSimpler1.png:
http://forums.ni.com/attachments/ni/...XYSimpler1.png

3. ## Re: string to array urgent~!

LOL! Altenbach!
You're the Wizard of Simplicity!!&nbsp;

4. ## Re: string to array urgent~!

If you just want to plot one of the values, look at Joe's example. Take the array you want and wire it to a graph.
There are some on-line (and free) resources available for learning the basics of LabVIEW. Check the links at <a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank">http://www.ni.com/academic/lv_training/how_learn_lv.htm</a>.

5. ## Re: string to array urgent~!

Delete everything you don't see in my image(e.g. the blue xy graph express VI) and keep only the terminal labeled "VI graph".
This terminal ALWAYS has only a single input. Just wire the output of my loop to it. Voila!

6. ## Re: string to array urgent~!

elo85 wrote:how do I save the graph?

What do you mean? e.g.

- Save the xy data in a regular&nbsp;file to be read and graphed again later?

- Save a picture of the graph?

- Make the current graph data the deafult?

7. ## Re: string to array urgent~!

Here's an example of saving the array data to a text file and the graph image (same as your front panel) to a jpeg file:
<img src="http://forums.ni.com/attachments/ni/170/270261/1/saveGraph.PNG">
&nbsp;
In this example, the same name (leading name) is given to both the text and jpeg files.&nbsp; The example can be further simplified by simply wiring a file path control to the write file vi's..
The waveform graph property node is obtained by right clicking on the waveform graph indicator (on block diagram) and selecting create property node..Message Edited by JoeLabView on 09-07-2007 07:34 AM

saveGraph.PNG:
http://forums.ni.com/attachments/ni/.../saveGraph.PNG

8. ## Re: string to array urgent~!

You can save both the data and the graph.
Depending on the LV version that you are using, you can use the write to file functions (ex: text, spreadsheet, measurement) by wiring the data to the write to file vi (located in the File I/O of the Functions Palette). &nbsp;The graph can be saved as an image file, for example using write to jpeg file.
I'll post an image...&nbsp;

9. ## Re: string to array urgent~!

JoeLabView wrote:

The waveform graph property node is obtained by right clicking on the waveform graph indicator (on block diagram) and selecting create property node..

My mistake..&nbsp; I'm reducing my daily dose of cafeine, and it's affecting me
You need to use an invoke node.&nbsp; I'll prepare a code template in LV7.0 for you..

10. ## Re: string to array urgent~!

See the attached example.&nbsp; I created a small template in LV7.0, but saved as a vi.
You'll need to provide data (numeric array) which is wired to both the graph and to the "array to spreadsheet string" in order to convert it to string before saving it to a text file.&nbsp; The example won't run as it is..&nbsp; Also, you'll need to fill in the paths for both the graph image (saved as jpeg in the example) and the text file.
Sorry, I had to do this quickly..&nbsp; It should get you going..&nbsp;
&nbsp;

template-saveGraph.vi:
http://forums.ni.com/attachments/ni/...e-saveGraph.vi