Go to Post Spell Check is your friend! - dez250 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-01-2011, 21:11
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 43
Steve Warner is an unknown quantity at this point
Relay Trouble

We are having a problem using a Relay object. Whenever we add a relay to our C++ code the drivers station indicates No Robot Code. We have used victors, digital inputs and solenoids with no problem but add a relay and no code. We have imaged the cRIO with the 2011 image, have updated Windriver and are using the 2011 WPILib. We've even tried a second cRIO, digital module and sidecar.

Does anyone know what could be causing this?
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2011, 23:51
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Relay Trouble

Quote:
Originally Posted by Steve Warner View Post
Does anyone know what could be causing this?
Without seeing the code that breaks your program, we can only guess. Show us something we can check for problems and we might be able to help.
Reply With Quote
  #3   Spotlight this post!  
Unread 20-01-2011, 08:19
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 43
Steve Warner is an unknown quantity at this point
Re: Relay Trouble

Right now the code to define a relay looks like this:

Relay *abcRelay;

abcRelay = new Relay(3);

The first line is globally defined and the second line is in a function called Init_Controls which is called from IRobot which is the constructor for the IterativeRobot class. Until I just checked the code, I was thinking that Init_Controls was called from RobotInit so this might be part of the problem but digital_inputs and solenoids are defined in the same function and work fine. It is the addition of the second line that kills the code.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-01-2011, 13:18
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Relay Trouble

Quote:
Originally Posted by Steve Warner View Post
Right now the code to define a relay looks like this:

Relay *abcRelay;

abcRelay = new Relay(3);
Context means everything, please post your full source code. http://pastie.org if it is large. If there are secrets about your robot design in your source code, then trim and rename variables only as necessary, but do not change the context in which abcRelay is used.

Edit: I would recommend placing the assignment in your constructor.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-01-2011, 20:15
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 43
Steve Warner is an unknown quantity at this point
Re: Relay Trouble

Well I got to thinking about this problem and why we see it and nobody else does. We didn't have much code in the project we were using so I decided to delete it and start over. I carefully followed the instructions to add the example project FRC Default Program and that worked. I then added a relay and that also worked so I modified the project like before and everything is working. I thought we had done this a couple of days ago but apparently not.

I'm sorry I didn't think to try this before I posted but I'm glad it's working so we can move on. Thanks for your comments.
Reply With Quote
Reply


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 15:22.

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