Quote:
Originally Posted by Alan Anderson
If it's always going to be the same automated tasks in the same order with the same timing, and if you're never going to want to control any of the same actuators manually at the same time, there's another way to do it that might be simpler. Add a parallel task (you can put it in the Periodic Tasks vi) that consists of a never-terminating while loop. Inside that loop, use a flat sequence with each step of the process in its own frame alongside an appropriate delay. In the very first frame, put a while loop that terminates only when a global variable is set true. Set that variable false again in the very last frame. In your main code, whenever the automatic sequence is needed, set that global variable true and the parallel task will do its thing.
|
Alan's approach is certainly simpler at the human interface level, which is a big plus, and therefor highly desirable for some teams. But it is more complex for the computer (basically the idea is to let the underlying RTOS - Wind River - work its magic and handle the necessary multitasking). However, since the cRIO is so powerful, that concern is minimal (for what we're doing anyway).
Greg, if you are reading, could you please comment on how the RTOS handles a parallel task which is doing nothing but cycling in a while loop waiting for a global boolean to change state? Is the RTOS smart enough to reduce that task's time slice so as not to waste processing resources?
~