Go to Post I'd like to think FIRST hasn't completely transformed into a money hungry self serving corporation. I'd like to think they actually still think they care about us. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 29-01-2009, 21:38
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
DIO not working in autonomous.

We are trying to do something that should be very simple. We are trying to read a switch hooked up to module 4, channel 1, and based on its value turn on an LED connected to module 4 channel 6.

The switch is wired from signal to ground so that an open switch should return "True" and closed should return "False". By using a multi-meter, I have verified that the signal line switches between 4 volts and ground with the switch open, then closed.

The LED is wired from the +5v line to signal, so that the signal pin provides the ground for the LED. I verified that the LED works by connecting it between +5v and Gnd lines on the digital breakout board.

This is all basic stuff we did on last years controller successfully. The problem is that the Labview program doesn't see the switch signal pin changing at all, and the signal line connected to the LED never changes from 4.0v.

The code for the autonomous portion is included below. Someone please tell me what simple thing we have overlooked. I know I am going to feel stupid when I see the answer, but we have stared at this for 2 days now without seeing what is wrong. We know it is running the autonomous code as the numeric indicator increments as expected. Neither the boolean indicator or the LED ever changes state.



Thanks,
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2009, 22:55
Burmeister #279's Avatar
Burmeister #279 Burmeister #279 is offline
What Time Is It?
AKA: Nick Burmeister
FRC #0279 (TechFusion)
Team Role: Programmer
 
Join Date: Nov 2008
Rookie Year: 2007
Location: Toledo
Posts: 207
Burmeister #279 is a glorious beacon of lightBurmeister #279 is a glorious beacon of lightBurmeister #279 is a glorious beacon of lightBurmeister #279 is a glorious beacon of lightBurmeister #279 is a glorious beacon of lightBurmeister #279 is a glorious beacon of light
Send a message via AIM to Burmeister #279
Re: DIO not working in autonomous.

do you know for sure that the switch is working correctly and switching the input the way you want? if so, next time you run the program, open the VI that its in and click on the light bulb in the block diagram. this will allow you to see the values that are being read and sent. [light bulb is highlighted in attached picture] the only other thing i can think of asking is if the LED has/needs a resistor? 330 ohm should do the trick if so. i know the driverstation will reset itself if one of the 5v source pins touches the 0v ground pins, so watch out for that. if all else fails reload the code.


burmeister.twosevennine@gmail.com
__________________
WHAT TIME IS IT? TWO SEVEN NINE!!! [Team B =) ] Awards: 4 Safety, 2 Ind. Design, 2 Xerox, 1 Nat. Champs
2009 Buckeye Semi-Finalists (1014 & 695) || 2008 GLR Safety Award || 2006 GLR Safety Award
2005 Buckeye Regional Champs (67 & 274) & GM Industrial Design Award & Safety Award GLR Quarter Finalist & Xerox Creativity Award & Safety Award National Xerox Creativity Award & Curie Quarter Finalist (1126 & 180)
2004 Buckeye Delphi Driving Tomorrows Technology Award & Quarter Finalist GLR Champs Nationals Curie Division Finalist
2003 GLR GM Industrial Design Award || 2001 National Newton Division Winner & National Champions
2000 MI DaimlerChrysler Team Spirit Award
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2009, 00:28
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
Re: DIO not working in autonomous.

Yep, we clicked the light bulb and the output from the DIO-Get call never changed from "T" regardless of whether or not the switch was pressed. At the same time we put a multi-meter on the signal line connected to the switch and watched it change from 4.0v (switch open) to 0v (switch closed). I'm positive the switch and signal line are doing what they are supposed to, but the program isn't seeing the change on the signal line.
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2009, 00:30
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
Re: DIO not working in autonomous.

P.S. The LED does have the required inline resistor.
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2009, 00:33
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: DIO not working in autonomous.

I can't say what is wrong, but I may be able to tell you how to debug it.

