View unanswered posts | View active topics It is currently Sat Nov 01, 2014 10:03 am






Reply to topic  [ 3 posts ] 
ROBOTC Exception Voilation Report 
Author Message
Rookie

Joined: Sat Dec 07, 2013 1:08 pm
Posts: 8
Post ROBOTC Exception Voilation Report
I'm experiencing issues with my program. I'm getting an error when I "Start" on the Program Debug Window.

It reads:

ROBOTC Exception Violation Report
Byte Code Interpreter Exception:
Program Slot: 0. Task ID: main[0]
Error at PC: Task: main+0x0062
Task PC: Task:main+0x0000.
TaskState: 'Exception'
Exception Type: 'Motot out of range(2)'


This is on the computer. On the NXT it reads:

PgmCnt:000062
Type: 2


My task main() line is highlighted in yellow as well.

Here is the program:

Code:
#pragma config(Hubs,  S4, HTServo,  HTMotor,  HTMotor,  HTMotor)
#pragma config(Sensor, S4,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_S4_C2_1,     motorD,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S4_C2_2,     motorE,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S4_C3_1,     motorF,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S4_C3_2,     motorG,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S4_C4_1,     motorH,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S4_C4_2,     motorI,        tmotorTetrix, openLoop)
#pragma config(Servo,  srvo_S4_C1_1,    servo1,               tServoNone)
#pragma config(Servo,  srvo_S4_C1_2,    servo2,               tServoNone)
#pragma config(Servo,  srvo_S4_C1_3,    servo3,               tServoNone)
#pragma config(Servo,  srvo_S4_C1_4,    servo4,               tServoNone)
#pragma config(Servo,  srvo_S4_C1_5,    servo5,               tServoNone)
#pragma config(Servo,  srvo_S4_C1_6,    servo6,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()
{
   int threshold = 15;
   while(true)
   {
   getJoystickSettings(joystick);

                                              //Joy1 Drive Train/Flag Rasier
    if (abs(joystick.joy1_y1) > threshold)
    {
       motor[motorH] = joystick.joy1_y1/2;
    }
    else
    {
       motor[motorH] = 0;
    }

    if (abs(joystick.joy1_y2) > threshold)
    {
       motor[motorI] = joystick.joy1_y2/2;
    }
    else
    {
       motor[motorI] = 0;
    }
                                      //Flag Raiser controls
                                     // Part 1 of flag rasier is full speed for fastest raising
    if (joy1Btn(5) == 1)
      {
         motor[motorD] = 100;
      }
    else
      {
         motor[motorD] = 0;
      }

                                     //Part 2 for adjusting flag rasier to match handle
    if (joy1Btn(6) == 1)
      {
         motor[motorD] = 15;
      }
    else
      {
         motor[motorD] = 0;
      }

                                              //Joy2  Arm movements Joints/cubeGrabber
                                                  // Joint 1
      if (abs(joystick.joy2_y1) > threshold)
      {
        motor[motorF] = joystick.joy2_y1/2;
      }
    else
      {
         motor[motorF] = 0;
      }
                                                 // Joint 2
    if (abs(joystick.joy2_y2) > threshold)
      {
         motor[motorG] = joystick.joy2_y2/2;
      }
    else
      {
         motor[motorG] = 0;
      }
                                                 // Joint 3

  /*  if (joy2Btn(5) == 1)
    {
       servo[servo1] = 225;
    }
    else
    {
       servo[servo1] = 0;
    }*/
                                                // cubeGrabber
    if (joy2Btn(6) == 1)
    {
       motor[motorE] = 50;
    }
    else
    {
       motor[motorE] = 0;
    }
  }

}


I'm not sure what this means and would be happy if someone could explain.
Help is always appreciated!


Sat Dec 28, 2013 11:46 am
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 598
Post Re: ROBOTC Exception Voilation Report
Try running the HiTechnic controllers on another sensor port (and reconfigure your Motors and Sensors Setup page appropriately) in another copy of the program; this may be caused by a potential issue with 4 motor/servo controllers being used on port 4.

Also, which version of ROBOTC is being used? You can find this information under the 'Help -> About ROBOTC' menu option in ROBOTC. If it is a version older than 3.62, you may want to update to the latest version (3.62), which can be done by the 'Help -> Check for Updates' menu option.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Thu Jan 09, 2014 1:39 pm
Profile
Rookie

Joined: Sat Dec 07, 2013 1:08 pm
Posts: 8
Post Re: ROBOTC Exception Voilation Report
Hey,

Thanks for your suggestion. That could have been the problem. We're not sure what the problem was but we ended up writing a new program and going through all the wiring and ended up with a working program. But we didn't find what was messing it up.

Thanks for the suggestion though!


Fri Jan 10, 2014 3:03 pm
Profile
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.