|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
is there anyway to take a joystick button and run it through a vi where it will do one function. Then go through some switch and do another function? Is there some sort of "switch" vi?
|
|
#2
|
||||
|
||||
|
Re: Labview toggle switch
Quote:
I'm not sure there is one specific VI that does what you want, but it would certainly be possible. If I'm understanding you correctly you want a button that when pressed switches from doing one thing to another and doesn't change until the button is pressed again. If that is what you mean then you could check out the VI attached as an example of one way to do this. There is documentation of what I did on the block diagram in the VI. - Austin |
|
#3
|
|||
|
|||
|
Re: Labview toggle switch
Here's what I wrote to solve that problem. toggle2.vi is a subvi that takes one input - a boolean value of whether or not the non-toggle switch is pressed. When it detects a change from 0 to 1 or from 1 to 0, it toggles the output. It does this by storing the previous input.
-jonathan Pigmice Team 2733 |
|
#4
|
||||
|
||||
|
Re: Labview toggle switch
Attached is a little code that implements this. As with every programming language this is one of about 100 ways of doing this...
Let me know if you have questions about how this works. Cheers, Mark |
|
#5
|
||||
|
||||
|
Re: Labview toggle switch
Opps I noticed a mistake in my attached code. This attachment has is correct.
|
|
#6
|
||||
|
||||
|
Re: Labview toggle switch
Quote:
|
|
#7
|
||||
|
||||
|
Re: Labview toggle switch
Quote:
|
|
#8
|
||||
|
||||
|
Re: Labview toggle switch
That actually wouldn't work, because you would need to put the "enum" to your driver station, which is against the rules. You need a toggle switch, so that when you hit the button once, it will initiate something, but when you release the button (causing the boolean to read "false") that same function will stay initiated until you hit the button again...
|
|
#9
|
|||
|
|||
|
Re: Labview toggle switch
Bit funny, it's been 2 years since I was part of this and I had totally forgotten about this message board until I got an email notification about a thread response.
You generally should let old threads (3+ months?) die a natural death. I'm not certain how much has changed, but all this info *was* accurate as of '09. Bringing threads like this to the top of the list just serves to confuse people with old information. It is known as "necroing" and is widely frowned upon. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help Wiring Micro Switch/Limiting Switch | Windward | Electrical | 2 | 07-02-2006 18:26 |
| toggle switch | Windward | Programming | 31 | 27-01-2006 22:38 |
| Toggle switch with pneumatic | The yellowdart | Programming | 2 | 21-02-2005 14:08 |
| Pneumatics on a toggle switch | Idaman323 | Programming | 3 | 15-02-2005 18:42 |
| 3 way toggle switch programming | LeadRiccardoT | Programming | 3 | 17-02-2003 02:02 |