Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

List of present serial ports

Solved!
Go to solution

I need a list of serial ports on a computer, so I can scan these to find which is connected to an external device.

The application is expected to be distributed to many computers with different hw & sw configurations.

 

My problem is that I only want the present seriel ports listed - that is, the same ports as those occurring in Windows Device Manager.

When I use Visa Find Resource.vi, I get a much longer list, which I think includes virtual ports also on devices currently not present.

 

Anyone knows how to obtain this list ?

I have tried the code below, and it works OK on Windows XP (I get a long text string that I can search in), but I am not too happy because I am afraid it will not work on other Windows versions:

WMIC.png

Jan Nielsen
Freelance system analyst and LabVIEW programmer
0 Kudos
Message 1 of 6
(5,767 Views)
Solution
Accepted by topic author Jan_Nielsen

Hi Jan.

 

 

I have attached a VI that uses the 'VISA Find Resource'-function. This gives a list of all the parallel ports on your computer.

 

Take a look at the VI and let me know if this is what you want?

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
Message 2 of 6
(5,740 Views)

Thanks Alex, but I can't open the VI, my LV is 2011

Can you please save it in 2011 ?

Jan Nielsen
Freelance system analyst and LabVIEW programmer
0 Kudos
Message 3 of 6
(5,736 Views)

Sure Smiley Happy Attached is the 2011-version.

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 4 of 6
(5,734 Views)

Thanks Alex, this is exactly what I need !

Jan Nielsen
Freelance system analyst and LabVIEW programmer
0 Kudos
Message 5 of 6
(5,731 Views)

This is a great tool! I had a need similar to this for a project I have, but wondering how one might take this a step further and make the list a selectable list.  I.e. the user could select any comport and then have the test save that selection as say a string to feed into a cluster later.

0 Kudos
Message 6 of 6
(2,866 Views)