LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any function which can detect if one USB port is available to insert to PC

Is there any function which can detect if one USB port  is available to  insert to PC?  Please help me .

0 Kudos
Message 1 of 9
(4,749 Views)

Hi,

 

If you use FTDI devices you can detect them by a name which is programmed into the devices.

 

Kees

0 Kudos
Message 2 of 9
(4,734 Views)

google came up with an answer

https://forums.ni.com/t5/LabVIEW/Programmatically-read-list-of-Windows-USB-ports/td-p/1013586

which links to

http://forums.ni.com/t5/LabVIEW/Access-device-manager-through-labview/m-p/700022?view=by_date_ascend...

 

so you would need the tool "devcon.exe"

see https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon

and run it with the "System Exec.vi"

 

to get the devcon tool, you would either have to get (and install) the WDK,

or trust this guy http://forums.ni.com/t5/LabVIEW/Device-manager-Disable-the-Secondary-IDE-channel/m-p/793778#M362380

 

hope that is what you were looking for


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 3 of 9
(4,732 Views)
0 Kudos
Message 4 of 9
(4,730 Views)

Thanks your reply,  yes, I used FTDI devices, could you help me which function should i use to detect the devices name?

0 Kudos
Message 5 of 9
(4,689 Views)

Hi,

 

With the FT_PROG utility from FTDI you can configure your FTDI device. With this you can also give it a custom serial number/name.

One of the FTDI VI's is open device by serial number. With this handle you get from this VI you can retrieve more information like COM port number.

 

Let me know if you need more information.

 

Kees

 

0 Kudos
Message 6 of 9
(4,678 Views)

Thanks for your reply, I am sure your way may works well. But first ,I need to find  this VI(One of the FTDI VI's is open device by serial number),  haha, That will be wonderful if your have this VI......

0 Kudos
Message 7 of 9
(4,672 Views)

Thanks for your reply, I am sure your way may works well. But first ,I need to find  this VI(One of the FTDI VI's is open device by serial number),  HAHA, That will be wonderful if your have this VI......

0 Kudos
Message 8 of 9
(4,671 Views)

Well I cannot find it myself anymore at the website. But here is the ZIP with the original VI's and the VI's that I made (as drivers) with error handling.

 

Kees

Message 9 of 9
(4,665 Views)