|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#28
|
||||
|
||||
|
Re: Labview Joystick Buttons...
EDIT 2 - I just went back and checked out a previous post which led me to the programming manual. (Which I havent read
... I'm more of a learn through experiance person) Anyways, using -1 and 1 may not work. But seeing as I don't have a way to test it I added on more to the bottom explaining how to do it so that it's at least in-line with the manual.Ok, maybe I jumped ahead and went a little too fast with my last example. Lets build on what you have and start with something simple. First off, I think it would be a good idea to clean up your code. When I'm testing things out I find it easier to test for one thing at a time to avoid clutter. I took your picture and marked some of the things I think you should take out in red. (The box with the question mark you could keep, I wasn't really sure what you were doing with it so I would just say delete it unless its important to you.) The blue box signifies what I want you to change. EDIT - And don't forget, for EVERY Open function you need a matching Close function. ![]() As a first step we'll set this up to go one way when the button is pressed and another way when then button is released (unpressed). In the blue box go ahead and get rid of the "boolean to num" function and instead add a case statement. To get that open up your palette and go to: Programming > Structures and select "Case Structure". In the True case of the case structure and a numerical constant (Function palette > Mathematics > Numeric and select "Numeric Constant") and enter in 1 as its value. Then click one of the little arrows next to where it says "True" on the case structure to switch it to the false case. In the false case add a numerical constant and enter in -1 as its value. Wire up both of the numeric constants to the right wall of the case structure and then wire the new tunnel output to the Set Relay function. Here's what it look like: (True case shown) ![]() (False case shown) ![]() Let me know how this works and then we can work from there. EDIT 2: In the blue box go ahead and get rid of the "boolean to num" function and instead add a case statement. To get that open up your palette and go to: Programming > Structures and select "Case Structure". In the True case of the case structure and a enum constant (Function palette > Mathematics > Numeric and select "Enum Constant") and enter in "Forward" as its value. Then click one of the little arrows next to where it says "True" on the case structure to switch it to the false case. In the false case add a enum constant and enter in "Reverse" as its value. Wire up both of the numeric constants to the right wall of the case structure and then wire the new tunnel output to the Set Relay function. Here's what it look like: (True case shown) http://img261.imageshack.us/img261/9...onhelp5if7.gif (False case shown) http://img504.imageshack.us/img504/8...onhelp4kk1.gif (^^^ There's a max amount of images per post, so I linked these instead) - Austin Last edited by TotalChaos : 18-01-2009 at 19:29. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do you program joystick buttons in LabVIEW? | darkpheonix | NI LabVIEW | 10 | 13-04-2014 10:20 |
| Buttons on a Attack 3 Joystick useing LABView | morg102 | NI LabVIEW | 14 | 02-02-2010 23:28 |
| buttons in LabView | Pneumaticsman | NI LabVIEW | 4 | 12-01-2009 18:14 |
| Buttons to Pins on Joystick | yarb65 | Electrical | 1 | 24-08-2007 20:39 |
| Assigning Joystick buttons.... | archiver | 2001 | 5 | 24-06-2002 00:59 |