Showing results for 
Search instead for 
Did you mean: 

Refreshing labview dll calls

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:


Is joystick on?

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?



0 Kudos
Message 1 of 18

Hello Sidd_Sood,


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.


How the Xbox One Controller Has Changed


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!


Xbox One Controller FAQ

National Instruments Applications Engineer
0 Kudos
Message 2 of 18

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.



0 Kudos
Message 3 of 18

Ok, I figured it out. I just had to unload the dll that I was using to check the input devices:


It works now

0 Kudos
Message 4 of 18

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.

National Instruments Applications Engineer
0 Kudos
Message 5 of 18

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' 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? 🙂

0 Kudos
Message 6 of 18

Hello Sidd_Sood,


Although the crash occurs when you press the stop button on your joystick, it seems like the crash could be caused by the Query joystick I have included a National Instruments KnowledgeBase below that could assist you in your troubleshooting endeavors.


Why Does LabVIEW Crash When I Call My DLL?


I hope this helps!

National Instruments Applications Engineer
0 Kudos
Message 7 of 18

Thanks Gabby,


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. 


0 Kudos
Message 8 of 18

Hello Sidd_Sood,


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.



National Instruments Applications Engineer
0 Kudos
Message 9 of 18

crash report.png


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,


0 Kudos
Message 10 of 18