LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use a xbox360 controller in labview 7?

So I've just been given a project in my research lab..

 

We have to control a gantry arm using labview.  The gantry control is already completely written out in labview using a datasocket server.  However, I've never worked with Labview before.  All I know is that it takes in a number as a velocity and it moves the arm according to that velocity.  What I have to do is use the xbox 360 controller to input that number (a velocity), as well as calibrate it.  If possible, using the mangitude of the joystick angle to input a different velocity.

 

How would I go about doing this?  I hav einstalled all the necessary software to talk to the controller, but I don't know how to set it up in Labview.

 

Also, Windows XP sees it as a game controller, if that makes any difference.

Message Edited by ShadowGray on 08-13-2008 10:56 AM
0 Kudos
Message 1 of 8
(3,697 Views)
This question has come up before. Most of the solutions seem to be centered around using the standard input device functions that come with LabVIEW.
0 Kudos
Message 2 of 8
(3,691 Views)

I looked through the other thread and the sample vi; it did not actually do anything.

 

I have done the query input device, but how do I get it so that a certain button outputs a message, for example?

0 Kudos
Message 3 of 8
(3,688 Views)
I'm not sure which sample you're referring to since the link I provided was to a list of search results, and not to a specific thread. But, to answer your question you would need a loop in which you monitor the input device to see if there's been a new input. The input device VIs are not event-driven so you have to perform a polling mechanism.
0 Kudos
Message 4 of 8
(3,683 Views)

Ok well I'm using the Joystick Acquire Data vi to take in the input from the joystick, but how do I link that to something else?  I want to link the joystick to a fill slide indicator, but when I try to wire the axis info to the slide, it gives me an error:

 

"The type of the source is a cluster of 8 elements."

"The type of the sink is double [64-bit real (~15 digit precision)]"

 

Or in other words, how do I extract data from the input device?

0 Kudos
Message 5 of 8
(3,658 Views)

You cannot connect those two nodes directly because they're different datatypes, as the message indicates. The axis info contains 8 elements. Thus, you have to pick the one that applies to you and unbundle it from the cluster. For example:

 

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

 

Message Edited by smercurio_fc on 08-13-2008 01:08 PM
0 Kudos
Message 6 of 8
(3,651 Views)

Well, we did some more work into it.

 

We are getting the data off of the  Acquire input vi and saving it to a variable.    The problem is that using that joystick vi requires a dll file which is not compiling on the SCB-68 FPGA, which actually controls the arm.  What is the problem and is there any way to circumvent it?

 

Another idea that was brought up was to run two labview vi's synchronously, one in windows and the other on the FPGA, and have them talk to each other, but that does not seem to be possible, at least to my knowledge.

 

The error message:

Failed to load shared library lvinput.dll on RT target device.

Message Edited by ShadowGray on 08-13-2008 05:12 PM
0 Kudos
Message 7 of 8
(3,630 Views)

Hi ShadowGray,

 

You cannot use any Input Device Control VIs on the FPGA.  These VIs can only be executed on the Windows or Linux operating system. 

 

Since you said that you have an SCB-68 FPGA,  I assume that you're using the SCB-68 connector block with a 78xxR series FPGA DAQ card.  If this is the case, is the card in a real-time machine or in a computer running Windows?  If the card is in a real-time machine (runs a real-time operating system), you'll have to communicate from the host side to the real-time side via the network.  Otherwise, you can simply use FPGA I/O nodes.  Either way, we'll actually need to pursue your second idea.  One VI will run on the host side (Windows) and continuously receive user input.  The other VI will run on the FPGA side and manipulate the gantry arm based upon the input it receives from the host.  Examples of how the two sides communicate can be found in the LabVIEW Example Finder » Hardware Input and Output » R Series » Basic IO. 

 

I know this explanation was pretty high-level, so ask away if you still have questions!
0 Kudos
Message 8 of 8
(3,594 Views)