Discussion:
XY graph to Excel spreadsheet
(too old to reply)
lefterisa
2008-08-12 13:40:16 UTC
Permalink
Hello, I'm wondering if anybody has a simple solution for taking the data out of an XY graph and sending it to an Excel spreadsheet without using seperate arrays. My VI scans, reads and plots light intensity vs. relative position, and the user can use the Tools on the XY graph to fill the ROI to the plot. With a chart I  could  take the History Data  property node  and feed it into a  'write to spreadsheet file.vi' in a conditional loop, but with an XY Graph there is no History Data property node, so if I take a local variable of the XY graph and feed it into a 'write to spreadsheet file.vi' I get the following error, that I have connected two terminals of different types, source- 1-D array of cluster of 2 elements , sink- 1-D array of double[ 64 bit real]. The reason I want to take the data from the graph is that I want to avoid dumping all the data from the scan to the spreadsheet and only send the user defined ROI. Thanks in advance.
cschneider
2008-08-12 13:40:18 UTC
Permalink
You already tried this solution??? It solves your problem?<img src="Loading Image..."> Greetings, ChristianMessage Edited by cschneider on 08-12-2008 04:28 PM


spreadsheet.png:
http://forums.ni.com/attachments/ni/170/348588/1/spreadsheet.png
MikeS81
2008-08-12 13:40:18 UTC
Permalink
Hi lefterisa,
read the data from your xy graph, you can also use a property node for it. Read also the visible x and y values, so that you are able to cut the data to what you need. Use a unbundle block. With a build array function you can create a 2d array of your data, which you can connect to the write to spreadsheet file vi.
&nbsp;
Mike
lefterisa
2008-08-12 14:10:07 UTC
Permalink
Thanks Christian, I tried exactly what you suggested, but it came&nbsp; up with an error at the array to write spreadsheet vi. 'you have connected two arrays of diferent dimensions'&nbsp; 'the dimension of&nbsp; is 3' and 'the dimension of 2D data is 2'. BTW my XY graph is pink not brown like yours? Thanks.
Dennis Knutson
2008-08-12 14:10:08 UTC
Permalink
Instead of us guessing how you created the XY Graph, you should post your code. My guess is that it is a simple bundle of an x array and a y array. You just have to do the opposite in order to create the 2D array you want to write.
<img src="Loading Image...">
For learning these LabVIEW basics, you have available the tutorials 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>. Message Edited by Dennis Knutson on 08-12-2008 08:05 AM


Write XY Graph.PNG:
http://forums.ni.com/attachments/ni/170/348598/1/Write XY Graph.PNG
lefterisa
2008-08-12 14:10:10 UTC
Permalink
Thanks evrybody for all your help.


ID3.vi:
http://forums.ni.com/attachments/ni/170/348604/1/ID3.vi
lefterisa
2008-08-12 14:40:20 UTC
Permalink
Mike, I'm trying what you sent but am not shure which proerty nodes are labelled as 'Wert' and 'XAchse.Minimum' Thanks
MikeS81
2008-08-12 14:10:09 UTC
Permalink
Hi lefterisa,
see the attached picture please. That´s what i understand what you want.
Hope it helps.Mike


xygraph_example.PNG:
Loading Image...
smercurio_fc
2008-08-12 14:10:10 UTC
Permalink
The first thing you need to understand is that Write To Spreadsheet File does not create an Excel spreadsheet. It creates a text file. So all that you will get is columns of numbers. Is this what you actually want, or do you actually want to write to an Excel spreadsheet? If it's the latter then you need to use ActiveX, which is possible, but more complicated. This means a completely different solution. Also,are you trying to just get the data over, or are you trying to replicate the graph in Excel?
lefterisa
2008-08-12 14:40:23 UTC
Permalink
Only one graph at a time, and saving one graph at a time that students can go back to analyze.
smercurio_fc
2008-08-12 14:40:24 UTC
Permalink
Then insert the Index Array function and delete the for-loop.
smercurio_fc
2008-08-12 14:40:22 UTC
Permalink
That's because Mike uses the German version of LabVIEW and posts his screenshots in that. Most of the folks on this forum speak English, and this makes it quite challenging to try and read property nodes as you've discovered. You have an array of clusters. This is due to you using the fandangled BuildXY Graph Express VI. I hate express VIs. Regardless, are you plotting multiple graphs? If so, then you first need to decide how to save the data. Do you want a separate file for each graph, or additional columns? If you're plotting just one graph then simply insert an Index Array function between your XY Graph local variable and the for-loop.
lefterisa
2008-08-12 15:10:11 UTC
Permalink
It doesn't seem to like that?
smercurio_fc
2008-08-12 15:10:12 UTC
Permalink
<img src="Loading Image..."> Message Edited by smercurio_fc on 08-12-2008 10:01 AM


xy graph.png:
http://forums.ni.com/attachments/ni/170/348638/1/xy graph.png
lefterisa
2008-08-12 16:10:09 UTC
Permalink
Great! Thanks.

Continue reading on narkive:
Loading...