View Full Version : Programming Digital Inputs from Driver Station
spooncwru
25-01-2009, 14:08
Has anyone had success programming a digital input connected to the driver station? The "Get Digital Data" vi shown in the FRC Programming Guide doesn't seem to be in our updated version of Labview.
We tried the Get DI vi, and indexed the array, but we can't seem to make the connection work to anything that takes a boolean input.
Any tips?
KRibordy
25-01-2009, 17:57
I use windriver, but you might be having the same problem as I was. We had a push button switch (2 inputs) wired to the signal and ground inputs. The driver station doesn't have a "pull down" function, so the switch read 0 when pushed and output random numbers when not pushed. To fix this, you have to wire a 100k resistor between the signal and +5V connectors by the switch. Or, you can use a single pole double throw switch. Hope that helped.
Alan Anderson
25-01-2009, 19:46
We tried the Get DI vi, and indexed the array, but we can't seem to make the connection work to anything that takes a boolean input.
You said that it doesn't seem to work, which doesn't necessarily mean that it doesn't actually work. What are you expecting it to do? What does it do instead? As KRibordy pointed out, it might just be that your switch isn't wired properly to the DS pins.
spooncwru
28-01-2009, 07:20
We're trying to get a boolean return from the VI that's reading that switch.
RedOctober45
30-01-2009, 10:24
Try using the VI that actually is meant for the driver station.
Inside LabVIEW, right click and go to WPI Robotics Library->DriverStation->Get Digital Input.vi
Try that, that is what we use and it works. You have to use this Lib for any input on the driver station.
Have you read the update that instructs you to ground your grounds to the DS box itself?
I was having trouble getting the correct inputs from the Digital Inputs as well before I added resistors to my switch to elimate the sensitivity issue. I assume the update solves this problem but don't quote me on that.
Jranko311
30-01-2009, 23:58
We have not been fully able to test it, because we have not setup the pull-ups for the Digital Inputs. But I think the way you can program the DS in LabView is:
1. Grab the DS Get Digit Input Vi put it in the program.
2. Grab an Array to Cluster function, and put it to the right of the DS Get Digit Input Vi.
3. Wire the boolean array output of the DS Get Digit Input Vi to the input of the Array to Cluster function.
4. Grab an unbundle by name function, and put it to the right of the Array to Cluster function.
5. Wire the output of the Array to Cluster function to the unbundle by name function.
6. The outputs of the unbundle by name function are now boolean values, not a boolean array. The unbundle by name identifies, by name, the digit inputs.
Let me know if it works.
spooncwru
01-02-2009, 11:37
Update:
Thanks for the first tip about wiring the resister in. Once we did that, we connected it to our digital sidecar and it worked perfectly!
I just tried the tip about using the Driver Station-> Get Dig In VI, clustering the array and then unbundling it. For some reason, it always sends out True, even when my switch is off.
Anyone else experience this or have a fix?
Thanks to everyone for their help and suggestions!
Sean
spooncwru
01-02-2009, 13:14
Nevermind! Switch was installed backwards. We're all set. Thanks again to everyone!
Sean, Team 126
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.