LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Refreshing labview dll calls

I was able to prevent a crash (or even an error being thrown) by running error wires through certain parts of the code.  I've attached pictures of the resultant VIs.  

 

Another fix to the problem was to remove the "Not a path constant" from the Query Joystick Devices VI, which removed some functionality but eliminated the crash.  Give these a try and I'll look into some more specific details about what is actually causing LabVIEW to crash when the VIs are in their current configuration.   

Matt | NI Systems Engineering
Download All
0 Kudos
Message 11 of 18
(1,818 Views)

Thanks for looking into this luda.mattski. I can confirm that the change you made in query joystick devices prevent the vi from crashing. In this configuration, the vi is very similar to the built in vis (called query input devices.vi) that labview comes with. However, the issue with this vi is that labview pretty much locks lvinput.dll which prevents it from reading any changes that were made to the state of the controller once the program is running. which is why I was trying to unload the dll after every call so that the program responds to the state of the controller at all times.  

 

I followed the approach that I found in an NI article here for unloading dlls

 

http://digital.ni.com/public.nsf/allkb/77594203D78D12278625729100758BE5

 

Which is why I wired not a path constant to the dll call..

 

However, I havent tried routing the error wires yet, I'll give that a shot

 

Thanks,

Sid

0 Kudos
Message 12 of 18
(1,796 Views)

Hi Sidd_Sood,

 

I am having the same issue you described. Unfortunately, your code is not working for me. Meaning theat it is running and finding the Joystick but shows the same behaviour than the built-in Query Input Devices.vi: The list of connected joysticks is not updated (when the controller disconnects or reconnects).

 

Did you do any further steps? Which LV version are you running? I am on LV 2014.

0 Kudos
Message 13 of 18
(1,669 Views)

Hi ehrlich,

 

Please create a new post on the forums with more information on your errors to have your issue receive more visibility. Posting replies on older posts typically does not receive as much attention.

 

Josh S.

Applications Engineer

National Instruments

0 Kudos
Message 14 of 18
(1,648 Views)

Was  this issue ever resolved or a new thread posted. im having the same issue.

0 Kudos
Message 15 of 18
(1,356 Views)

Hi,

not really but I found a workaround that was fine for me. See this thread. For the XBox controller, I ended up using another API provided by Windows.

If you were asking for the DLL calls, in the same thread some people managed to get it working by placing the DLL in a Sub VI which is called dynamically.

0 Kudos
Message 16 of 18
(1,337 Views)

Thanks for replying ehrlich. However, I am using a regular, logitech controller and i want to be able to poll to see of the controller is connected or not in order to use the mouse if necessary. Any suggestions? 

0 Kudos
Message 17 of 18
(1,331 Views)

Not really. Maybe Logitech has its own DLL or Windows offers another API to access joysticks and gamepads in general? Something like DirectInput? But I ha no real experience there.

0 Kudos
Message 18 of 18
(1,324 Views)