03-06-2021 05:25 AM
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.
03-06-2021 06:03 AM
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)...
03-06-2021 06:39 PM
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.
03-07-2021 03:25 AM
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?
03-07-2021 04:00 AM
Hi,
And you could also look here for solutions.
It is also possible to read an Excel file directly.
Kees
03-07-2021 04:56 AM
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.
03-07-2021 09:09 AM
Two questions:
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
03-08-2021 04:28 AM - edited 03-08-2021 04:30 AM
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!
03-08-2021 03:16 PM
Hi Bob,
I believe I do.
Thank you very much.
03-08-2021 03:34 PM
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