LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save LV graph of many plots to excel

Solved!
Go to solution

I have a LV graph with ten plots on it.

 

Need to just save it to Excel.

 

Many attempts and problems.

 

Is this even possible without sending all data to Excel table, then linking to graph in same workbook?

0 Kudos
Message 1 of 13
(3,836 Views)
Solution
Accepted by topic author markfranklin

Do you just want to save an image of the graph to your Excel file?  Or do you want to save your data arrays which form the graph, as well?

 

If all you need is an image of your graph, use the "Export Image" method.  Right-click on the terminal for your graph.  Select "Create..."  Choose "Invoke node".  Choose "Export Image".  The method will appear on your block diagram.  Specify the file type (i.e. BMP), where you'd like to export the image (probably easiest to export to the clipboard), and then use the appropriate Excel method to paste the image from the clipboard into the Excel file.

 

If you need the data as well, then you'll have to write the data directly to the Excel file.

 

Hope this is kind of helpful.

d

Message 2 of 13
(3,823 Views)

You could also select "Export simplified Image..." from the context menu of the graph on the front panel.

 

If you want to store the data, try out the Express VI "write to measurement file" on the express VIs subpalette "Output". Write as text file. The file should open without problems in Excell.

Message 3 of 13
(3,808 Views)
True...I assumed he wanted to do everything programmatically, so I posted a programmatic solution.  That may not have been a valid assumption.
Message 4 of 13
(3,796 Views)
Oh, DianeS, your solution has been accepted! Your assumption appears to be valid. As usual you never know all details behind the question. So you can come up with all reasonable solutions which are hopefully helpful and not even more confusing.
0 Kudos
Message 5 of 13
(3,764 Views)

The text file is not opening in excel...its tab delimited..even then... What to do?? Any suggestion will be very helpful...its needed in my project.. thanx

0 Kudos
Message 6 of 13
(3,212 Views)

Hi Preetisar,

 

I am not sure which LabVIEW function you are using to create the .txt file, but in order to help you further, I will assume you are using the "Write to Spreadsheet Function" and writing an array of numbers to the .txt file.

 

I created a simple VI that simply reads in a 2D array of numbers and writes it to a .txt file.

I then opened Excel and opened the .txt file from there.

It came up with a Text Import Wizard with Delimited chosen as the file type and your data showing up in the preview. Click Next.

Step 2 will let you set your delimiters. I selected the "Tab" box and clicked next.

The final step is to pick the column data format. I selected "General" and clicked Finish.

After that, all my data was imported into Excel. From there, you can save the Excel file as a new name with a file extention of .xls if you want.

 

I hope this helps!

 

Kim W.

Applications Engineer
National Instruments
0 Kudos
Message 7 of 13
(3,203 Views)

Hey Kim...

that was really good.... 🙂 thanx....

I had used write to measurement file.. and that worked too

But the problem with both(write to measurement file and write to spreadsheet) is that I am not able to get the x-axis values(time coodinates). How can i get the x values and the corresponding y values together in the same table??

Thanx...

Preeti

0 Kudos
Message 8 of 13
(3,195 Views)

The problem is not with either Write to Measurement File or Write to Spreadsheet File but probably on how you are using them. If you do not include them in the data you pass to the functions, they will not be there to read. You really need to show how you are using either write function. Once the write is correct, you should not have any problem doing a read.

0 Kudos
Message 9 of 13
(3,187 Views)

->But the problem with both(write to measurement file and write to spreadsheet) is that I am not able to get the x-axis values(time coodinates).

->How can i get the x values and the corresponding y values together in the same table??

 

Probably because the Waveform Graph doesn't have an array of x values corresponding to the y yalues, just X0 and dX.  The attached shows a simple way of generating the x values from a waveform graph,and writing them and the associated y values to a spreadsheet file.  If your waveform graph is a 2d array rather than a cluster, X0 and dX default to zero and one.

 

 

 

Graph2Array.png

0 Kudos
Message 10 of 13
(3,174 Views)