Virtual COM Ports and Third-Party USB Serial Adapters in NI-VISA

Updated Dec 16, 2022

Reported In

Software

  • Measurement and Automation Explorer (MAX)

Driver

  • NI-VISA
  • NI-Serial

Issue Details

I'm having trouble using my virtual COM port or third-party USB-to-serial adapter in NI Measurement & Automation Explorer (MAX). I keep getting NI-VISA errors, or the device shows up with a yellow exclamation mark in the "Devices and Interfaces" section.

Solution

First, try installing the latest versions of NI-Serial and NI-VISA and running the test again. 

Note: Please see NI-VISA and LabVIEW Version Compatibility to select the latest supported NI-VISA version for your LabVIEW enviorment.

If possible, test the device using another port or computer as well.  For USB devices, an incompatible or faulty USB controller or port can prevent MAX from communicating with the device.  If the device continues to give errors in MAX, then the issue is likely with the serial hardware itself.

Most virtual COM ports and many low cost USB-to-serial adapters do not fully comply with the serial specification and therefore do not support a lot of the functions that VISA uses, such as asynchronous I/O and flushing.

If you make your own VISA calls (either through a VISA test panel in MAX or using the VISA API in a development environment) and avoid any calls that aren't supported by the driver for your virtual COM port then it may work, but because each virtual COM port implements different functionality, they are not officially supported by MAX or VISA.

Additional Information

Another workaround would be to try adding a token to the visaconf.ini file located in :      

 

WriteTimeoutGranularity = 0 under section [ASRL-RSRC-ALIAS].

 

This file can typically be found in the following locations:

  • Windows Vista or later: C:\ProgramData\National Instruments\NIvisa\visaconf.ini
  • Windows XP: C:\Documents and Settings\All Users\Application Data\National Instruments\NIvisa\visaconf.ini
  • Windows 2000/NT: C:\VXIPNP\WinNT\NIvisa\visaconf.ini
  • PharLap ETS: ni-rt\system\vxipnp\WinNT\nivisa\visaconf.ini
  • NI Linux Real-Time: /usr/local/vxipnp/linux/NIvisa/visaconf.ini