View Full Version : Crio and CAN
randalcr
21-08-2010, 20:25
Ok, so our team has been playing around with CAN be it seems we're not doing something right. Is there a guide anywhere that shows you how to set up CAN step-by-step or something along the lines of that? we can write the code to use CAN easy enough, its when we start trying to talk to the jags through the crio that we start getting problems.
We a using the serial port on the Crio, we are fairly sure we can rule out our cables since we can see all of the jags on the network when we use the BDC comm, and we are only using 3 to 4 jags total.
any input is appreciated and helpful, Thanks!
Radical Pi
21-08-2010, 20:58
If you've got BDC-comm working, all of the guides I know of won't be of much worth to you. Assuming you're writing the code properly, the only problem I can think of is that you forgot to ftp the BlackJagBridgePlugin.out to the cRIO and add it to ni-rt.ini
if that isn't it, could you post your code here?
randalcr
21-08-2010, 21:30
we think its either the Crio or the ini file not being in the right spot, is there any where that shows where exactly that .ini file goes?
and do you want the .vis or screenshots?
The ni-rt.ini file needs to be downloaded from the CRIO via ftp. The file is located in the root of the CRIO's filesystem. The file then needs to be edited, then uploaded to the CRIO over ftp. The black jaguar plugin needs to be uploaded via ftp to "/ni-rt/system" folder.
In the [LVRT] section, add "FRC_BlackJagBridgePlugin.out;" to the end of the list of StartupDlls, like so:
...
StartupDlls=NiRioRpc.out;niorbs.out;NiViSrvr.out;n ivissvc.out;nivision.out;niserial.out;FRC_FPGA.out ;FRC_NetworkCommunication.out;FRC_BlackJagBridgePl ugin.out;
...
Like Bot190 stated, the FRC_Black_JagBridgePlugin.out should go in /ni-rt/system/ on the cRIO.
There's instructions for this somewhere, I just can't remember where.
Anyways, I've attached the ni-rt.ini from my cRIO for you to compare.
Directions can be found here (http://firstforge.wpi.edu/sf/wiki/do/viewPage/projects.canjaguar/wiki/GettingStarted). The Can Jaguar library can also be found on FirstForge.
randalcr
22-08-2010, 17:10
thanks guys, this is really helpful! I'll let you know how it turns out when i time to work on it.
Radical Pi
22-08-2010, 21:41
make sure it goes in right after FRC_NetworkCommunication.out, not at the end like kamocat said. FRC_UserProgram.out might have problems if it's not loaded
randalcr
23-08-2010, 23:29
ok, I got the Crio set up with a new image (just for a fresh start) and the ni-rt file edited and put back and add the plugin too. when I deployed the code the two jags i was using did not change their status to the solid light to show their state (they continued to blink)
So im starting to wonder if someone mistakenly set 2 as an id for the first jag, or its something with the firmware of the jags themselves.
Did you update the firmware for the Jaguars?
In BDC-COMM, does it say "trusted" in the upper left corner of the window?
Here's something simple to test: Create a program to run the "enumeration" command in a loop and display the output. This will tell you what Jaguars you have communication to.
randalcr
02-09-2010, 20:17
Can anyone post some working CAN code? I have ruled out everything I can think of on the robot side of this equation, and everything i have changed in the code has had very little effect.
The one consistent error we get is something along the line of "-0557 Can Recieve.....", I have no clue what this means and I can't seem to find any tips on what it is related too or how to get it fixed.
Thanks.
There is example code for all 3 languages on First Forge, its the basic tank drive using CAN. If i remember correctly its only available from the SVN repository, but it might be available in the downloads section. If its not in the downloads you need to create an account, then download the code using an SVN client.
randalcr
03-09-2010, 10:32
Thanks, I downloaded a couple of the vis. And i'll see if i can get CAN to work using them.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.