Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

why does VISA show a COM port that's not there?

My Windows Device Manager shows only COM1 & COM4, which is correct.
However, NI VISA shows COM3 as well.
I would like to program my application to query the available COM ports correctly, and provide that to users to select from.
But the list needs to be correct!
 
Note: I am using a laptop with only 1 serial port (COM1), and also a USB hub with a USB to serial port adapter (COM4) connected to the hub.
 
0 Kudos
Message 1 of 9
(4,393 Views)
Does your laptop have a built-in modem? If it does, then that's com3.
0 Kudos
Message 2 of 9
(4,385 Views)
Does it have blue tooth support? They show up as COM ports on some machines, so do USB CDC devices.

-Josh
0 Kudos
Message 3 of 9
(4,375 Views)
If COM3 is indeed a bluetooth port or modem port, why then does the LabVIEW builtin VI "Serial Port Init" return an error code of 0 when I run it on COM3?  Also, an NI MAX query for the serial port rate property on COM3 returns 9600 baud, and so forth.  I can find no property of COM3 that is different than one of my serial ports, in fact.
0 Kudos
Message 4 of 9
(4,373 Views)
Don't know anything about Bluetooth but if you do have a modem, why should you get an error? It is a com port that you can setup and read/write with VISA.
0 Kudos
Message 5 of 9
(4,370 Views)
Hmm.  I didn't realize that serial port init VI would acceptably initialize a modem.  I was assuming it would be distinguish b/w an RX-232 port and a modem port.
 
Can you think of any LabVIEW VIs that I can use to differentiate b/w the 2?
0 Kudos
Message 6 of 9
(4,368 Views)
I can't think of anything offhand. There's probably some way to use the windows api or get a registry value but it's nothing I've ever tried to do. Sorry.
0 Kudos
Message 7 of 9
(4,364 Views)
Matt--

If you see multiple COM ports in MAX with an exclamation point, it usually indicates that there is a resource conflict between those port.  You can try first disabling one of the unused ports in MAX.  If that does not solve the problem, you can proceed with the following instructions:
  1. Go to Start and select Run
  2. Type "regedit" and hit "OK"
  3. Go to My Computer>HKEY_LOCAL_MACHINE>HARDWARE>DEVICEMAP>SERIALCOMM
  4. You should see both COM ports under this registry key, select the unwanted COM port and delete it
  5. Reboot your computer
After rebooting, you can go to MAX and check the ports again, the exclamation point should disappear and you will be able to establish communication to your serial port.


Mark
0 Kudos
Message 8 of 9
(4,361 Views)

I wrote my own code to search thru the Windows registry & pick up the strings that I wanted.

This seems to be very reliable and allows me to deal with USB-based serial ports and all kinds of stuff, so it's better anyway for a lot of reasons.

So this issue is closed, for me.

0 Kudos
Message 9 of 9
(4,057 Views)