LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch timer within case structure?

Solved!
Go to solution

Hi,

 

I'm relativly new to LabVIEW, so hoping someone can help me with something I'm trying to solve. I'm working on a data acquisition system for a Formula SAE car, and am trying to design a VI which will time how long it takes for the car to complete the 75m acceleration test. The timer will be actvated by holding the brake pedal for 5 seconds, and save the time to file when 75m has been completed.

 

I have set up a case structure which works in the following sequence.

1: Check Brake Pressure (if above threshold, go to 2)

2: Time how long brake has been pressed for. (If over 5 seconds go to 3. If brake is release within this time, go back to 1)

3. Check for wheel movement(if wheel strats moving, go to 4, if not, keep checking)

4. Start measuring speed and distance. (once reached, go to 5)

5. Reset all to Zero, Save File ( then go back to 1)

 

I'm happy enough with everything but part 2. I've tried a wait timer inside a flat sequence, which checks for pressure at either end, but pulsing the pedal rather than holding it can active this, and using a true/false case structure with the same wait function doesn't work as LabVIEW doens't read the true/false value once inside the case structure.

 

I'd be grateful if anyone could point me in the right direction!

 

Thanks,

Kevin

 

Download All
0 Kudos
Message 1 of 4
(3,000 Views)

Hi Kevin,

 

You have a pretty good start there. A state machine is the way to go.

 

One thing to keep in mind with state machines is that you almost never want to put a long wait in any state.

Long waits prevent you from responding to things that might happen.

 

In your "Count Timer T/F" state you need to be constantly monitoring the pedal pressure while checking for the end of the time interval.

 

See the attached file.

 

steve

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
Message 2 of 4
(2,976 Views)
Solution
Accepted by topic author kirving

get rid of the sequence, here your elapsed timer, also rid of your check brake pressure case, do not use Wait ms for your sequence timing...

brake.png

Message 3 of 4
(2,971 Views)

Thank you for your help, this does exactly what I was looking for! I knew that the the Wait ms was incorrect, so thanks for pointing me in the right direction!

0 Kudos
Message 4 of 4
(2,940 Views)