LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I start and stop a measurement automatically?

Hi,

 

I have a a couple of simple programs to capture signals from two piezo sensors. One is an accelerometer, the other is a force transducer. I would like to be able to control the start of the capture by using the output of the sensor and set a timer to stop. I have almost no experience with LabView software so I have not been able to figure this out on my own. I would be grateful if someone can help me do this.

 

Thanks,

Tim

 

 

force.PNG

accel.PNG

 

Download All
0 Kudos
Message 1 of 5
(3,500 Views)

The first thing you have to do is to take one of the several free tutorials available from NI. Then you can start by looking at such things as a while loop and the elapsed time function. Your current VIs are set to run once and then stop. Do NOT use the run continuous button. I'm not sure what you mean by start automatically. You can set the VI to run when opened and the acquisition will immediately start. Perhaps you want acquisition to start when you click a button? Perhaps you want acquisition to immediately start but processing/saving to start when some condition is met? Learning how to properly learn how to define a task is an essential skill and not related to just LabVIEW.

0 Kudos
Message 2 of 5
(3,486 Views)

Hi Dennis,

 

Thanks for replying. Let me try and better explain what I am attempting to do. I am helping a high school student who is conducting an experiment involving a spring mass system. The experiment looks like this. There is a weight that is guided on a rod. There is a spring also guided on the rod that the weight rests on initially. There is a piezo force transducer on the bottom of the rod. If the weight is lifted and released, the LabView VI captures the voltage signal from the piezo as the weight bounces up and down on the spring. It is difficult to capture the initial part of the cycle each time because the person dropping the weigh also has to hit the run button so the timing is inconsistent and the first cycle some times gets missed.

 

I am hoping the process can be automated so the capture can begin and end automatically. I would like the LabView application to start (same as hitting the run button) capturing the data as soon as the weight contacts the spring and the sensor starts to generate an output voltage. I would like this to happen without having to manually hit the run button. I would also like to have the ability to specify the time when the application stops capturing data so I can control how many cycles are measured.

 

Thanks,

Tim

 

photo.JPG

0 Kudos
Message 3 of 5
(3,460 Views)
The program cannot be started by a function. What you could do is have the acquisition triggered by an external event. What DAQ device are you using. Check the specs to see if it has an analog or digital trigger.
0 Kudos
Message 4 of 5
(3,448 Views)

I would suggest that you set up for continuous data acquisition.

 

Start the program well before the user lifts the weight.  The program would monitor the force being measured to establish a baseline. The baseline represents the static force of gravity on the weight. When the user lifts the weight, the force should drop to a much lower value, essentially the force of gravity on the spring. Of course there will be some oscillation until the spring relaxes to a steady state condition. Then that force should remain approximately constant (depending on how much force is transmitted through the rod while the weight is being held off the spring). When the weight is dropped the force will begin increasing when the wieght makes contact with the spring. When the oscillations damp out the force should return to close to the initial baseline.

 

By identifying the periods of no change (or minimal change) representing the baseline interval and the lifted weight interval, you can extract the segments of the data you want to display.

 

No special triggering or hardware is required. You have complete control over the data display. And you can see how much noise, frictional forces on the rod, and other imperfections may affect the results.

 

If it runs for a one-hour class with a sample rate of 1000 samples/second, it will produce less than 30 MB of data (stored in memory as an array of double precision floats).

 

Lynn

0 Kudos
Message 5 of 5
(3,436 Views)