View Single Post
  #7   Spotlight this post!  
Unread 19-02-2010, 00:38
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: Is anyone using LabView and can bus?

Quote:
Originally Posted by Andy Bradley View Post
Thank you, thank you, and thank you Joe! That helped a lot. Our can bus works now. The only thing that we haven't yet done is write the set/get refnum functions for a single Jaguar. Any idea how to do that? (that is to say, do we try to modify the can library, or write our own from scratch?)
Thanks
I did that for our team, and it's a bit messy, but not too bad. First of all, the next update of the CANJaguar library will have a RefNum VI set in it, and is accessible on SVN (you'll have to ask Joe how to access that). Second, it might just be easier to bundle all of the RefNum output clusters into one big cluster and run it between Begin and Teleop/Autonomous, where it is then unbundled.

If you look in the "CANJaguar for LabView" folder from First Forge under "CAN Jaguar - MotorControl", there is a SubVIs folder. One of the files in this folder is called "CAN Jaguar Ref.ctl", and is not a VI, it's a cluster. If you right-click on the front panel, go to "Select a VI..." and double-click this file, it will put a cluster on the front panel. You can then copy this to create an in and an out.

If you look at all of the Get and Set RefNum VI's, they're all pretty much exactly the same, except the input clusters are different. You can do the same here. You will need to copy 3 files; "xxxx RefNum Get Set.vi", "xxxx RefNum Registry Set.vi", and "xxxx RefNum Registry Get.vi", where "xxxx" is the new name of your favorite RefNum VI (I used the PWM motor control one). In all of these new VI's, "simply" replace all of the old refnum clusters with the CANJaguar cluster. Remember you will probably have to rewire the terminals on the connector for the VI, and you should also redo the icon a bit so you know what's what.

Once you've modified the VI's you copied into your project folder (and not replaced them, never modify VI's that are still IN the standard LabView libraries, you get lots of errors that way), make sure they're added into the project in LabView, under Team Code. You *should* be able to wire them in normally as RefNums now, but let me know if you have any problems.

Again, it might just be easier to bundle the RefNum clusters together (make sure to name them descriptively so you can see what's what when you unbundle) and wire them through. And, also again, there will be a refnum VI set in the next CANJaguar release.
Reply With Quote