Our CAN system (using LabView) is kind of working but there are significant errors and problems. We’re hoping to get a few pointers to what the problem might be.
We are getting:
ERROR <code> -52007 occurred at CAN Receive.vi NI Platform Services: The requested operation did no complete in time.
These happen quite often. The CAN network has 10 Jaguars. We initialize them all (and expect to be able to use them all). At this point, for debugging, we have disabled the use of all but 4 of them. These 4 are our drive motors. (All of the other Jaguars are initialized but never updated.)
Along with this error we are also getting
Watchdog Expiration: System 61, User 286
The system and user number are sometimes different. It’s not clear what the pattern is.
As we disabled more speed control code, the number of watchdogs has reduced. It sounds like the CAN Receive errors are related to the Watchdog. If CAN was receiving there would be no watchdog errors.
The lights on the speed controllers are solid for periods, but then flash during the Watchdog timeout. The speed controllers respond as we change the settings, but again, they flash off during the watchdog period.
I believe that if we fix the receive errors the watchdog errors will go away.
How can we address these problems? What is the cause of the receive timeout?
Thanks for the help,
…Duane
ps
I’ve noticed some updates to the Java and C++ code for the canjaguar project on FirstForge, but no recent changes for LabView.
Make sure you are running the latest (v87) version of the jaguar firmware. Also make sure the IDs are unique and correct.
What interface are you using to run the CAN? 2CAN or Black Jag? Make sure you have the plugin for that one correctly installed.
Also make sure you physically wired the CAN bus properly, with the daisy chaining, terminator plug on the end, and (if using serial) on the RJ-12 to RS-232 connector the resistor was properly wired.
Try running the jags from a regular computer. All of the ones on the CAN bus should stay solid yellow all of the time. If there is intermittent blinking then there are connection problems on the CAN bus
If you are using serial, make sure the console out switch is turned off. Off is with the lower part facing away from the cRIO modules.
Also try running the CAN with only those 4 jags. Just un-wire the rest of them and remove them from code.
Thanks. We have checked out all of those items. Everything works fine from BDC-COMM. The firmware is all updated and all Jaguars have unique address and respond to BDC-COMM.
We are using LabView and the serial connection to the Jaguars.
That eliminates most of the simple common errors. Looking back at your first post though, I realized it was problems with CAN Recieve.vi and not Send. What are you requesting from the Jaguar?
Also, if you disable the Watchdog does that make the problems go away? CAN requests are blocking so a loop won’t repeat until the request is finished. It could be taking too long, causing the user watchdog to not be fed, disabling the inputs and outputs, causing the recieve to not complete becase it can no longer read
If it isn’t the watchdog, is there anything in the code other than they joystick->CANJaguar code? If your code is just the read joystick value and output it to the Jaguar and that works, try adding more stuff in one at a time until you see the problem again. When it breaks you will know what is causing the problem.
If it still fails when it is just plain joystick read and CAN write, then I don’t think I can do much more to help you. I’m a C++ programmer mainly and I only deal with LabVIEW for the dashboard.
Did you try disabling the User watchdog? If that fixes it then simply extend the watchdog expiration time to solve everything.
What do you mean by auto-targeting code? Is it just sending targeting information to the dashboard or is it running the Jaguars? If it is running the jags then what happens if you remove that part of the code?
@aeasson If the sample code is failing then you did something wrong setting up the CAN bus. Try the things listed in my first post in this topic. Also are you using 2CAN or Serial?
We are using serial interface.
Some more information from a debug session.
When I probe the CANJaguarDriveReference in teleop everything shows a good status until I enable the driver station.
Then the error code appears in the probe window.
Again, the problem has to be in your setup of the CAN bus. There could be any number of physical problems in the system. Run through all of my checks in my first post to make sure everything works