From Friday, January 17th 11 PM CDT (January 18th 5 AM UTC) through Saturday, January 18th 11:30 AM CDT (January 18th 5:30 PM UTC), 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: 

create an xy diagram in excel from labview

Solved!
Go to solution

Hi! I would like to create an xy diagram in an excel file from labview. I have excel files filled with measurement results and I want to plot them inside the excel file. The ideal VI would look like this: inputs: excel file path and name , which two column is needed for the diagram (x and y), which row and column the diagram should be generated. output: in the background the diagram is generated. I've found similar topics but all of the solutions were about creating and inserting a picture of a diagram instead of a live plot. Is it possible? Thanks!

0 Kudos
Message 1 of 15
(311 Views)

Help > Find Examples... Toolkits and Modules > Report Gen for MS Office > Excel Reports > Excel Report - XY Graph Generation.vi

 

Since your data is already in an Excel file you need to use Read Delimited Spreadsheet.vi in the File I/O palette to pull out the raw data from that.  You may need to use some array functions to get just the number columns you want to plot.  It depends on how your raw data Excel file is formatted but it should be easy with basic array subset, etc.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 15
(300 Views)

You can't write data to excel while you have the file open. 

A better option if you just want to see what's going on would be to have a chart on the front panel of your VI, and then also have it create one in the excel file so that you can snapshot when you open it. But you can't be writing to an excel file whilst you have it open to view it. 

0 Kudos
Message 3 of 15
(297 Views)

I do not have the file opened. I just have an excel file and want to create a diagram from labview. This process will be the first time I open it

0 Kudos
Message 4 of 15
(285 Views)

This method also creates a picture, not a live diagram

0 Kudos
Message 5 of 15
(284 Views)

Can you try and be clear about what you mean by a live diagram? Do you want the diagram to be updating whilst you are still collecting data? 

0 Kudos
Message 6 of 15
(282 Views)

I suggest using the XLR8 add-on, as it can directly open and operate on .XLSX files.

 

And it does not require Excel or DirectX to be installed on the target machine

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 15
(253 Views)

Help us to help you.  You can start by attaching a VI that shows some of your effort to accomplish your task.  Among other things, it would tell us:

  • What Version of LabVIEW you are using.
  • What you mean by "an Excel file".  Is this what LabVIEW calls a "Delimited Spreadsheet", a text file in "Comma-separated Values" (.csv), or a real Excel Workbook (.xlsx)?
  • It would tell us if you are using NI's Report Generation Toolkit.  This would let you:
    • read an Excel .xlsx Workbook, look at a specified WorkSheet, and extract 2D data from specified Row/Column coordinates, which you can plot in the calling LabVIEW VI as a Graph.
    • plot the above-mentioned 2D data as a Graph within an Excel Worksheet (of course, once you have 2D data from Excel, you can also plot it in LabVIEW as a Graph or a Chart, whichever is more appropriate).

A decade ago, I submitted a "Revised Generate Excel Report Example" (search for a title close to this name on the Search bar of this Forum).  It should run, even though some of the RGT Function names have changed ("New Report" is now called "Create Report").  This example does not address reading Excel, but it does show you how to locate data and plot it on an Excel Worksheet. 

 

     For more help, attach your VI (best!) or provide answers to the points above, and provide more details on "what you know" and "what you want to do".

 

Bob Schor

Message 8 of 15
(237 Views)

I have the values in columns and I want to create a graph like this progmatically from labview

0 Kudos
Message 9 of 15
(224 Views)

what VI should I attach? I asked if this even possible or not.

Why the Labview version is matter?  I would use any version if this possible or not.

Yes an Excel file is a "real Excel Workbook"

I attach a picture what I would like to create, creating a graph in Labview with values from a xlsx file is not my goal.

0 Kudos
Message 10 of 15
(223 Views)