Quote:
Originally Posted by CRLS97
In our teams code the bulk of our code is in Periodic Tasks.vi However in our Teleop.vi code I'm having the robot read a digital input and a global data so we have a couple different ways of controlling the robot. Could this be causing our -44601 error? I can actually notice a significant lag (like half a second) between a joystick movement and the robot movement and it's somewhat annoying while we're testing. I even tried having both periodic tasks and vision disabled and the error remained...
|
I can't give an example in LabVIEW because I don't have it installed here, but here's a skeletal pseudo-C code:
Code:
while (1) {
if (!run_me) {sleep(20ms); continue;}
run_me= false;
doSomething;
sleep(250ms);
doSomethingElse;
}
The global boolean "run_me" tells the task to run once.
Notice the "sleep(20ms)" which prevents the task from chewing up an undue amount of CPU time.