View Single Post
  #28   Spotlight this post!  
Unread 17-01-2012, 19:10
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: New to 2CAN and Jaguar

Quote:
Originally Posted by mikets View Post
SetPID is a void function. How do I check the "error"? GetFault()? If so, I did print out the value returned by GetFault in the loop. As far as I can tell, it's returning 0.
No... it's not GetFaults() that you want... it's GetError(). You can call StatusIsFatal() to get a boolean for if there is an error or not. GetError() returns an "Error" object (Error.h) that you can call a number of methods on if it is an error. It is generally good practice to always check for an error after every call to a CANJaguar object so you know if you can trust the data that is returned or if the command you sent was acknowledged by the Jaguar. If you get an error that is not "Time-out", the CANJaguar object will stop trying to talk to the device, since the calling code is clearly broken. This is likely what is happening in your case. If you get an error and you want to continue talking to the device, you can call ClearError() to try again. You should also call ClearError() if you get a time-out so that you can tell if there is a timeout from a future call.

I clearly need to write some examples for using CANJaguar in C++. Feel free to contribute some if you like.

-Joe
Reply With Quote