Go to Post It's 9:00 Do you know where your bott is? - Michelle Celio [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-04-2009, 19:33
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Programming drivers station digital outputs

Hi,
We have been trying to set and reset the digital outputs on the cRio drivers station and have had very erratic results. We can do it in a simple vi but when we try to use it in our competition program, the output is unpredictable. Anyone know if there is an overseeing part of the program that we have to use to actually write valid information to the digital outputs?
Thanks in advance.

Steve

Last edited by Steve_Alaniz : 10-04-2009 at 19:33. Reason: spelling
  #2   Spotlight this post!  
Unread 10-04-2009, 20:13
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Programming drivers station digital outputs

Is there any chance it has something to do with the program running at a different rate?
The driver station only sends/receives data every 20ms.
(Alternately it could be due to a Front Panel control resetting to its default value)

EDIT:
I had misunderstood you, and thought it was running correctly in a temporary deployment, but not as a run-time startup. Execution rate may still be the problem, but in this case it would be that it's running too slow. I don't know whether the DS resets a digital output if it doesn't get a reply soon enough. Considering it's UDP, it's unlikely, but the best place for this code is in "periodic tasks" nonetheless (with a 20ms 'wait' function).
__________________
-- Marshal Horn

Last edited by kamocat : 10-04-2009 at 22:25.
  #3   Spotlight this post!  
Unread 10-04-2009, 20:38
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: Programming drivers station digital outputs

If you are using shift registers make sure there isn't a break in the lines at all, that'd be bad =)
__________________
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
  #4   Spotlight this post!  
Unread 11-04-2009, 22:53
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Programming drivers station digital outputs

Thanks for the suggestions. We found the problem(s)... The help definition of set digital output for the drivers station doesn't mention that you need to input using an array or you get conflicts because the unaddressed outputs are reset.
Additionally using the AND function with numbers returns the anded number. Even though it is a non zero, it will not correctly trigger TRUE for an IF statement. You have to use a "greater than zero" before feeding into the IF statement to get a proper decision from the statement.
This may be documented somewhere but I missed it. Anyway, that was the problem.

Steve
  #5   Spotlight this post!  
Unread 13-04-2009, 21:12
JasonF JasonF is offline
Registered User
FRC #2848 (The All Sparks)
Team Role: Programmer
 
Join Date: Apr 2009
Rookie Year: 2009
Location: Irving Texas
Posts: 24
JasonF is an unknown quantity at this point
Re: Programming drivers station digital outputs

Hey Mr. Alaniz
Figured I should make an account eventually.


To clarify, The problem was we were attempting to set the digital outputs on the driver station in 4 places within the same while loop. Our outputs on the front panel were flickering all over the place, and as I was working on it I realized we were writing 4 different arrays at the same time.

So In Summary, Use only one Set Digital Output per loop and control the Outputs (Hi/Lo) by building an array with 8 boolean elements.

An additional Note: While the Driver Station and almost everywhere else say Digital Output 1-8, for Array purposes 1 is 0 (So not 1-8, 0-7)

Maybe everyone here already knew that but that was news to me after working on it for a couple hours of head scratching
Closed Thread


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
drivers station digital input trouble finman Electrical 9 16-02-2009 08:06
Driver Station Digital Outputs Lafleur Programming 2 10-02-2009 10:50
Trouble Reading Drivers Station Digital Inputs Mike Mahar C/C++ 3 03-02-2009 23:37
Digital Outputs on the Driver Station with C/C++ Bongle C/C++ 6 26-01-2009 15:45
driver station digital outputs DustinB_3 FRC Control System 0 24-01-2009 11:29


All times are GMT -5. The time now is 02:01.

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