Go to Post Screwing up is part of the game. Iterating, testing, and analyzing your failures separates the great from the average. - Jon Stratis [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 14-12-2011, 17:36
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
Target Exception Error from Solenoid Array

Hello, I have recently been looking into making my solenoids operate
based off an Array. I get no build Errors or warnings. However when i
run it i get a Target Exception Error.
VxWorks6x_10.4.86: Exception in Kernal Task FRC_RobotTask:0x1e37368
at pc=0x1DE93B0 in RobotDemo::OperationControl()
at (Address of main.cpp)

Vector 0x300 : Data Access addr=0xEEEEEEE status=0xDC1630

The Code that matters

bool states [4] = {false,false,false,false}
bool prestates [4] = {false,false,false,false}
bool inoutbut [4] = {false,false,false,false}

class RobotDemo : public SimpleRobot
{
Solenoid* solenoids[5];
}
// more stuff inbetween

void OperatorControl(void)
{
solenoids[1] = new Solenoid(1);
solenoids[2] = new Solenoid(2);

while (IsOperatorControl)
{
for(int b=1; b<5; b++)
{
inoutbut[b] = stick.GetRawButton(b) // the stick is correctly defined

if(inoutbut[b] == true)
{
g=b;
states[g]= !prestates[g];
solenoid [g]->Set(states[g]) // the debugger shows this as wrong
prestates[g] = !prestates [g];
}
}
}
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:24.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi