LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Monitoring Keyboard and Mouse Activity" example crash if PICkit3 is connected - fix

Hello, I discovered the example "Monitoring Keyboard and Mouse Activity" contains

in LabVIEW 2014 crash if PICKit3 programmer is connected to PC.

(if I use PICkit2 or the new model PICkit4  the code works...).

After some experiment I found a workaroud that seems to fix this problem-
I replaced the lvinput.dll (LabVIEW2014\resource) with the one
got from LabVIEW 2017 (may be other version are ok but I didn't tried).

It appears the 2014 version conflicts with the PICKIT driver (?)... I want to share this just in case someone experience similar problems. May be this can helps.

Ciao!

Mauro

0 Kudos
Message 1 of 3
(2,417 Views)

I wouldn't call it a crash if a LabVIEW function returns an error. A crash is usually when LabVIEW or any application posts a message to you that something bad has happened and only gives you the choice between quitting the application or exiting (Yes intentially meant to be a bit ironic. The default Windows crash dialog used to have two buttons that allowed you to acknowledge the crash, or cancel it, but the effect was in both cases the same, namely a full termination of your application).

 

What you observe is a problem of the lvinput driver getting messed up by the presence of the PicKit programmer which probably announces itself as a HID USB device with keyboard or mouse capabilities that it doesn't really support and when the lvinput driver then tries to query the device for its keyboard or mouse capabilities it encounters an unexpected error and just returns with a (very generic, the -200000008 number looks a lot like an error number chosen by the programmer in a place where he didn't really expect the called Windows API function to return any error) error code. Yes the function doesn't work so you can't really use it in your application but your application can simply continue to do everything else by properly handling (and possibly ignoring this error except for the parts where you try to use the keyboard or mouse functionality). If it would crash it would simply exit on you and an application could not continue at all.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 3
(2,321 Views)

I realize I was not very clear in my previous note...
Rolf, you are right, the VI returns an error but you cannot manage this because LabVIEW crash.

You cannot continue using the application.
See the screenshot. Using lvinput.dll from LV2017 everything works fine.

regards

Mauro

0 Kudos
Message 3 of 3
(2,308 Views)