LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Working in LabView using Excel data

Hi Everyone,

 

I am currently doing a project and I have all my data .. about 10 columns (with different variables such as Time, Speed, Distance, Acceleration) and about 4500 rows of different data that all tie into each other in Excel per unit time.

 

With this data, I want to be able to work with each variable, I want to be able to place them using filters (Savitzky-Golay, or Median, or Mean filtering) use mathscript/ nodes to have them feed into equations with each other to create a new variable and be able to graph them.

 

I have searched throughout youtube, as I am a visual learner but I am mainly getting sources of placing data in LabView into Excel, not the other way around. I am sure that this is all present but as a student during the COVID era, a complete newbie into programming of any kind, and having other modules to bury me it has been slightly overwhelming after scouring through the internet for help after a couple of days.

 

Thank you for taking the time to read/help.

0 Kudos
Message 1 of 12
(1,955 Views)

Hi ljm,

 


@LJM1017 wrote:

I am currently doing a project and I have all my data .. about 10 columns (with different variables such as Time, Speed, Distance, Acceleration) and about 4500 rows of different data that all tie into each other in Excel per unit time.


Save the Excel worksheet to a CSV file. Then read this CSV file using spreadsheet file functions (aka delimited text file)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(1,941 Views)

To be more specific,

 

How do I import excel data into Labview ... into an array or table?

 

Then be able to use the data in each column of that array to mathematically create a new value then graph it.

 

E.G.

Let's say in Excel I have Column A - "time", Column B -  Variable "X", Column C - Variable "Y". (5000 rows)

 

Placed into a table or an array or something.

 

Individually, use the Golay Filter on X,

 

Then using math script or nodes do the equation Z = 3X - 2Y, having Z values into a column

 

Use a median/mean filter on Z values, then graph Z over time.

 

Apologies for the (and my) confusion.

 

 

 

0 Kudos
Message 3 of 12
(1,883 Views)

Hi ljm,

 


@LJM1017 wrote:

How do I import excel data into Labview ... into an array or table?


Did you read and understand my previous message?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(1,866 Views)

Hi,

 

And you could also look here for solutions.

It is also possible to read an Excel file directly.

 

Kees

 

0 Kudos
Message 5 of 12
(1,863 Views)

Hi,

 

Yes, I did, thank you.

 

I was able to attempt but not get very far. I have been looking for videos but it does not seem like many people are doing the same as I or maybe my finding skills are lackluster.

 

I attached my test CSV of "Time", "X", "Y" and here is what I was able to do so far.

Download All
0 Kudos
Message 6 of 12
(1,855 Views)

Two questions:

  1. Is the file you want to read and process a true Excel File, meaning it has the extension .xls or .xlsx?
  2. Does your LabVIEW installation have the Report Generation Toolkit installed?

If the answer to both of these questions is "Yes", then it definitely is possible to treat the Excel file (even one that contains multiple WorkSheets) as a "data" file to be read.  You could even "update" the file by adding additional rows and columns, but this gets to be a little messy.

 

If "Yes" is the answer, and you attach a trimmed down example of an Excel file and tell me what you want to do with it, I'll see if I can get you started ...

 

Bob Schor

0 Kudos
Message 7 of 12
(1,843 Views)

Hi ljm,

 

why do you try to read numeric data as an array of strings???

 

 


@LJM1017 wrote:I have been looking for videos but it does not seem like many people are doing the same as I or maybe my finding skills are lackluster.

Don't "look for videos", but take those "Training resources" as offered in the header of the LabVIEW board to learn LabVIEW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(1,820 Views)

Hi Bob,

 

I believe I do.

 

Thank you very much.

0 Kudos
Message 9 of 12
(1,800 Views)

Hi GerdW and everyone,

 

Thank you all for all your help and I am very grateful, I was able to move forward a little more than I expected.

Here is what I have so far in my test (attached below) Thank you again.

 

I was able to create Z values using Z= 5X-2Y

 

Now for making mathematical operations using arrays is quite tricky.

I was planning on doing Z= (ln(X4-X0)*ln(Y4-Y0))/(t4-t0). Where the Z values would continue =>

Z= (ln(X5-X1)*ln(Y5-Y1))/(t5-t1)...Z= (ln(Xn-1-Xn-5)*ln(Y5n-1-Yn-5))/(tn-1-tn-5)

 

Where t is time, and where X4 and so on mark the 5th data point of the specific 1D array. I tried using mathscript but there seems to be an error. I would say that this would be better without it and use mathematical nodes instead? I am unsure how to pick out these points from the array. 

 

LJM

 

Download All
0 Kudos
Message 10 of 12
(1,798 Views)