View unanswered posts | View active topics It is currently Fri Dec 19, 2014 6:50 am






Reply to topic  [ 1 post ] 
NXT Datalogging Exception 
Author Message
Rookie

Joined: Tue Feb 19, 2013 4:11 pm
Posts: 8
Post NXT Datalogging Exception
I am trying to create a datalog with my accelerometer values in RobotC.

When I ran the program, an error screen appeared reading:

Byte Code Interpreter Exception:
...
Exception Type: 'Real Adress Range Exception(59)'

The reason I find this confusing is that in the line of coded in question (marked by the arrow), I cast the long variable robotstate.lasttime into an integer.

Here is my code (the important bits):

Code:
const int kDatalogSize = 1000;

task main ()   {
   nDatalogSize = kDatalogSize;
   const int kDataPointType1 = 1;
   const int kDataPointType2 = 2;

  while(true) {

     if(nUsedDatalogBytes >= kDatalogSize) {
        SaveNxtDatalog();
        PlaySound(soundBeepBeep);
        wait1Msec(2000);
        return;
     }
      
     AddToDatalog(kDataPointType1, robotstate.accelvals.x);
 --> AddToDatalog(kDataPointType2, (int)robotstate.lasttime);
     updatestate();
  }
}


Important notes:
robotstate.accelvals.x is an integer (yet no errors).
robotstate.lasttime is essentially nPgmTime(also a long)

I did change a line of code in RobotCIntrinsics: I commented out the initial delaration for AddToDatalog(); and uncommented another declaration to take integers as values:

Code:
//intrinsic void AddToDatalog(compileConst int nDataPtIndex, const short data)

intrinsic void AddToDatalog(compileConst int nDataPtIndex, const int  nDataValue)


Tue Feb 19, 2013 4:39 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

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.