I’m programming with labVIEW and everything is going well. However, at random times the dashboard will display “Watch dog not fed”. To be honest, i’m not even fully sure what the watchdog is for. I know it has to do with making sure the robot gets disabled if it loses control? Anyways, I don’t have any unrestricted loops except for robot main. And this issue is kinda rare but happens just enough that I should fix it. I’ve read on some other posts that I should maybe add a watch dog into the code but I have no clue how to do that.
The watch dog makes sure code keeps getting fed, its like a " if you don’t feed your dog then it dies " , so you can use the “wait” block but if you want to see how a preset block (used mostly in drive by time) operates it then try opening the block “wpi_RobotDriveDelayAndUpdateSafety” in the functions palate ( wpi Robotics library --> RobotDrive)
There is a vi provided in your code called elapsed times. Drag it from the project explorer window in to your different loops and give it a different name in each instance. Run your code and double click on the vi to see your loop times.
This probably means that you have too much code in a loop that needs to executes quickly. You may need to move code to the timed tasks vi. This is where less critical things should happen. Things that should go here are:
Reading and resetting encoders.
The pneumatic compressor loop
operation of relays or solenoids
Reading Gyro and zeroing
For the most part the only thing that should be in the teleop code should be what you need to drive and no more. Last year we had the joystick vis and the motor drives. That was all we had in teleop.
If yo uplan to do any auto code for targeting I would make a new loop in the timed tasks or start a new VI that runs outside of the main loop. If you choose to do this make sure you understand how the code executes so you do not call motors and other controllers in more than one place.
You can search the forum… I know this question comes up very often.
Besides what was said here, here’s what I’d also check:
One common issue that I see is teams put Wait functions in Teleop, which is also a no-no as it delays the finish of the Teleop VI.
Avoid putting any Set Motor Output in case structures. If you’re setting motor power in a case structure, such as “spin wheels when I hold the trigger button”, but then forget to set the motor power off in the False case, then you may get the Watchdog Error (if enabled on your motor).