My Serial Ports Have the Wrong Resource Names

Updated Jan 6, 2023

Reported In

Driver

  • NI-Serial

Operating System

  • Windows

Issue Details

  • When I place a VISA Resource Name Control on my front panel in LabVIEW, the drop down list shows ASRL1, ASRL2, and ASRL10.  On another computer, it shows COM1, COM2, and LPT1 in the LabVIEW control. Why do the serial ports have different names on these two computers?
  • How do I change the resource names for my serial ports on my computer/NI Devices?

Solution

Normally, Measurement & Automation Explorer (MAX) will automatically assign COM1, COM2, and LPT1 as aliases to ASRL1::INSTR, ASRL2::INSTR, and ASRL10::INSTR respectively. These ports will then show up in MAX and in the VISA Resource Name Control as COM1, COM2, and LPT1. If these VISA aliases have been modified by another user, each port under "Devices and Interfaces" will show up with its new alias followed by the binding port in parentheses. In comparison, the VISA Resource Name Control in LabVIEW displays only the VISA alias. For example, the first serial port may show up as ASRL1(COM1) in MAX, but would show as ASRL1 in LabVIEW. 

In order to change the VISA alias, simply right-click on the port in MAX under Devices and Interfaces»Ports and select Rename. You can also change the alias by opening the General tab where you can rename the port bound to COM1 as "COM1".  It will now read as COM1 in both MAX and LabVIEW. If you rename it as MyPort, it will show up as MyPort in MAX and as MyPort in LabVIEW. Once you have renamed the port, you must save the alias in order for it to show up in LabVIEW.  

You can also set a VISA alias for your instrument in MAX.  First, double-click Devices and Interfaces to expand it, right-click the entry for your interface, and select Scan for Instruments from the shortcut menu. Second, right-click your instrument and select VISA Properties from the shortcut menu to set the VISA alias for your instrument.

Additional Information

Measurement & Automation Explorer does not find GPIB instruments that are not IEEE 488.2-compliant (most instruments built before 1992 are not), but you can create a VISA alias for these instruments manually by using the VISA Alias Editor. In Measurement & Automation Explorer, select Tools » NI-VISA » Visa Options. This will open the VISA Options pane in the main window of MAX. From here, you can edit and manage the aliases on your system. To add an alias, click the Add Alias button. Enter the resource name and the alias for your instrument. For example, if you have a GPIB instrument at primary address 5 connected to GPIB0 (the default interface name), your resource name is GPIB0::5::INSTR