|
Re: Parallel loops vs. One loop?
It is more efficient to combine them into one loop, but not significantly. If they are affecting Teleop at all then you need to rethink your code design.
Before doing anything I'd suggest measuring the rates of all your loops to see how they are affecting overall timing.
One or more of your loops may not be running as fast as 20ms and that would impact Teleop worst of all.
Look under Support Code" in your project and you will see Elapsed Times.vi
Drop a copy of this vi into each of your loops, and into teleop, and give them unique names so they can be told apart.
Open the front panel of Elapsed Times and run your code in debug from Robot Main. Elapsed Times will tell you how long each loop is actually taking.
Each of your loops should be taking just a few ms longer than 20ms. If you see any that are taking significantly longer than that, then you will need to slow down the loop to a more reasonable time or you will need to streamline your code more.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
|