Example Code

Xbox Control UI

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview
This example reads the buttons presses of the Xbox 360 controller connected.
Description
LabVIEW has a palette called "Input Device Control" inside this palette we can read value from the PC's mouse, keyboard or a joystick. the driver for the Xbox 360 controller allows it to be recognized as a joystick. This example has an image laid on the front panel and Boolean LEDs which would be lit when various buttons where pressed.
Requirements

  • LabVIEW 2012 (or compatible), Xbox 360 Controller, Xbox 360 drivers


Steps to Implement or Execute Code

  1. Connect Xbox 360 controller
  2. Open " Xbox Control 2012 NIVerified.vi"
  3. Run the program

 

Additional Information or References
VI Block Diagram

 undefined

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Kevin R
Applications Engineer
National Instruments UK&Ireland

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
damirce
Member
Member
on

Dear developers, I have problem with mention Joypad. First I was using MotionJoypad and with PS3. Emulation is ok. In LabView is working everything ok until now. I put USB in the same dongle, I can see in control panel axis moving.. Also I was buy wireless original XBox controller but no input detection inside example of Labview 2013.

dev. index is changed... I was try all..   OS is Win8.1 , LabView 2013 32 bit

damirce
Member
Member
on

How to change or add new driver inside system,... ctl from begining, I did not change anything.. Software from Microsoft works for original and emulated Joypad, I can start OSD status and green LED are on up left and up right. Emulation ok... but aplication inside LabView dont see device..

damirce
Member
Member
on

When I was install toolbox from LVH everything working ok.

I fix the problem.

Julian28
Member
Member
on

Tank you very much, this VI is very usefull 

mattkreuz
Member
Member
on

i have windows 10, cant download required driver

richard77
Member
Member
on

damicre:

plis can you help me with the problem, bacause I have conected the xbox controller but labview doesn´t reconized it

Bin2022
Member
Member
on

I tried many examples, but even both (https://forums.ni.com/t5/Example-Code/Xbox-Control-UI/ta-p/3525774) and (https://forums.ni.com/t5/Example-Code/Xbox-360-LabVIEW-Interface/ta-p/3498186) not work.

I found my joystick worked in an online test (https://gamepad-tester.com), so the problem comes from the Labview driver or app. 

Later I tried the following and then the above codes worked, for reasons unknown.

(1) I download the compatible Labview VISA driver (refer to https://www.ni.com/en-us/support/documentation/compatibility/16/ni-visa-and-labview-version-compatib...

(2) I assigned 2 rather than 0 to the device index to the Initialize Joystick VI.

Tariff Impact Update Learn more