Go to Post "THAT'S NOT SAFE!" "But I'm wearing safety goggles!" - Samheartsrobots [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 22-01-2009, 17:24
GunfighterJ's Avatar
GunfighterJ GunfighterJ is offline
Registered User
AKA: Joseph
FRC #2450 (RaiderBots)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Minnesota
Posts: 34
GunfighterJ is an unknown quantity at this point
Question Labview toggle switch

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?
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2009, 17:46
TotalChaos's Avatar
TotalChaos TotalChaos is offline
Registered User
AKA: Austin
FRC #2837 (Freebird Robotics)
Team Role: College Student
 
Join Date: Apr 2008
Rookie Year: 2006
Location: Gilbert AZ
Posts: 112
TotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud of
Send a message via MSN to TotalChaos
Re: Labview toggle switch

Quote:
Originally Posted by GunfighterJ View Post
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?
The short answer is yes.

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
Attached Files
File Type: vi Basic Robot Main.vi (94.0 KB, 1095 views)
__________________
The 39th Aero Squadron - Team 39! (Visit our website!)
Team Role: 3 Years as Driver - College Student/Mentor!


Freebird Robotics - On a 1 year hiatus! (Visit our website!)
Arizona 2009: Semifinalists! (69 and 498), Delphi "Driving Tomorrow's Technology" Award
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2009, 02:31
s0crates s0crates is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Australia
Posts: 52
s0crates is on a distinguished road
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
Attached Files
File Type: vi toggle2.vi (9.0 KB, 1334 views)
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2009, 14:45
BLAQmx's Avatar
BLAQmx BLAQmx is offline
Software Engineer
no team (National Instruments)
Team Role: Engineer
 
Join Date: Sep 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 100
BLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of light
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
Attached Files
File Type: vi Joystick Button toggle.vi (16.3 KB, 789 views)
__________________
NI FIRST Community: Where to go for LabVIEW, Wind River, cRIO-FRC, and NXT support.
Reply With Quote
  #5   Spotlight this post!  
Unread 23-01-2009, 14:49
BLAQmx's Avatar
BLAQmx BLAQmx is offline
Software Engineer
no team (National Instruments)
Team Role: Engineer
 
Join Date: Sep 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 100
BLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of light
Re: Labview toggle switch

Opps I noticed a mistake in my attached code. This attachment has is correct.
Attached Files
File Type: vi Joystick Button toggle2.vi (17.5 KB, 874 views)
__________________
NI FIRST Community: Where to go for LabVIEW, Wind River, cRIO-FRC, and NXT support.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2009, 12:14
GunfighterJ's Avatar
GunfighterJ GunfighterJ is offline
Registered User
AKA: Joseph
FRC #2450 (RaiderBots)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Minnesota
Posts: 34
GunfighterJ is an unknown quantity at this point
Re: Labview toggle switch

Quote:
Originally Posted by TotalChaos View Post
The short answer is yes.

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
That looks complicated. But I think I can work that in to our code. Thanks for the help.
Reply With Quote
  #7   Spotlight this post!  
Unread 07-02-2009, 12:48
GunfighterJ's Avatar
GunfighterJ GunfighterJ is offline
Registered User
AKA: Joseph
FRC #2450 (RaiderBots)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Minnesota
Posts: 34
GunfighterJ is an unknown quantity at this point
Re: Labview toggle switch

Quote:
Originally Posted by TotalChaos View Post
The short answer is yes.

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
That looks complicated. But I think I can work that in to our code. Thanks for the help.
Reply With Quote
  #8   Spotlight this post!  
Unread 13-02-2011, 11:53
Seth Moulton's Avatar
Seth Moulton Seth Moulton is offline
iTzS∃th
AKA: Seth
FRC #0134 (Pembroke Spartans)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Boscawen, New Hampshire
Posts: 3
Seth Moulton is an unknown quantity at this point
Send a message via AIM to Seth Moulton
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...
Reply With Quote
  #9   Spotlight this post!  
Unread 13-02-2011, 18:03
s0crates s0crates is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Australia
Posts: 52
s0crates is on a distinguished road
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 21:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi