LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph to Excel spreadsheet

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.
0 Kudos
Message 1 of 15
(10,410 Views)
You already tried this solution??? It solves your problem?



Greetings, Christian


Message Edited by cschneider on 08-12-2008 04:28 PM

THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 2 of 15
(10,404 Views)
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.
 
Mike
Message 3 of 15
(10,398 Views)
Thanks Christian, I tried exactly what you suggested, but it came  up with an error at the array to write spreadsheet vi. 'you have connected two arrays of diferent dimensions'  'the dimension of  is 3' and 'the dimension of 2D data is 2'. BTW my XY graph is pink not brown like yours?

Thanks.
0 Kudos
Message 4 of 15
(10,382 Views)

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.

For learning these LabVIEW basics, you have available the tutorials at http://www.ni.com/academic/lv_training/how_learn_lv.htm.



Message Edited by Dennis Knutson on 08-12-2008 08:05 AM
Message 5 of 15
(10,374 Views)

Hi lefterisa,

see the attached picture please. That´s what i understand what you want.

Hope it helps.
Mike

0 Kudos
Message 6 of 15
(10,370 Views)
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?
0 Kudos
Message 7 of 15
(10,367 Views)
Thanks evrybody for all your help.
0 Kudos
Message 8 of 15
(10,365 Views)
Mike, I'm trying what you sent but am not shure which proerty nodes are labelled as 'Wert' and 'XAchse.Minimum'

Thanks
0 Kudos
Message 9 of 15
(10,355 Views)
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.
0 Kudos
Message 10 of 15
(10,346 Views)