12-21-2019 10:05 AM
I have an excel file(100000 rows and 2 columns) of data from an oscilloscope. I want to plot a signal from the data in this file. Most of the videos on the internet describe how to save data to excel files. Is there anyone who can help me? I attached excel file if you need.
12-21-2019 10:14 AM - edited 12-21-2019 10:14 AM
So since you have a real Excel file (rather than a .csv or similar file), your best bet is likely to try using the Report Generation Toolkit to open and read the file.
There's an example program here: Reading Excel Data Programmatically Using the Report Generation Toolkit
If you can instead use a CSV file, you'd have an easier time with the use of simple VIs/nodes like Read Delimited Spreadsheet VI or Read Text File and Spreadsheet String to Array.
12-21-2019 11:49 AM
I read the first solution. The Report Generation Toolkit example you gave had subvi's and it seemed very complicated to me. I converted my .xlsx file to a .csv file. I couldn't make any connection to the solutions you proposed for this. I don't know how to use these tools. Related videos are insufficient. I've read and tried all of the links you've sent, but it doesn't seem understandable to me.
Can you show me a simple example with these tools and my file for plotting a signal wave in graph indicator?
Thanks for your helps.
12-21-2019 04:15 PM - edited 12-21-2019 04:20 PM
You failed to post your VI, so we have no idea what you tried, and can't suggest how you can fix it. I can say, however, that your CSV "copy" looks nothing like your Excel Data File, so it would be useless to suggest how you could read (the data are garbage!). The other thing that looking at your code would tell us is which Version of LabVIEW (or LabVIEW NXG) you were using ...
The "trick" to using the RGT to read Excel is to realize that when you Create Report and connect an existing Excel File to the "Template" input, it becomes available for reading. Fortunately for you, the entire XLSX file is two columns of numeric data (no headers).
You only need three Functions to accomplish your goal -- Create Report (with the XLSX file wired into the Template Input), Excel Get Data (with a 2D Array of Dbl wired in to the Data Type input, and an Indicator wired into the Data output, and Dispose Report. When you run it, Excel will open, read the XLSX, close, and all of your data will be in the array "Data".
Bob Schor
P.S. -- if this works for you as well as it worked for me, consider clicking the Solution button, which I think is on the lower right of this Reply.
P.P.S. -- I realized I only answered the "How do I get the data from Excel into LabVIEW". I'm assuming that once you have the 2D array (of X and Y), you know how to Chart or Graph it.
12-27-2019 03:01 PM - edited 12-27-2019 03:04 PM
Hi, first of all, data are inconsistent (columns have different lenghts) so the result can't be good as expected...
If you want to better understand labview connectivity functions, please consider to use ActiveX technology instead of NI MS office report generator.
attached you can find an example to read data from a rectangular range of an excel sheet displaying data on a graph.
Enjoy!
12-28-2019 03:42 PM
@Max71 makes a good point -- I didn't really look at your attached .xlsx file (thank you for attaching it!). The first Column contains the numbers 1 .. 805 (and stops at Row 805), whereas the second Column seems to contain "real data" and stops at Row 100000. I'm not sure how you generated this strange file format, but apparently after you'd written less than 1% of the file, you realized you didn't ne