ive been working on my labview xbox 360 controller just wanted to know if this will work
I would use a greater than or less comparison sub.vi than for your triggers. Your button code will not work because you have multiple pieces of code sending conflicting information to the robot. If you pressed a button to turn a relay on, other parts of your code will still be telling to be off. You can only have one going on at a time.
alright thanks ill make the corrections now
hows this and for the xbox control the value for the left trigger is 0 -1 and i couldn’t figure how two do that one because every time i deployed it an error message came up
Teleop3.vi (57.5 KB)
Teleop3.vi (57.5 KB)
As Owen mentioned, you should have only one Relay Set instead of the multitude that you’ve got now.
It needs restructuring along the line of this example where the values you want cascade through your button choices, but the Set happens only once at the end. Each of your Relay Cases gets replaced with a Select and the values you choose in your true and false cases.
how did you get the “off” constant
never mind i found it
Just Create->Constant on the input to the Relay Set, then copy and paste the constant wherever else you want to use it.
yea i found it i also have a question
what i wanted to do was if button 1 and button 2 are pressed at the same time a certain action happens and if only button one is pushed a different action happens with that code that you pasted says is if button 2 and 3 are pressed then the relay will run forwards and if only button 2 is pressed then it’ll run the relay reverse am i correct ? just to make sure i understand this ^.^
A little different:
- No button pressed = OFF
- Button 2 pressed = Reverse (unless Button 3 is pressed at the same time)
*]Button 3 pressed = Forward (it overrides button 2 if it is pressed at the same time)
Part of what it’s doing is saying which button wins if there are two commanding different actions.
what im trying to do is make like a “condition” per say. if button 5 is pressed relay 1 will move forward however if button 2 and button 5 are pressed relay 1 will move reverse
Just replace your button 5 with my button 2.
and your button 2 with my button 3, and you get exactly what you stated above.
if button [strike]5[/strike] 2 is pressed relay 1 will move forward however if button [strike]2[/strike] 3 and button [strike]5[/strike] 2 are pressed relay 1 will move reverse
alright now if i wanted two bring in another button to that same circumstance say button 6 then i would have if button 5 is pressed relay 1 will move reverse if button 5 and 2 is pressed then relay 1 will move forward now if button 6 is pressed relay 2 will move reverse and if button 2 and button 6 is pressed the relay 2 will move forward
using the same logic for circumstance 1 how will i wire the two outcomes of both circumstances two only one wiring point would io use a (and) function ?
Just have two separate decision trees for the two different relays.
Don’t try to combine them if they don’t have to be. That just makes the code confusing to understand.
yes yes it does thanks for the help

