So I'm using an xbox one controller with labview. So far I've gotten it to work just fine. But I'm trying to implement a utility which would allow me to switch to keyboard input in case the xbox controller gets unpaired/turned off. I'm polling the following function in a while loop to see if the controller is on or off:
This works fine if I turn on the controller before I run the polling program but if I now turn it off in mid use, the query input devices. vi does not update. That is it keeps showing that the device is connected. The only way to detect that the device is not present anymore is to abort the program and run it again.
What am I missing here?
Is the Xbox controller that you are using a wireless controller, or is it connected to your console via a cable?
If the controller is wireless, there could be issues involved because the communication protocol used with Xbox One’s wireless controllers is proprietary, as described in the article provided below.
It seems like more people have experienced this issue after searching it online. I think you might have more success posting your question in the LabVIEW MakerHub. There is a specific page for Xbox Controller FAQ. I hope this helps!
Thanks for the reply ican'tBerrPuns. So I tried to use the xbox one toolkit on the makerhub but I ran into the same issues with it that I was running into before.
If I turn off the xbox one controller while running this vi, the status does not update until I close the Vi and re-run it.
Great! I am glad you were able to resolve your issue yourself! Hopefully other people will be able to see what you have done to help them troubleshoot a similar problem if they experience it.
Ok, it updates when I unpair the controller, but now the program keeps crashing when i hit the stop button on the while loop. I made a new vi called query joystick devices, which unloads the dll after it's read the controllers that are connected and I'm polling this vi using 'joystick poller.vi' The poller runs fine and updates when the controller is unpaired until I hit the stop button on the front panel which causes it to crash immediately
I've tried a whole bunch of things, but to no avail. Help? 🙂
Although the crash occurs when you press the stop button on your joystick poller.vi, it seems like the crash could be caused by the Query joystick Devices.vi. I have included a National Instruments KnowledgeBase below that could assist you in your troubleshooting endeavors.
Unfortunately this hasnt helped, and I still havent been able to fix this problem. I've tried numerous settings in the call setup but they all cause the vi to crash. It works as long as it is running, but crashes when I stop the loop.
Could you possibly reproduce the LabVIEW crash that you originally experienced and then choose to send the report to NI? Once you do so, please let me know what the Report ID is (attaching an image of the LabVIEW Crash Reporter like you originally did will suffice). At that point I will be able to look at the crash report and see if there is any information that points to what could have caused the crash. If you have changed your VI’s since you posted them to this forum, please also include them in the crash report.
Here you go. I havent changed anything in the code. All variations of the settings in the dll calling subvi causes a crash.
I've tried the following things additionally which have not worked,
- calling the subvi via a reference and then unloading the vi at the end of the call
- Putting a request deallocation block in my parent code.
I also attached the code with this report although it doesnt show it in this picture
Thanks again for looking into this,