Microswitch program..

Basically I want to press a button and let go but the motor begins to run until the switch is activated then I want it to roll back for 5 seconds. Can someone give me an example on how to do this using Labview.

Is this what you are trying to accomplish? I think some other programmers on here could help out and also make sure I haven’t made mistakes…

Yes thank you…

I’m not sure it actually works, as I don’t normally work with the wait.vi function so I’d build it up just to make sure.

make sure you don’t put that in teleop. That wait will stall out the loop.

He is correct… Perhaps a Elapsed timer would work better.

actually, you would do good to do it the way you have it here, but throw it into a separate loop in periodic tasks. There is no good way that I have found yet to do a delay on the cRIO without running it in parallel. Mainly because the timestamp is kind of flakey.