Go to Post There's lots of other "stuff" that make a team work well in the FIRST environment, beyond designing and building a robot. - KathieK [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #23   Spotlight this post!  
Unread 01-17-2012, 07:10 PM
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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:45 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi