View unanswered posts | View active topics It is currently Thu Jul 24, 2014 7:09 pm






Reply to topic  [ 8 posts ] 
"ROBOTC Exception Violation"?? 
Author Message
Rookie

Joined: Thu Apr 16, 2009 9:25 pm
Posts: 4
Post "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


Thu Apr 16, 2009 9:34 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post 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

_________________
| 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 Apr 17, 2009 1:48 am
Profile WWW
Rookie

Joined: Thu Apr 16, 2009 9:25 pm
Posts: 4
Post 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


Fri Apr 17, 2009 1:57 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post 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

_________________
| 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 Apr 17, 2009 2:32 am
Profile WWW
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:44 am
Posts: 439
Location: Pittsburgh, PA
Post 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?

_________________
Vu Nguyen
Software Training Development Team | Webmaster
Need more support? Use the ROBOTC Ticketing system

Robotc.net| Robomatter Store | Robotics Academy | CS2N


Fri Apr 17, 2009 9:26 am
Profile
Rookie

Joined: Sat Aug 30, 2008 2:25 am
Posts: 25
Post 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.


Sat Apr 18, 2009 12:51 am
Profile
Rookie

Joined: Thu Apr 16, 2009 9:25 pm
Posts: 4
Post 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.


Sat Apr 18, 2009 1:09 am
Profile
Rookie

Joined: Thu Apr 16, 2009 9:25 pm
Posts: 4
Post 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


Fri May 08, 2009 8:58 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 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.