LabVIEW

cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Reading USB joystick data directly from the USB port

I have made a program to read USB joystick data in Labview using the "initialize joystick vi" and "acquire input data vi". I noticed that these vi's use the data from windows XP. The joystick calibrating function of windows can influence the data that Labview shows. For instance: axis 1 uncalibrated data(before calibration in windows) 3901 to 32767. After calibration in windows Labview shows me data on the same axis ranging from -32767 to 32767.
Is it possible to read the data from the joystick before windows "messess" it up?
0 Kudos
Message 1 of 3
(5,774 Views)

USB protocols are a messy black hole.  The way each USB item communicates to the operating system is dependant on the products manufacturer.  I think that is why there are no USB functions built into LabVIEW.  Perhaps there is some way to force a calibration at the beginning of your code so that the data is consistent on each execution??? 

Also, if I remember right, there were some recent posts concerning reading a USB mouse that you could search for to get some ideas.

Good luck and please post a follow-up if you come up with a good solution. 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 3
(5,745 Views)
This might be possible because I think joysticks fall into the USB HID (Human Interface Class) and I believe there is a common protocol that these follow. Other HID devices are keyboards and mice. With these, you don't need a driver from the vendor. A good starting point would be http://www.usb.org/developers/hidpage/. If you can make sense out of this, then you might be able to create a driver with the VISA Driver Development Wizard and use the USB RAW functions in LabVIEW.
Message 3 of 3
(5,737 Views)