View unanswered posts | View active topics It is currently Thu Apr 17, 2014 7:11 am






Reply to topic  [ 3 posts ] 
Getting an Exception Violation report 
Author Message
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post Getting an Exception Violation report
Hi all, im running into a error and am not quite sure what to do and would love feedback :D

Im making special files with void statements to run special void statements for my sensors and including them in my robot projects. I ran into a weird error and wanted some feedback from people. I made a demo program to show when it happens

Here is my main robot program here:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



void TurnRight()
{
motor[motorB]=100;
}

void TurnLeft()
{
motor[motorB]=-100;
}

void Stop()
{
motor[motorB]=0;
}

task main()
{

ComplexThing();

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is the file I include to do ComplexThing(), then control the
robot in accordance until the void is completed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

void ComplexThing()
{
// do some complex logic, then control the motors in accordance
TurnRight();

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When I run the main segment of code with the second file included, i get the following error message

Image

Does anyone have any idea why this happens. If i move ComplexThing() to the main file, the code executes just fine but I want this to work so I can make sensor drivers and universal statements that directly control my motors.

Another thing, why does the error message say RCX Exception Violation when im working with the NXT ?????

Thanks!
Scott

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Wed Apr 25, 2007 11:11 pm
Profile WWW
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 614
Post 
The latest RobotC version says "RobotC Exception Report" and not "RCX Exception Report".

I suspect there may be two bugs at play here.

1. "ComplexThing" function refers to "TurnRight" before it is defined. So the RobotC compiler likely generated an error like "**Error**:Undefined procedure 'TurnRight'". YOu can solve this by either using a function prototype before the reference or changing the location of your "#include" statement.

2. RobotC generated code and let you download even though there was error. Althought in looking at the code RobotC generated it shouldn't have caused an error.

Above is why it works when you move to main file. You probably put it after "turnRight" is defned.

The exception report refers to a function "SpecialTask" but I didn't see it in the code you posted.


Fri May 04, 2007 3:10 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
Thanks Dick! It dint occur to me to have the void statements before including the file. Thanks!

Scott B-)

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Fri May 04, 2007 2:24 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 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.