LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

measuring time between limits

Hi guys, 

Im trying to measure the time between two limits, I want to measure the time it takes for a strain value to go from, say 10 to 3.(FYI Im very new to labview and don't quite follow the terminology.)

Thanks 

0 Kudos
Message 1 of 6
(2,150 Views)

Hi Rory,

 

It sounds like your problem consists of the following steps (possibly in a different order):

  1. Determine what your desired limits are (10, 3). Do they change? Or are they constant? Use a control if they can change between runs, or a constant if they are always 10 and 3.
  2. Write a VI that measures the value from the strain gauge.
    1. Is this a voltage?
    2. Do you have some data acquisition hardware (i.e. something to connect the sensor to and to your computer)?
    3. Is there any scaling you need to consider (V -> N, etc)
  3. Use something like a State Machine to measure the time between two value crossing events or similar
    1. Wait until the first limit is reached (maybe you have some setup first, etc)
    2. Check the voltage/force with your VI from (2).
    3. If you crossed the second limit, take the duration/time value
    4. Otherwise, check again. Consider waiting between reads, depending on how your "Read" VI works.

Does that sound possible?

 

Maybe you can let us know if you've done any of this already, or what hardware you're using, or any other questions you have on specific details.


GCentral
0 Kudos
Message 2 of 6
(2,123 Views)

so due to the current situation in the world i cant get my hands on the equipment, so instead im just using a slider. i want to demonstrate how to detect, when the measured time between the limits is greater than 10 seconds. 

my idea is to have a clock running in the background and when the strain reads 10, take a record of it, and when the strain reads 3 take a record, then minus one from the other and get the difference. if the difference is greater than 10 seconds get an led to light. 

i just really poor at coding ive done a small bit of it before but cant remember much. 

 

0 Kudos
Message 3 of 6
(2,111 Views)

Ok, so your "virtual" description simplifies step 2 immensely - it becomes just "read the slider value".

 

Your description of the method sounds fine.

As to a clock running in the background, for the precision you're describing, I'd suggest something like Get Date/Time in Seconds.

 

You can use an Event Structure if you want to monitor the slider, but be aware that this probably won't map to hardware effectively.

If you're going to want to use the strain gauge later, I'd suggest writing some sort of VI (perhaps with a reference to the slider wired in) to "simulate" reading the voltage/force.

Then when you have the real gauge, you can replace the VI more easily.

This is a very simple "hardware abstraction layer" kind of approach.


GCentral
0 Kudos
Message 4 of 6
(2,095 Views)

so the limits wont change but the slider will be moving up and down between them, so i want to be able to have a clock running in the background and then record readings when the limits are reached and then calculate the time difference in between, as i said previously. but thinking of it now, i probably wont be using it with a strain gauge. its just a proof of concept idea and im substituting the slider for the physical gauge and the change in the gauge. 

will the case structure automatically record the time when the limit is reached?

0 Kudos
Message 5 of 6
(2,091 Views)

Hi Rory,

 


@RORY.c wrote:

will the case structure automatically record the time when the limit is reached?


No, of course not! The case structure does comparisons, but not data storage...

You need to store timestamp data in shift registers!

Best regards,
GerdW


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