LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

recording data periodically by pressing button to store current values

Hi

for a wind tunnel experiment i will be recording strain gauge outputs (amongts other things) which fluctuate a fair amount. firstly i need to calculate a mean for them over some reasonable time period (perhaps 5s) and then by clicking button i want the selected data (i.e. certain pieces of data that i can choose) to be stored in an external file at that point in time. the experiment will then continue and at the next setting, once everything is set, do the same thing and record the data at that time. how can this be achieved in labview (im using 8.5 if that makes any difference...)?? Also is there a way to get a table on the front panel which will populate as i go along by clicking a button for when i want to record the data?

 

just to clarify, this is what i need to be done:

 

Setting 1: various parameters will be inputted manually such as pressure, temp etc. and some calculations made. once the speed in the tunnel has settled i want to store the strain gauge outputs and above data (pressure etc.) in a table. the strain gauge output will be averaged. ideally i want the data to be shown in the front panel (or an external file will do)

 

Setting 2: pressure2, temp2 etc. the speed will now be higher and thus the strains different. once the speed settles, once again click the buttong and store the current data to the same external file or a table within the front panel.

 

once everything is finished, export the table and its content in the front panel to excel or equivalent.

 

sorry for the long msg and thanks in advance.

0 Kudos
Message 1 of 7
(5,246 Views)

Lots of different problems here...  let's take them one at a time.

 

Strain Gauge Averaging -- do you want a new average every 5 seconds or do you want a running average of the last five seconds worth of data?  Different approaches for both. 

Speed Settling -- Do you want to detect that through the program or have the user do it?

 

I used to work in a wind tunnel.  People would ask how fast it was going.  I'd say, "Roughly 0 feet per second.  It just kind of sits there.  Now the air, that moves."

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 7
(5,243 Views)

the speed settling will be decided by the user (as he/she will have use a manometer which will remain constant - more or less once the speed has settled). the strain gauge values should be the average of some time, say t once the speed has settled so even 2 or 3s should work. so i want the average over the last time 't'.

 

what i'm more stuck on is how to get the values at these speeds and sticking them in a table.

 

also another problem has arisen, the user inputs the atomospheric pressure, temperature etc. and these are used to caclulate the density. however, as it stands when i change the inputs (ie. temp and pressure) while the vi is running, the density doesn't change. i hvae to stop and restart. how can i overcome this by making it update automatically?

 

cheers 

0 Kudos
Message 3 of 7
(5,234 Views)

Without seeing your code, everyone has to guess and I'm guessing you don't have the controls inside your loop.

 

As far as writing to a table and saving, a table is nothing more than a 2D string array. You can convert values to strings and use the Build Array to write to the table (probably with a shift register). You also have a lot of options to save to a file. There are a lot of examples that show you this.

 

If you need more specific answers, it would be best if you attached the code you have written.

Message 4 of 7
(5,187 Views)

yes, i didn't have the things in a loop which is why the calculations weren't updating. i managed to sort that out...

 

i've attached the code. as it stands its fine and works. but as i'm very new to labview not sure how to do the table thing is mentioned above. i'll give the array thing a try. but need some way to link it to a button so that it captures the data at that point.

 

also is there a way to calculate the mean of a signal for the last, say 3secs, before the button is clicked?

 

thanks.

0 Kudos
Message 5 of 7
(5,182 Views)

Hi,

 

Sorry there's been a delay getting back to you.  Here is a bit of example code that shoudd illustrate a way of averaging data for the previous time period at the press of a button.  The code generates 10 samples every quarter of a second.  There is a shift register and an array used to hold the data for the previous second.  The Delete from Array function removes the oldest 10 samples and then we add in the latest data set using the Build Array function (note, this needs to be set to Concatonate Inputs - right click the function and ensure this is ticked in the menu).   When the Calculate Average button is pressed the True case exectues and sums the array elements, then divides by the number of elements, and displays the average for the last second of data.

 

I hope this helps you, but please post back if you have any further questions.

Sheela Sujeeun

Applications Engineer
National Instruments UK
Message 6 of 7
(5,120 Views)

hope this helps.

 

here it is saving to a file:

 

 

 

*Don't forget Kudo's for good answers*

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Download All
Message 7 of 7
(5,108 Views)