There are two methods for deleting old VISA resources:
- Deleting the alias through the VISA Alias Utility in NI MAX. This method is for newer versions of NI-VISA.
- Deleting the alias by modifying the visaconf.ini file. This method is for older versions of NI-VISA.
Deleting Through the NI MAX VISA Alias Utility
- In NI MAX, navigate to Tools»NI-VISA»VISA Options
- Select Aliases in the General Settings to view a list of resources and aliases on your system. From this panel, you can rename, add, or clear aliases.
- To remove a single alias, right-click on the resource and select Clear Alias.
Modifying the visaconf.ini File
- Access the visaconf.ini file on your system. The default directory for visaconf.ini is dependent on your operating system:
- Windows XP: <Documents and Settings>\All Users\Application Data\National Instruments\NIvisa
- Windows Vista or 7: <ProgramData>\National Instruments\NIvisa
- Windows 10/11:<ProgramData>\National Instruments\NIvisa
- To delete resource names individually:
- Delete the appropriate alias from the visaconf.ini file
- Close and reopen LabVIEW (when using a VISA Resource Name Constant)
- Refresh MAX by pressing F5 (when using the VISA Aliases Editor)
- To delete all VISA resources not currently installed on the computer:
- Delete visaconf.ini entirely
- Refresh MAX. Refreshing MAX will create a new visaconf.ini file
Note: Closing and reopening LabVIEW will not create a new visaconf.ini file.
Remove VISA Aliases Programmatically
- You can use the System Configuration API (Measurement I/O palette >> System Configuration) to find all available hardware resources connected to the system, see which of them are actually present, and then delete the ones that are not.
Additional Information
Below is an example on how to remove resources ASRL2::INSTR and ASRL3::INSTR in visaconf.ini:
Replace this:
[ALIASES]
Alias0 = "'LPT1','ASRL10::INSTR'"
Alias1 = "'COM1','ASRL1::INSTR'"
Alias2 = "'COM2','ASRL2::INSTR'"
Alias3 = "'COM3','ASRL3::INSTR'"
NumAliases = 4
[ASRL-RSRC-ALIAS]
Name0 = "ASRL10::INSTR"
Enabled0 = 1
Static0 = 1
SystemName0 = "LPT1"
BaudRate0 = 9600
DataBits0 = 8
Parity0 = 0
StopBits0 = 10
FlowCtrl0 = 0
Name1 = "ASRL1::INSTR"
Enabled1 = 1
Static1 = 0
SystemName1 = "COM1"
BaudRate1 = 9600
DataBits1 = 8
Parity1 = 0
StopBits1 = 10
FlowCtrl1 = 0
Name1 = "ASRL2::INSTR"
Enabled1 = 1
Static1 = 0
SystemName1 = "COM2"
BaudRate1 = 9600
DataBits1 = 8
Parity1 = 0
StopBits1 = 10
FlowCtrl1 = 0
Name1 = "ASRL3::INSTR"
Enabled1 = 1
Static1 = 0
SystemName1 = "COM3"
BaudRate1 = 9600
DataBits1 = 8
Parity1 = 0
StopBits1 = 10
FlowCtrl1 = 0
NumOfResources = 4
with this:
[ALIASES]
Alias0 = "'LPT1','ASRL10::INSTR'"
Alias1 = "'COM1','ASRL1::INSTR'"
NumAliases = 2
[ASRL-RSRC-ALIAS]
Name0 = "ASRL10::INSTR"
Enabled0 = 1
Static0 = 1
SystemName0 = "LPT1"
BaudRate0 = 9600
DataBits0 = 8
Parity0 = 0
StopBits0 = 10
FlowCtrl0 = 0
Name1 = "ASRL1::INSTR"
Enabled1 = 1
Static1 = 0
SystemName1 = "COM1"
BaudRate1 = 9600
DataBits1 = 8
Parity1 = 0
StopBits1 = 10
FlowCtrl1 = 0
NumOfResources = 2
Note: Before NI-VISA 4.2, the default director of visaconf.ini was C:\VXIpnp\WinNT\NIvisa
Note: See
Remove VISA Aliases Programmatically for an example VI.