|
Page 1 of 1
|
[ 14 posts ] |
|
RobotC Exception Violation
Author |
Message |
steve
Rookie
Joined: Sat Jun 09, 2007 8:41 am Posts: 7
|
 RobotC Exception Violation
I was going thru the RobotC software training, videos 7 and 8, on NXT movement. I tried writing a small program.
I'm getting an error message:
RobotC Exception Violation Report
Byte Code Interpreteter Exception:
Program Slot 0, Task ID: main[0]
Error at PC: BAD-LOC + 0x11554
Task PC: Task offset 006F
Task State: 'Exception'
Exception Type: 'Unknown(69)'
|
Sat Jun 09, 2007 9:02 am |
|
 |
starwarslegokid
Moderator
Joined: Wed Jan 31, 2007 3:39 am Posts: 299 Location: San Diego, California. USA
|
Can you post the code that brings up the error. Thanks!
Scott
_________________Mmmm Legos B-) My Robot Projects: http://www.freewebs.com/robotprojects/
|
Sat Jun 09, 2007 9:43 am |
|
 |
steve
Rookie
Joined: Sat Jun 09, 2007 8:41 am Posts: 7
|
|
Sat Jun 09, 2007 10:26 am |
|
 |
starwarslegokid
Moderator
Joined: Wed Jan 31, 2007 3:39 am Posts: 299 Location: San Diego, California. USA
|
Hmmm, i copied your code and had no problems running it, it acted strangely but it did run.
I might see your problem however. One thing I recommend is not use s1 or s2 as variables. The reason is S1, S2, S3, and S4 are already defined for sensor ports. Also, a variables text color should be black if on default settings, but yours are red which makes me think its trying to use them as sensor ports, not variables. Try changing your variables and seeing if that helps and message back.
Scott B-)
_________________Mmmm Legos B-) My Robot Projects: http://www.freewebs.com/robotprojects/
|
Sat Jun 09, 2007 6:04 pm |
|
 |
steve
Rookie
Joined: Sat Jun 09, 2007 8:41 am Posts: 7
|
This code generates a RobotC Exception Violation Report - Byte Code Interpreter Exception .... BAD-LOC .... Unknown(69) :
_______________
|
Sat Jun 09, 2007 8:48 pm |
|
 |
starwarslegokid
Moderator
Joined: Wed Jan 31, 2007 3:39 am Posts: 299 Location: San Diego, California. USA
|
This code ran fine for me as well....
When you installed Robot C, did you remove all previous versions using add/remove programs? Also, are you using Robot C 1.05?
Scott
_________________Mmmm Legos B-) My Robot Projects: http://www.freewebs.com/robotprojects/
|
Sat Jun 09, 2007 8:56 pm |
|
 |
JamesD
Novice
Joined: Sun Feb 04, 2007 12:48 am Posts: 69 Location: Australia
|
Hi Steve,
I'm not sure if you are experiencing a similar problem to me but I had a problem at one stage with syching motors. By the look of it you have made C the Master motor and B the Slave. I don't think you can then send commands to the slave motor, you can only address the master motor (in this case motorC) until you unsych the two motors. Try:
Cheers,
James
|
Sat Jun 09, 2007 9:56 pm |
|
 |
starwarslegokid
Moderator
Joined: Wed Jan 31, 2007 3:39 am Posts: 299 Location: San Diego, California. USA
|
Ahah i got it to crash, James is right, you cant send commands to a slave motor. Thanks James B-)
Scott
_________________Mmmm Legos B-) My Robot Projects: http://www.freewebs.com/robotprojects/
|
Sat Jun 09, 2007 11:18 pm |
|
 |
Dick Swan
Creator
Joined: Fri Feb 09, 2007 9:21 am Posts: 616
|
Here's a complete listing of the various exceptions. I have updated ROBOTC firmware so that your error -- 69 -- provides a more meaningful text string rather than "Unknown".
 |  |  |  | Code: /////////////////////////////////////////////////////////////////////////////////////////////// // // Exception Types // //////////////////////////////////////////////////////////////////////////////////////////////
