|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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). Last edited by kamocat : 10-04-2009 at 22:25. |
|
#3
|
||||
|
||||
|
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 =)
|
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
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 ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |