View Full Version : pic: Another Teleop while loop
nxtmonkeys
19-02-2014, 12:55
[cdm-description=photo]39644[/cdm-description]
Alan Anderson
19-02-2014, 14:13
Are you actually using this code in Teleop? What I see would completely break the robot program if it were placed there.
nxtmonkeys
19-02-2014, 14:14
Yes, I am. It works too. I wonder why people keep telling me that there's something wrong? Please tell me if I am missing anything. :confused:
Alan Anderson
19-02-2014, 14:24
If "stop" isn't true, then putting that while loop in Teleop will keep the rest of the robot program from running. I would expect to see communication issues indicated on the Driver Station.
Since you don't have any sort of delay in the loop, it will also use up all of the CPU time setting the motor output as fast as it can.
nxtmonkeys
19-02-2014, 14:26
Huh. It doesn't seem to do that when I run it in parallel with my other loops. I wonder why? :confused:
Telepop itself is in a loop. Adding a while loop inside it is, at the very least, redundant. Although I can see why others think it might cause problems as well.
nxtmonkeys
19-02-2014, 18:07
Well, I pretty much have a few while loops which execute at the same time. I have the loops so that I can fire until the battery dies (if I wanted to). I didn't know that teleop was a loop. Huh. Thanks.
Alan Anderson
19-02-2014, 22:35
Teleop isn't exactly in a loop. It's called by the Robot Main vi whenever the Driver Station sends new data, and if your Teleop code doesn't finish before the next data packet arrives you'll start tripping the communication watchdog. Putting a neverending loop inside Teleop is a sure way to break your code.
Can you post your Teleop.vi file? I'm curious what you've done that lets the robot work even with the collection of unthrottled and unterminated while loops you say you've put there.
nxtmonkeys
20-02-2014, 10:48
Can't right now. my younger brother kneeled on our programming computer and broke the screen, so... :( :( :( :(
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.