View unanswered posts | View active topics It is currently Wed Oct 01, 2014 10:23 am






Reply to topic  [ 4 posts ] 
RobotC Exception Violation 
Author Message
Rookie

Joined: Thu Apr 07, 2011 2:50 am
Posts: 1
Post RobotC Exception Violation
While we were testing our robot's autonomous, and it suddenly stopped responding. In the debugger perspective, a window popped up, titled "RobotC Exception Violation." The contents of the window included:
Byte Code Interpreter Exception
...
TaskState: 'Exception'
Exception Type: 'Real Address Range Exception (59)'

The details I left out refer to line 9 of this function:
Code:
int limitMotorPower (int number, int limit)
{
     if (number > limit)
     {
          return limit;
     }
     else if (number < -limit)
     {
-->                   return -limit;
     }
     else
     {
         return number;
     }
}


Any sort of assistance would be greatly appreciated.


Thu Apr 07, 2011 3:01 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: RobotC Exception Violation
Code:
int limitMotorPower (int number, int limit)
{
     if (number > limit)
     {
          return limit;
     }
     else if (number < -limit)
     {
           return limit * -1;   // <-- try this instead :)
     }
     else
     {
         return number;
     }
}

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Apr 07, 2011 4:00 am
Profile WWW
Rookie

Joined: Thu Jun 10, 2010 2:00 am
Posts: 17
Post Re: RobotC Exception Violation
I had a similar problem and your fix took care of it. Thanks. Do you have an explanation for the problem? Is there a bug fix in the works?

_________________
Blog: Robot Musings http://vamfun.wordpress.com/
Youtube Chan: http://www.youtube.com/user/vamfun?feature=mhsn
VEX/FRC Team 599 Robodox Mentor


Fri Jan 13, 2012 2:02 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: RobotC Exception Violation
I have no explanation for the problem, perhaps if you mailed support@robotc.net you can get one.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Jan 13, 2012 3:25 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.