Autonomus timed tasks

I need to control motors for certain amounts of time. Like drive motors for two seconds, then arm motors for 3, etc. How do I do this in labview?

This can easily be achieved with a state machine. Check out FRCMastery.comfor a really helpful tutorial on how to set this up.

A state machine is only necessary if your code needs to run very quickly and exit, and then run again the next loop, for example if it’s being run in telop. That’s not necessary for autonomous independent, because that code doesn’t need to exit. State machines are great tools, I just wouldn’t apply one in this situation.

Look at the frcmastery video “Step 5 - Turn on Autonomous Mode”. It walks through the default (non game specific) autonomous code, which runs the drive train for certain periods of time. It shouldn’t be hard to do something similar to add arm control.

If you really want to do different things based only on elapsed time, the easiest tool to use is probably the Flat Sequence. It looks like a movie timeline. Each frame in the sequence will run in turn after the previous frame has completed. If you place a simple Wait function in a frame, that frame will complete only after the specified time has elapsed.

The motor safeties will shut down the outputs if you don’t keep setting a value continuously, so you need to either find a way to loop inside the frame to keep them happey, or just disable or lengthen the safety timeout.

All three of these options are workable solutions to the task at hand.
I’ll acknowledge, as Joe pointed out, that a state machine may not be the most convenient way, but depending on how you trigger state changes, it is actually a very useful and effective way to program autonomous. In fact, last year we had four different autonomous modes, each was it’s own state machine. It worked great.

Joe’s suggestion to follow the “Step 5 - Turn on Autonomous Mode” on FRCMastery.com is an excellent and simple way to make autonomous work.
Alan’s suggestion to use a Flat Sequence is almost exactly the same approach as the timed loops show in Joe’s suggestion, just implemented a slightly different way.

Learn all three methods and you will be prepared for almost any Autonomous challenge, and many other challenges as well.