LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i monitor usb device connected to my pc programmatically

I have to connect usb device for e.g. camera,i/o card,scanner etc...(not NI device) to my pc & want to detect it in a program

So if it is not connected to my pc ,My program should have to give message that,The device is not found.

How can i Do that ?

0 Kudos
Message 1 of 8
(6,092 Views)

Try this: https://decibel.ni.com/content/docs/DOC-6743

If not search ni website.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 8
(6,083 Views)

How can i Write my usb address ?

From which directoey i can start to write address of usb device so i can detect it ?

0 Kudos
Message 3 of 8
(6,052 Views)

Hello Kaku,

 

USB.png

 

You can use this simple function to know the USB device is connected or not. If you run this function as per the diagram you got all the drives name available in your personal computer. If you got in the function output array size is different with the previous array size. You can easily say that some additional hardware is connected with the PC.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 4 of 8
(6,048 Views)

Please read the Steps to complete section in the link.

 

Excerpt here:

 

Steps to Complete

Identify the device you wish to monitor for:

1. Plug it into the system.

2. Bring up the Windows Device Manager and locate the USB device.

3. Under the details tab Note down the device instance ID, this varies from device to device but the last part after the final "\" is usually sufficient.

4. Bring up the windows registry (regedit in the run menu).

5. Navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services.

6. Locate the device ID in one of the USB registry keys ( device must be connected,  might be easier to search for it).

7. Note down the subkey (folder) the device is stored in.  By default the VI uses USBSTOR, usbccgp, usbehci, usbaudio.

8. If the device falls under one of these subkeys you are ready to go.  If not add the sub key to the paths in the VI.

 

Enter the Device ID into the VI and run it, the VI will check if the device is present and return a boolean.  The VI is setup ready as a sub VI.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 5 of 8
(6,047 Views)

Thank you so much for replying !!!

 

how to read the data coming from that device ?

e.g. if scanner is connected & barcode value have to be read.

      From where can I take that value ? or

      How can come to know that scanner is currently reading a barcode ?

 

0 Kudos
Message 6 of 8
(6,021 Views)

@Kaku wrote:

Thank you so much for replying !!!

 

how to read the data coming from that device ?

e.g. if scanner is connected & barcode value have to be read.

      From where can I take that value ? or

      How can come to know that scanner is currently reading a barcode ?

 


Thant depends entirely on the scanner.  Some act as HID devices (click the button and it scans a code and acts just like a keyboard entry) some act like COM serial ports, others have specific hardware adaptors that control IO and triggering.

Be specific about what device you are connecting. Have you read the manual for that device?


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 8
(6,001 Views)

That Device act as a keyboard HID device

Suppose I want to assign a fixed port for scanner & other port for another scanner

both working simultanously.How to differentiate two data

Or

How can I read data coming from specific scanner

 

Thank u fr rplying

0 Kudos
Message 8 of 8
(5,987 Views)