Discussion:
How do I use a xbox360 controller in labview 7?
(too old to reply)
ShadowGray
2008-08-13 16:10:05 UTC
Permalink
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
smercurio_fc
2008-08-13 16:10:08 UTC
Permalink
This question has come up <a href="http://forums.ni.com/ni/search?board_id=170&amp;submitted=true&amp;q=xbox+360" target="_blank">before</a>. Most of the solutions seem to be centered around using the standard input device functions that come with LabVIEW.
ShadowGray
2008-08-13 16:40:05 UTC
Permalink
I looked through the other thread and the sample vi; it did not actually do anything.&nbsp;I have done the query input device, but how do I get it so that a certain button outputs a message, for example?
smercurio_fc
2008-08-13 16:40:07 UTC
Permalink
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.
ShadowGray
2008-08-13 18:10:09 UTC
Permalink
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?&nbsp; 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:&nbsp;&quot;The type of the source is a cluster of 8 elements.&quot;&quot;The type of the sink is double [64-bit real (~15 digit precision)]&quot;&nbsp;Or in other words, how do I extract data from the input device?
smercurio_fc
2008-08-13 18:10:10 UTC
Permalink
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:&nbsp;<img src="Loading Image..." border="0"> 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 <a href="http://zone.ni.com/devzone/cda/tut/p/id/5054" target="_blank">Learning Center</a> which provides links to other materials and other tutorials. You can also take the <a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank">online courses</a> for free. &nbsp;Message Edited by smercurio_fc on 08-13-2008 01:08 PM


Example_VI_BD.png:
http://forums.ni.com/ni/attachments/ni/170/349075/1/Example_VI_BD.png
ShadowGray
2008-08-13 22:10:06 UTC
Permalink
Well, we did some more work into it.&nbsp;We are getting the data off of the&nbsp; Acquire input vi and saving it to a variable.&nbsp;&nbsp;&nbsp; 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.&nbsp; What is the problem and is there any way to circumvent it?&nbsp;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.
Pakman
2008-08-15 14:10:05 UTC
Permalink
Hi ShadowGray,&nbsp;You cannot use any Input Device Control
VIs on the FPGA.&nbsp; These VIs can only be executed on the Windows or
Linux operating system.&nbsp; &nbsp;Since you said that you have
an SCB-68 FPGA,&nbsp; I assume that you're using the SCB-68 connector block
with a 78xxR series FPGA DAQ card.&nbsp; If this is the case, is the card in
a real-time machine or in a computer running Windows?&nbsp; 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.&nbsp; Otherwise, you can simply use FPGA I/O nodes.&nbsp; Either way,
we'll actually need to pursue your second idea.&nbsp; One VI will run on the
host side (Windows) and continuously receive user input.&nbsp; The other VI
will run on the FPGA side and manipulate the gantry arm based upon the
input it receives from the host.&nbsp; Examples of how the two sides
communicate can be found in the LabVIEW Example Finder &raquo; Hardware Input
and Output &raquo; R Series &raquo; Basic IO.&nbsp; &nbsp;I know this explanation was pretty high-level, so ask away if you still have questions!
Loading...