typedef enum { exceptionNone = 0, exceptionSensorOutOfRange = 1, exceptionMotorOutOfRange = 2, exceptionTimerOutOfRange = 3, exceptionEventOutOfRange = 4, exceptionVariableOutOfRange = 5, exceptionOutOfRange = 6, exceptionArrayOutOfRange = 7,
exceptionViewVariableOutofRange = 8,
exceptionStackOverflow = 9, exceptionStackUnderflow = 10,
exceptionInvalidOpcode = 11,
exceptionReadOnlyParm = 12,
exceptionPCOutOfRange = 13,
exceptionUnused = 14,
exceptionInvalidSubroutine = 15, exceptionInvalidSubroutineReturn = 16,
exceptionAssertFailure = 17, exceptionParmOutOfRangeRead = 18, exceptionSystemParmOutOfRange = 19, exceptionValueOutOfRange = 20, exceptionUartParmOutOfRange = 21, exceptionSoundParmOutOfRange = 22, exceptionTaskOutOfRange = 23, exceptionInvalidLengthLongMessage = 24,
exceptionInvalidBreakpoint = 25, exceptionWordReadOfLongParm = 26, exceptionFloatNotSupported = 27, exceptionLongNotSupported = 28, exceptionBreakpoint = 29, exceptionToManyBreakpoint = 30, //unused, //unused, //unused, //unused, //unused, //unused, exceptionIllegalFloatOperand = 37, //unused 38 exceptionInternalError = 39, exceptionParmOutOfRangeWrite = 40, // Bad Opcode Source exceptionInvalidPConBranch = 41, exceptionInvalidPConSubReturn = 42, exceptionInvalidInternalQueues1 = 44, exceptionInvalidInternalQueues2 = 45, exceptionInvalidInternalQueues3 = 46, exceptionInvalidInternalQueues4 = 47, exceptionInvalidInternalQueues5 = 48, exceptionInvalidInternalQueues6 = 49, exceptionInvalidInternalQueues7 = 50, exceptionInvalidInternalQueues8 = 51, exceptionInvalidInternalQueues9 = 52, exceptionInvalidInternalQueues10 = 53, exceptionInvalidInternalQueues11 = 54, exceptionInvalidInternalQueues12 = 55, exceptionInvalidInternalQueues13 = 56, exceptionInvalidInternalQueues14 = 57, exceptionInvalidInternalQueues15 = 58, exceptionInvalidEventListMap1 = 58, exceptionInvalidEventListMap2 = 59, exceptionInvalidEventListMap3 = 60, exceptionInvalidEventListMap4 = 61, exceptionInvalidEventListMap5 = 62, exceptionInternalAsmGlueError = 63, exceptionDatalogIndexError = 64, exceptionDatalogRawNotImplemented = 65, exceptionDatalogOverflow = 66, exceptionInvalidDatalogSourceType = 67, exceptionRealAddressOutOfRange = 68, exceptionCannotUpdateSlaveSync = 69,
exceptionUnknown = opEnumType 255 } TVMException; |  |  |  |  |
You can also find the above enum in the file "OpcodeDefinitions.h" that is included in the RobotC distribution. You can use the information in the exception report to help isolate the problem area in your code. Looking at the typical exception below.
The report indicates that there was an exception 69 at offset (hex) 006F in task "main". You can use the list of exceptions to determine what 69 means. Use the 'F9' key in ROBOTC to get a listing of your program with assembler opcodes included. Find the code for task "main". Look for the instruction at opcode that is at offset '6F'. This is the instruction after the exception so look for the previous instruction. Now look for the C code that precedes this instruction -- this is the code line that generated the exception.
|
Fri Jun 22, 2007 6:09 am |
|
 |
Danzeau
Rookie
Joined: Tue Mar 08, 2011 7:33 pm Posts: 1
|
 Re: RobotC Exception Violation
hey guys
I have also been experiencing a similar problem...
Byte Code Interpreter Exception:
Program Slot: 0, Task ID: main[0] Error at PC: Task: main+0x0042 Task PC: Task offset start(0) TaskState: 'Exception' Exception Type: 'Motor out of range(2)'
the code i have been using is a similar one from the tutorials
task main() { motor(motorB) = 100; motor(motorC) = 100; wait1Msec (3000); }
thanks Danz
|
Tue Mar 08, 2011 7:38 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: RobotC Exception Violation
You should be using motor[motorC] and motor[motorB], they're not functions, they're arrays.
- 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]
|
Wed Mar 09, 2011 1:48 am |
|
 |
jcarla
Rookie
Joined: Thu Jul 28, 2011 3:37 am Posts: 2
|
 Re: RobotC Exception Violation
Thanks for the complete list of various exceptions
|
Thu Jul 28, 2011 3:46 am |
|
 |
123girr
Rookie
Joined: Wed Oct 09, 2013 3:55 pm Posts: 19
|
 Re: RobotC Exception Violation
I got a simmaler problem using this line of code the whole program is this:  |  |  |  | Code: #pragma config(I2C_Usage, I2C1, i2cSensors) #pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign) #pragma config(Motor, port1, Right, tmotorVex393, openLoop) #pragma config(Motor, port2, Shooter, tmotorVex393, openLoop, encoder, encoderPort, I2C_1, 1000) #pragma config(Motor, port3, Arm, tmotorVex393, openLoop) #pragma config(Motor, port10, Left, tmotorVex393, openLoop) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main() { while(1) { nMotorEncoder[I2C_1] = 0; motor[Right] = vexRT[Ch3] - vexRT[Ch1]; motor[Left] = vexRT[Ch3] + vexRT[Ch1]; if(vexRT[Btn6D] == 1) { while(nMotorEncoder[I2C_1] < 5) { motor[Shooter] = 127; if(vexRT[Btn8R] == 1) motor[Arm] = 65; if(vexRT[Btn8D] == 1) motor[Arm] = -65; } } } }
|  |  |  |  |
HELP ME!!!
|
Thu Nov 21, 2013 3:24 pm |
|
 |
123girr
Rookie
Joined: Wed Oct 09, 2013 3:55 pm Posts: 19
|
 Re: RobotC Exception Violation
Also, I forgot, the program wont shoot or lift the arm. Anyone know whats with that?
|
Thu Nov 21, 2013 3:26 pm |
|
|
|
Page 1 of 1
|
[ 14 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
|
|