LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read USB Device Instance ID

Hello,

 

Can i read USB Device instance ID in LabVIEW ?

 

For Example :- The Hardware ID shown by my Device connected over USB is,

USB\VID_03F0&PID_094A\6&24b73976&0&2

As per my understanding the garbage value '6&24b73976&0&2' is the Instance ID. And this is what i want to read.

 

I need to read this value for below described requirement,

I need to test/communicate with a device connected over USB interface. When i connect different devices of same type it generates a different COM port each time.

 

I want to automatically identify the COM Port generated by different devices of same type.

For this i'm trying to use the unique Device Instance ID of the COM Port generated.

 

Thanks,

Rahul 😊

0 Kudos
Message 1 of 2
(2,599 Views)

@RGrag wrote:

Hello,

 

Can i read USB Device instance ID in LabVIEW ?

 

For Example :- The Hardware ID shown by my Device connected over USB is,

USB\VID_03F0&PID_094A\6&24b73976&0&2

As per my understanding the garbage value '6&24b73976&0&2' is the Instance ID. And this is what i want to read.

 

I need to read this value for below described requirement,

I need to test/communicate with a device connected over USB interface. When i connect different devices of same type it generates a different COM port each time.

 

I want to automatically identify the COM Port generated by different devices of same type.

For this i'm trying to use the unique Device Instance ID of the COM Port generated.

 

Thanks,

Rahul 😊


You might enjoy reading through this thread: https://forums.ni.com/t5/LabVIEW/Programatically-determine-and-select-VISA-COM-Port-Binding/m-p/4249...

 

There are a few ways to solve the "Moving COM Port" problem. Working through the device tree is certainly the cleanest solution that is also the most fun and most user-friendy. The windows device setup functions (https://docs.microsoft.com/en-us/windows/win32/api/setupapi/nf-setupapi-setupdigetclassdevsw) are a possible point of entry. I found it acceptable to look up solutions for C# or Powershell and just port them over to LabVIEW as needed.

 

On the other hand, if this is an option for you (i.e., you have influence over the device and know what other VCPs are connected to the machine), the fastest solution would be to just open every available port and ask the device on the other end to identify itself.

0 Kudos
Message 2 of 2
(2,573 Views)