While many would have ideas, I would most appreciate hearing from actual NI employees and similarly knowledgeable folks.
We had working code, and then I noticed that our shooter was no longer rotating to aim. This aiming is controlled by a loop in Periodic Tasks.vi. When I probed the wire coming out of the global boolean (that goes “TRUE” to make the shooter aim), I did not get “FALSE”, I got “Not Executed”. What? So I put a probe on the wire between the constant and the Wait (ms) that controls the loop rate (see figure 1). The value of the probe was zero!
In desperation, I deleted the constant and the wait, and re-drew them. No help: still zero milliseconds. So I deleted them again, and and also removed the While loop (removed, not deleted, preserving the code within). When I re-drew the loop and the timing bits, things seemed to work…for about five minutes.
Then we started getting “Watchdog not fed” messages and the controls became entirely unresponsive. So I started probing other loops in Periodic Tasks. When I placed a probe as in figure 2, I got a value of “Not Executed”. That is just not right. The value of the global being probed in figure 2 is obtained (from the dashboard) in a loop that is also in Periodic Tasks (shown in figure 3). The value of the probe shown in figure 3 was 200 (the correct value). Please explain.
I “solved” this problem by just disabling the entire loop shown in figure 2. Again, things worked for a few minutes. Then our flywheel stopped operating (along with more watchdog errors and unresponsiveness.) When I probed the timing for that control loop (just as in figure 1), I got a value of some 11 million and change (!). I tried the trick of removing the while loop and timing, and then re-drawing them. Same problem, but a value of 12000344 when I probed between the constant 20 and the Wait vi (refer to figure 1 to see why 20 is the expected value).
I should mention that all of these problem occurred while using a cable to connect the laptop directly to the radio. No wireless, because these problems never surfaced until we were in the pit for this weekend’s competition.
My solution? I un-packed our last saved archive from before these problems started. Mostly the code we wanted with only a few minor issues not fixed. We made no changes. We did not even open the code, only built it and deployed it. And it works as before FOR ONE MATCH ONLY. Our robot will only function if we re-image our cRIO and re-deploy the build after every match! And, some things are no longer working properly, as if the build is slowly becoming corrupted…
Anther thing to make clear: between having working code and the first of these problems we made no changes to Periodic Tasks.vi. The few changes we did make were all in Teleop and Autonomous.
I’ve pretty much had it. Unless someone can tell me how to fix this problem and prevent similar absurdities from occurring in the future, we’re using C next year.