11-21-2021 11:46 AM
I am using a wireless mouse of logitech. it is connected to my laptop through usb dongle. it is a HID, I want to connect and Disconnect it using labview.
11-21-2021 05:15 PM
I don't have a straight answer but general guidance for approaching such problems.
#1 and #2 are the same irrespective of any programming language, whether C, C++, Python, C#, LabVIEW, MATLAB etc., this is because these are programming languages and they do not need to do the functionalities of an OS, some might have an easy way to control some OS functionalities (provided the OS has a way) and many don't.
This should help you for some time until you get a more concrete answer from fellow users.
11-21-2021 11:29 PM
This link might help you.
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-blockinput
11-22-2021 02:26 AM
The likely most easy way to do ths is to call devcon.exe through SystemExec in LabVIEW.
https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon
Devcon is an utility that lets you do pretty much everything that you can also do in the device manager through the command line interface.
11-23-2021 12:02 AM
Hi Rolf,
Thank you for your help and replying me.
To use DEVCON I need to have WDK and visual studio.
Could u please suggest a solution which uses the DLL file and its function to do the same in LABVIEW.
Thank You
11-23-2021 12:04 AM
Hi Kartik,
Thank you for replying me
Kartik, Blockinput function will block my all inputs. I want only a particular mouse to block in LABVIEW.
Thank You
11-23-2021 03:07 AM
@SatishKV wrote:
To use DEVCON I need to have WDK and visual studio.
Could u please suggest a solution which uses the DLL file and its function to do the same in LABVIEW.
Thank You
You do not need the WDK to use the device console, it is just used to download the executable. You may even come across people offering the devcon.exe by itself. It is also recommended to use pnputil instead of devcon https://docs.microsoft.com/de-de/windows-hardware/drivers/devtest/pnputil (I have not tried pnputil myself).
11-23-2021 05:41 AM
@SatishKV wrote:
Thank you for your help and replying me.
To use DEVCON I need to have WDK and visual studio.
Could u please suggest a solution which uses the DLL file and its function to do the same in LABVIEW.
I could in theory but in practice the Windows SetupAPI that is needed to get at the device handle to do some operations on a device is rather complex and uses pretty nasty data structure and sometimes even callbacks, so that calling them from LabVIEW is a very involved task. I don't have days of time over to research which APIs need to be called exactly and walk you through trying to call these APIs,
If you want to follow this path, you would have to download the WDK and/or checkout the source of this sample in the Microsoft github page and start writing those VIs yourself. But unless you have a really good understanding about C programming and some knowledge about how a C compiler actually works, it's going to be a long and painful experience.
Besides the WDK download should contain a build executable already, so the Visual Studio Installation should not be needed, strictly speaking. Downloading executables from 3rd party sites is something I would not recommend. You can never really be sure, what they really contain, many of them are nowadays tainted with built in code you rather would not want to have on your computer.
So unless you download code from a reputable side it's basically a poker game if you open up your computer to nastyness.
12-14-2021 11:17 AM - edited 12-14-2021 11:18 AM
Hi,
This seemed like an appropriate thread to ask a question regarding LabVIEW & DevCon. I ( like the OP) needed a way to disable / enable a troublesome USB power supply, & BLED112 Bluetooth dongle before each instance of a LabVIEW test. I had successfully integrated some example code I found into my own application, and it worked flawlessly for several months.
This week my coworker & I have discovered that the DevCon commands being fed into SysExec are now getting an Exit Code of 1, with an error saying that the system has to be rebooted in order for the DevCon Restart to execute!
We are thinking that something may have caused the code to break, possible a Windows 10 or other update such as Kapersky or other security software IT uses?
Has anyone else experienced similar problems with previously working DevCon commands run in LabVIEW? We are using LabVIEW 2021 Full Dev, Version. My VI with the DevCon commands inside is attached.
Thanks for any help / advice / thoughts on why this is happening.
George
12-14-2021 12:15 PM
Stupid question: Did you restart your system?
I recently had the case that a program complained that I needed to restart the computer in order to continue. Turned out Windows Update had silently installed some update that required a reboot and apparently this program was somehow blocked from doing what it wanted to do until I had restarted the computer.