Go to Post Having someone with as much mainstream appeal as will.i.am is a great strategy to draw large amounts of attention to a program that has been relatively hidden to the masses. - Karthik [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
  #31   Spotlight this post!  
Unread 18-01-2009, 19:04
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 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
__________________
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

Last edited by TotalChaos : 18-01-2009 at 19:29.
Reply With Quote
  #32   Spotlight this post!  
Unread 19-01-2009, 08:33
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Labview Joystick Buttons...

If the case with two constants works for you, then may I suggest looking at the ternary assignment -- a fancy name for the ? : operator in C. It is actually called the Select operator. LV puts it in the Comparison palette, and it is handy for selecting one of two values without the space and hidden constant of the case structure.

Of course this is just for readability, it is equivalent at runtime.
Greg McKaskle
Reply With Quote
  #33   Spotlight this post!  
Unread 20-01-2009, 17:25
domoarigato's Avatar
domoarigato domoarigato is offline
Team #1208 CCO
AKA: Coony
FRC #1208 (Metool Brigade)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: O'Fallon, Il
Posts: 32
domoarigato is an unknown quantity at this point
Re: Labview Joystick Buttons...

...Yeah.... okay... Trying to program the joysticks' buttons... More specifically, trying to get a spike/relay to be able to be controlled by a button. (Forward/Reverse would be nice for one, Forward/Neutral/Reverse for the other) so I've looked at just about every tutorial/help guide thing that I could find... At the moment, we have two spikes on our electrical board, one of which, when attached to any of the DIO things it will stay a constant red (reverse) which does run a motor, albeit all the time and only in reverse. Code-wise, here's what I have so far (In attachments). [In the inner-most case structure, the false case is set to a constant of 'Reverse' as I believe you have said to do. Also tried 1 and -1, but to no avail.] Any help or advice would be greatly appreciated. Thank you~
Attached Thumbnails
Click image for larger version

Name:	main.jpg
Views:	146
Size:	93.1 KB
ID:	7184  
Reply With Quote
  #34   Spotlight this post!  
Unread 28-01-2009, 23:04
IceStorm IceStorm is offline
Mentor FRC 5046, FTC 8688
AKA: Chad
FRC #5046 (Jacked Up Jackets)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Michigan
Posts: 134
IceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of light
Send a message via AIM to IceStorm Send a message via Yahoo to IceStorm
Re: Labview Joystick Buttons...

Were trying to do something very similar but with out the relay.

We want to have a button that on one press it turns on our traction control code, and when you press the button again it turns off our traction control code and turns on our manual speed control code. we have our two pieces of code in a case structure where true is traction control and false is manual speed control. we then wired this to a joystick button and it works other than you have to continue to hold the button down to get it to stay engaged.

is there an easy way to make the joystick buttons into on/off buttons rather than momentary buttons.
Reply With Quote
  #35   Spotlight this post!  
Unread 28-01-2009, 23:18
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 Joystick Buttons...

Quote:
Originally Posted by IceStorm View Post
is there an easy way to make the joystick buttons into on/off buttons rather than momentary buttons.
So it sounds like you're trying to turn it into a button that toggles from on to off (and the other way around) when you press it? If so you can check out the VI posted in THIS THREAD. (I know you said you don't want to use relays, but it will give a a general direction as far as how to set up the case structures)

- Austin
__________________
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
  #36   Spotlight this post!  
Unread 29-01-2009, 10:08
IceStorm IceStorm is offline
Mentor FRC 5046, FTC 8688
AKA: Chad
FRC #5046 (Jacked Up Jackets)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Michigan
Posts: 134
IceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of light
Send a message via AIM to IceStorm Send a message via Yahoo to IceStorm
Re: Labview Joystick Buttons...

TotalChaos,

Yup. That is exactly what we are trying to do. we want to take the momentary button and make it a toggle. i opened that vi and it looks like what i need i just need to pull out the extra items for the buttons 2 and 3.

Thanks.
Reply With Quote
  #37   Spotlight this post!  
Unread 17-02-2009, 19:23
chinckley chinckley is offline
Winner 2009 West Michigan District
FRC #1254 (Entropy)
Team Role: Teacher
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Lawrence, Michigan
Posts: 204
chinckley is a name known to allchinckley is a name known to allchinckley is a name known to allchinckley is a name known to allchinckley is a name known to allchinckley is a name known to all
Re: Labview Joystick Buttons...

Quote:
Originally Posted by TotalChaos View Post
I know it's a little late, but here's my crudely done diagram:


(Sorry, I did it in paint without a mouse )

Give me about 15 minutes or so and I'll get a picture of some way to hook a motor to a button. (It might not be the best way, but I do know a way)

- Austin
Thanks Austin. That answers a very large question for us!!!!!!!
__________________
2009 West Michigan District Winner
Thanks to Team 216 and Team 1918

2009 Traverse City Semifinalist
Thanks to Team 1596 and Team 47
2009 Traverse City UL Safety Award Winners

Attending 2009: West Michigan, Traverse City, & State
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
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


All times are GMT -5. The time now is 03:45.

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