LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting the comm port automatically

hi i have a usb converter ... (example:A). How i can automatically knw which comm port is connected to?(without checking the device manager) and let say i have 7 ports in my pc?

 

Need help.. Plz and thk u

0 Kudos
Message 1 of 8
(3,059 Views)
You did not finish the sentence - "connected to?" Connected to the pc or connected to a specific instrument? The VISA Find Resource will list all of the resources and with the correct expression and mode selection, you can list just the com ports. If you want to find out which port is connected to which instrument, then you will use the VISA Find Resource to get an array of com ports and for each one, send a unique query and make the decision based on what, if anything, comes back with a read.
Message 2 of 8
(3,056 Views)
USB is inheirantly, and by design, a Plug and Pray technology.  It will assign resources dynamically.  To avoid this there are a few things you can do but every one of them involves hardware or operator intervention (like using the HW manager)

"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 8
(3,052 Views)

Hi dennis. Thank you can i get an example how to do this in labview 8.0.plz

 

0 Kudos
Message 4 of 8
(3,040 Views)
Take a look at the picture. In help you will find a good description on how to use it.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 8
(3,024 Views)

The way I normally do that funtion is to find the interface name associated with a COM port - for standard, built-in COM Ports it will be "ASRLx (Communications Port - COMx)", but for a USB Adaptor it will be something like "ASRLx (<Port Description> - COMx)", where <Port Description> is the text you see in Device Manager.

 

Here's a VI I use to automatically parse out the Interface Name for COM ports on a system. I normally run this VI and then search through the array, looking at the description field to find the port for my device.

 

Note: If you have more than one USB COM adaptor using the same chip, this VI will not automatically be able to tell them apart. If that's the case you will have to add some kind of identification routine specific to your device.

 

Shaun 

Message 6 of 8
(2,994 Views)
 can i get this example in lab view 8.0..plz thk u
0 Kudos
Message 7 of 8
(2,883 Views)

Saved for LV 8.0

 

And please use all the keys on your keyboard.  There is no need to resort to text messaging.

Message 8 of 8
(2,881 Views)