Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Labview Joystick Buttons... (http://www.chiefdelphi.com/forums/showthread.php?t=72304)

team877 17-01-2009 16:58

Labview Joystick Buttons...
 
Hi can someone give me a printscreen of the diagrams in labview to make the joystick buttons work with....lets say a relay. I have a good start but I need some reference to complete what i've started

Thanks
Team 877

Booksy 17-01-2009 17:05

Re: Labview Joystick Buttons...
 
Well, I'm on a mac right now but I can give you an explanation.

if I recall correctly, you need to use joystick->get raw data
It gives you an array, if you unbundle by name I think you can access the proper buttons. The unbundle functions can be found under the array section, if you do a right click. Hope you can figure it out from that.

If someone is in their dev environment, please post an image or feel free to correct me.

TotalChaos 17-01-2009 17:18

Re: Labview Joystick Buttons...
 
As a start you can check out my post in THIS THREAD.

It's not a full reference, but its a bit. I'll see if I can get a better screenshot for you.

- Austin

team877 17-01-2009 17:19

Re: Labview Joystick Buttons...
 
i have all that, but some of the concepts i don't understand are which axis does what??? and how do i know that button 1 on my unbundle program is actually working there are too many things i don't understand at this point. also do you have a layout of which button 1-12 goes with what button on the controller?

TotalChaos 17-01-2009 17:35

Re: Labview Joystick Buttons...
 
I don't have a picture handy or know for certain if all of the buttons match up off the top of my head.

However, while I look for one there is a way you can find out for yourself.

Instead of sending the data to the unbundle function (or I guess you could just have a second wire), right click on the data output of the "Get" VI and select: Create > Indicator. This should put an indicator with labels on you front panel that shows all of the outputs of the joystick. You cam just press the button and see which one lights up on the front panel.

In the meantime I'll keep looking for a full example of what you're looking for.

Hope that helps!

- Austin

Mikesername 17-01-2009 17:35

Re: Labview Joystick Buttons...
 
Quote:

Originally Posted by team877 (Post 802618)
i have all that, but some of the concepts i don't understand are which axis does what??? and how do i know that button 1 on my unbundle program is actually working there are too many things i don't understand at this point. also do you have a layout of which button 1-12 goes with what button on the controller?

Yea this is where I'm confused also.

edit: oops... posted while austin was :P

I'll try austin's and reply...

edit2: I tried austin's technique and I got the buttons in the front panel, but apparently I can't wire out of the buttons indicator...

team877 17-01-2009 17:54

Re: Labview Joystick Buttons...
 
yeah i can now get a relay to work off my axis....but not off a button. It's as if I can't wire a button anywhere to send the signal to the robot saying engage relay with button 1

The Megan 2207 17-01-2009 17:58

Re: Labview Joystick Buttons...
 
Quote:

Originally Posted by team877 (Post 802618)
i have all that, but some of the concepts i don't understand are which axis does what??? and how do i know that button 1 on my unbundle program is actually working there are too many things i don't understand at this point. also do you have a layout of which button 1-12 goes with what button on the controller?

I was working with this today and I found out that (on the joysticks that came with the KoP) axis 1 is the x-axis, axis 2 is the y-axis, and axis 3 is the throttle (the dial at the base of the joystick). As for the buttions, I know they're numbered but I'm not sure if those numbers match the button numbers in Labview. I do know that button 1 is the trigger, though. I hope that helps!

Mikesername 17-01-2009 18:02

Re: Labview Joystick Buttons...
 
Quote:

Originally Posted by The Megan 2207 (Post 802659)
I was working with this today and I found out that (on the joysticks that came with the KoP) axis 1 is the x-axis, axis 2 is the y-axis, and axis 3 is the throttle (the dial at the base of the joystick). As for the buttions, I know they're numbered but I'm not sure if those numbers match the button numbers in Labview. I do know that button 1 is the trigger, though. I hope that helps!


That did help as the trigger is wxactly what I was looking for.. don't know about OP tho...

However, I still can't figure out how to wire the button out to say, a motor, so that when that button is pressed it activates that motor... well wait.. with what I had before (where the buttons are put in the front panel) it wouldn't let me wire out... but when I do the actual buttons it does... I'm not making sense, am I.

team877 17-01-2009 18:06

Re: Labview Joystick Buttons...
 
I'm having the same problem....

TotalChaos 17-01-2009 18:09

Re: Labview Joystick Buttons...
 
I know it's a little late, but here's my crudely done diagram:


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

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

The Megan 2207 17-01-2009 18:12

Re: Labview Joystick Buttons...
 
I had it wired to a servo, but I'm sure it wouldn't be too much different to wire it to a motor. I don't remember exactly how I did it right now, but I can figure it out once I install Labview onto this computer. It might take half an hour or so...

Mikesername 17-01-2009 18:18

Re: Labview Joystick Buttons...
 
Quote:

Originally Posted by team877 (Post 802668)
I'm having the same problem....

The diagram helped... but let's say we want the trigger to link to the "drive close" vi... wiring that gives an error that you can't wire boolean into that.

team877 17-01-2009 18:47

Re: Labview Joystick Buttons...
 
i'm waiting for that button diagram haha

TotalChaos 17-01-2009 18:59

Re: Labview Joystick Buttons...
 
Ok, here we go.

I have two examples.

One is of the standard code altered so that pressing Button 1 would simulate moving the joystick to one side of the x-axis:



This next example get rid of the standard drive code completely and replaces it with a system in which Button 4 and Button 5 contol a left and right motors (respectively) to either on or off. (So like on our practice base, Button 4 would turn one side when pressed, Button 5 the other):



Ok, so as you've probably noticed, the key is this little guy:


This function converts a boolean value to a numerical value, 0 or 1 (0 false, true 1) It can be found by opening the functions palette and going to: Programming > Boolean and selecting "Boolean To (0,1)".

I think that's what you guys are looking for. If you have any more question just ask!

Good Luck!

- Austin

[EDIT] - And sorry it took me so long, I was needed elsewhere to help with cutting some stuff :P )


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

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