Use either execution hilighting to watch the values flow through the wires, or use the dashboard to see if there are errors coming from the code.Some of the I/O is picky that multiple places in the code don't each open and talk to it. My guess is that the debugging will show you which is getting the error.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 30-01-2009, 09:16
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: DIO not working in autonomous.

You don't mention a pullup resistor on the digital input. You didn't need one last year. Even though your test inicates it's working I would add the pullup.

However, based on your tests, I'd be concerned about using the correct input channel. I'd try switching input channels while leaving the wires in place to see if you have the wrong input. Could be a 1-0 numbering problem.

Also, try switching the led from a screen button, switch ALL the outputs.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor

Last edited by PhilBot : 30-01-2009 at 09:19.
Reply With Quote
  #7   Spotlight this post!  
Unread 30-01-2009, 11:49
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
Re: DIO not working in autonomous.

Greg,
We did use the execution highlighting and did not see any errors (a previous version of the code passed the error signal through so we could look at it).

Phil,
If you look at the datasheets, the GPIO lines have a 10K pullup resistor. I did verify with a multi-meter that this was the case and that closing and opening the switch made the voltage at the signal line do what we expected. I also verified that NONE of the signal lines (set as outputs) changed output voltage when expected, so I don't think we have a numbering issue.

We also at one point added a switch to our Labview control panel and connected it to the LED and on-screen LED indicator. The on-screen indicator turned on and off just like expected, but the voltage didn't change on any of the GPIO signal lines.


Thanks all for the great suggestions. I know there must be one of those "Duh" things that we are doing wrong somewhere, but I sure can't see it yet.

Thanks,
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
Reply With Quote
  #8   Spotlight this post!  
Unread 30-01-2009, 12:34
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: DIO not working in autonomous.

Quote:
Originally Posted by adamdb View Post
Phil,
If you look at the datasheets, the GPIO lines have a 10K pullup resistor.
D'oh, I was reading your post on my iTouch and was sure you were talking about the Driver Station.. Must have been the prior post.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #9   Spotlight this post!  
Unread 31-01-2009, 00:28
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
Re: DIO not working in autonomous.

PROBLEM SOLVED!

As expected it was a hardware problem: Loose nut behind the keyboard (me).

It was an indexing issue (0 vs. 1). We had the switch connected to DIO ch 1 (according to the numbers on the digital breakout board) whereas the code needs to use 0 to access that channel. Why couldn't they have numbered the breakout board starting at 0?

I could have SWORN that we had run a test to check for this yesterday, but apparently not.

I was 99.9% certain it had to be a programmer problem and (sheepish grin) I once again proved myself right.

Thanks for all the suggestions.
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
Reply With Quote
  #10   Spotlight this post!  
Unread 31-01-2009, 03:06
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: DIO not working in autonomous.

From your picture, the red dots at the inputs of your opens is the clue. Those are coercion dots, which means the data types didn't match, but LabVIEW took its best guess.

Those expect an enumerated type, but you wired them to a integer constant. The best way to get the enumerated type is the right click on the input and choose create constant. From there you can use the drop down menu to select which one you want (for example, DIO 1). When you do it that way, the numbering on the hardware and in LabVIEW match.
Reply With Quote
  #11   Spotlight this post!  
Unread 12-02-2009, 01:23
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
Re: DIO not working in autonomous.

Joe,
Thanks for the suggestion. This is yet another of those items where Labview will help you out, but we didn't know that it would or how to do it.
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera Code not Working in Autonomous? Mikesername Programming 6 28-01-2009 10:14
IR Board Not Working (But NOT Fried) itsme Electrical 2 18-02-2008 06:11
Help Autonomous code not working team550 Programming 5 14-01-2008 10:35
Camera not working in autonomous Roger Programming 9 09-03-2006 07:38
Gyro not working in Autonomous? kaszeta Programming 7 11-02-2006 01:28


All times are GMT -5. The time now is 21:09.

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