LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert data into array from sensor

Solved!
Go to solution

My first post! Firstly I would like to say that the people behind the LIFA Interface have done a great job!

I'm new to Labview, but have worked on Arduino.

I'm using my Arduino to sense the current & volatge of a DC Shunt Motor using Hall Effect Sensors. I'm gettng this data in LabVIEW using LIFA, no problem till now. What I want to achieve is to plot the Current vs Voltage over a period of time (for the duration the motor is on). If I use the Express XY plot option, I get the plot but that is only for a small period, I need it over a longer period (around 30 mins). I'm reading the sensor twice every second, therfore around 3600 values per sensor, and there are 4 sensors.

Now I want to store this sensor data into an array and whenever the user presses a button, it takes the values from the array and plots it for the whole duration. I can't seem to figure out how to do this part. Would be glad if anyone could help.

0 Kudos
Message 1 of 5
(6,085 Views)

To store, you just initialize the 2D array with proper dimentsions as required, and index your data in it or further you can store it in your pc (excel file) by using function "write to spreadsheet.vi" under File I/O.

Whenever you want to call back the stored data (in excel), you can use "read from spreadsheet.vi".

Hope this helps.

Message 2 of 5
(4,420 Views)

Thanks a lot gaurav! I'm trying out your method, will post back with results.

0 Kudos
Message 3 of 5
(4,420 Views)

I tried the above method, writing the variables to an external file, I stored the variable in different files (as I have to use them in multiple places). Now I'm not able to plot them.

I'm using the "read from spreadsheet" function and Express XY plot. I'm able to get the plot for only one variable, lets call it Y1 vs X, whereas I need multiple plots with the same X axis, something like Y1 vs X, Y2 vs X, Y3 vs X, all in the same plot.

All these variables are stored in different files, X in 1 file, Y1 in one file and so on.

I've attached a picture of my VI which reads from the file. Please help me in plotting all the variables.

Screen Shot 2012-04-24 at 3.33.20 PM.png

0 Kudos
Message 4 of 5
(4,420 Views)
Solution
Accepted by Bachna

You need to modify your program as per the attached images. Considering you are plotting the first column of the excel files. Make two such files, fill in the data and sore them as .csv format in excel (Test1.csv and Test2.csv in my case).

Then do in following way. You will be able to plot both files data. As you can see File1 (plotted white) and File2 (plotted red).

Multiplotp.pngMultiplotd.png

Hope this helps. Good Luck !!

0 Kudos
Message 5 of 5
(4,420 Views)