ROBOTC.net forums
http://www.robotc.net/forums/

"ROBOTC Exception Violation"??
http://www.robotc.net/forums/viewtopic.php?f=11&t=1641
Page 1 of 1

Author:  kennypu [ Thu Apr 16, 2009 9:34 pm ]
Post subject:  "ROBOTC Exception Violation"??

Hi, I'm new to robotc, but not c/c++ programming in general. Anyways, I'm working on a competition program for our bot, and the source code compiles fine, but when I run the program I get a pop up saying:
ROBOTC Exception Violation Report
***Byte Code Exception***
Source: opcode message<Noop> (0x00)
Exception Type: 'Unknown(90)' (90)

and I do get problems in the program as well. Just to test right now I have
Code:
motor[port2] = 127;
motor[port3] = 127;
wait1Msec(2000);
motor[port2] = 0;
motor[port3] = 0;

in the autonomous() task. For some reason when I run the code, it does set port2/3 motors, but even if I wait 2 seconds, it does not stop. If autonomous() automatically loops like a while loop, then it's understandable, but before I had more code in, and for somereason anything after the wait1Msec() does not get executed. Does any one have any ideas? If things don't work out I will probably have to revert back to easyC which I do not like because I am used to the traditional 'type in code' style and not drag and drops. Thanks in advance,l
Ken

Author:  mightor [ Fri Apr 17, 2009 1:48 am ]
Post subject:  Re: "ROBOTC Exception Violation"??

I am not sure if this is also true for the IFI environment, but the motor speed shouldn't exceed 100. It's a percentage, not an absolute value.

Regards,
Xander

Author:  kennypu [ Fri Apr 17, 2009 1:57 am ]
Post subject:  Re: "ROBOTC Exception Violation"??

mightor wrote:
I am not sure if this is also true for the IFI environment, but the motor speed shouldn't exceed 100. It's a percentage, not an absolute value.

Regards,
Xander

thanks for the reply. In the examples, and on the online help manual it says it ranges from -127 to 127, so I believe thats not the problem, but I can try it out tomorrow. Some interesting thing though, as you can see in the code, I set both motors to 127. In the debugger, when I start the controller, for some reason, the motors are set to motor[port1] = 0, motor[port2] = 90, motor[port3] = 0,..and so on in that pattern. When I turn the joystick on, it sets port2 to 127 like it should, but port3 gets set to 37. Weird things going on xP. Any help would be appreciated. Thanks

Author:  mightor [ Fri Apr 17, 2009 2:32 am ]
Post subject:  Re: "ROBOTC Exception Violation"??

K, I've only ever programmed RobotC for the NXT. I hope you get some more useful answers soon :)

Regards,
Xander

Author:  vnguyen [ Fri Apr 17, 2009 9:26 am ]
Post subject:  Re: "ROBOTC Exception Violation"??

Can you post the entire code on here? You mentioned for a competition, are you using a code template for the competition? Which competition is this for?

Author:  fryfrog [ Sat Apr 18, 2009 12:51 am ]
Post subject:  Re: "ROBOTC Exception Violation"??

Just a quick, no thought suggestion: Make sure everything is up to date and current. Make sure you are using the most recent version of RobotC and that you have downloaded the most recent firmware to the controller.

Until we see your code, I'm not sure what more help anyone can provide.

Author:  kennypu [ Sat Apr 18, 2009 1:09 am ]
Post subject:  Re: "ROBOTC Exception Violation"??

I was coding for the vex elevation competition. The code is as follow:
Code:
/*
motor1 and motor 4 = Treads(Arm)
motor2 and motor3  = Wheels
motor5 = lift of arm
1,4,5 - reversed
*/

//Defines the platform this code will be functional for.
#pragma platform(VEX)

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)

//Main competition background code...do not modify!
#include "Vex_Competition_Includes.c"

//globals


//All tasks that occur before the competition starts. This code will only execute once.
//Example: clearing encoders, setting motor reflectives, setting servo positions
void pre_auton()
{
   //reverse ahead of time motors for easy navigation
   /*
   bMotorFlippedMode[port1] = 1;
   bMotorFlippedMode[port2] = 1;
   bMotorFlippedMode[port4] = 1;
   bMotorFlippedMode[port5] = 1;
   */
}

//Autonomous code goes here. This code will automatically execute in a loop.
task autonomous()
{
         motor[port2] = 127;
         motor[port3] = 127;
         wait1Msec(2000);
         motor[port2] = 0;
         motor[port3] = 0;
/*
      motor[port2] = 0;
      motor[port3] = 0;
      motor[port5] = 127;
      wait1Msec(4000);

      motor[port1] = 127;
      motor[port4] = 127;
      wait1Msec(3000);

      motor[port1] = 0;
      motor[port4] = 0;
      motor[port2] = -127;
      motor[port3] = -127;
      wait1Msec(2000);

      motor[port5] = -127;
      motor[port2] = -127;
      motor[port3] =  127;
      wait1Msec(3000);

      motor[port1] = 0;
      motor[port2] = 0;
      motor[port3] = 0;
      motor[port4] = 0;
      motor[port5] = 0;
*/
}

//User control code here. This code will automatically execute in a loop.
task usercontrol()
{
   motor[port1] = vexRT(Ch1);
   motor[port2] = vexRT(Ch2);
   motor[port3] = vexRT(Ch3);
   motor[port4] = vexRT(Ch4);
   motor[port5] = vexRT(Ch5);
   motor[port6] = vexRT(Ch6);
}

I based it off the Vex_Competition_Template.c in the samples.

Author:  kennypu [ Fri May 08, 2009 8:58 pm ]
Post subject:  Re: "ROBOTC Exception Violation"??

no one seemed to know the problem, but I figured it out. Soon as I changed the firmware from "VEX VM0752.hex" to "VEX VM 0721.hex" It fixed the problem x]. Any one know why? I would think that VM0752.hex is the newer version of the firmware, but it didn't work :3

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/