Resolve VISA Connection Errors
Issue
If you are unable to connect to a VISA device using the visadev
interface, follow these troubleshooting steps.
Possible Solutions
Configuration and Connection
Make sure your device is powered on and all cables are properly connected.
Make sure that you have the correct instrument driver installed for your device. Refer to your device documentation and the vendor website.
Note
If you are connecting to a GPIB device using an NI GPIB adaptor, you must download the NI-488.2 driver compatible with your VISA driver version from the NI website. The NI-488.2 driver is not available as an Instrument Control Toolbox™ support package.
Make sure that your device is supported in Instrument Control Toolbox. See Is My Hardware Supported? and Instrument Control Toolbox Supported Hardware.
Make sure that Instrument Control Toolbox recognizes your device, by using the
visadevlist
function.resourceList = visadevlist
resourceList = 6×6 table ResourceName Alias Vendor Model SerialNumber Type __________________________________________ _________________ ______________________ ___________ ____________ ______ 1 "USB0::0x0699::0x036A::CU010105::0::INSTR" "NI_SCOPE_4CH" "TEKTRONIX" "TDS 2024B" "CU010105" usb 2 "TCPIP0::169.254.2.20::inst0::INSTR" "Keysight_33210A" "Agilent Technologies" "33210A" "MY57003523" tcpip 3 "ASRL1::INSTR" "COM1" "" "" "" serial 4 "ASRL3::INSTR" "COM3" "" "" "" serial 5 "GPIB0::5::INSTR" "FGEN_2CH" "Agilent Technologies" "33522B" "MY52800145" gpib 6 "GPIB0::11::INSTR" "OSCOPE_2CH" "TEKTRONIX" "TDS 1002" "0" gpib
Create a
visadev
object using one of the resource names listed. If your instrument is not listed, it might not be configured properly in your VISA vendor’s configuration utility software.Note
VISA-TCP/IP, VISA-Socket, and VISA-Serial instruments and devices might need to be added manually in the VISA vendor's configuration utility to appear in the
visadevlist
output.
VISA Driver Configuration
If you are still having connection or communication issues with your instrument using VISA, you can troubleshoot using your VISA vendor's software and utilities, as described in the following table.
VISA Vendor | Configuration Utility | Testing Connection | Debug Utility |
---|---|---|---|
Keysight® VISA | Keysight Connection Expert (KCE) | Interactive IO button on KCE | IO Monitor button on KCE |
NI-VISA | NI Measurement and Automation Explorer (NI MAX) | Tools > NI VISA > VISA Interactive Control | Tools > NI I/O Trace |
Rohde & Schwarz R&S VISA | RsVisaConfigure, launched from RsVisa Config tab on RsVisaTester | RsVisaTester | RsVisaTraceTool, launched from RsVisa TraceTool tab on RsVisaTester |
Use the VISA Conflict Manager settings from your VISA vendor's configuration utility to make sure that you have a preferred VISA set and that it is enabled. Check if all the VISA interfaces are using the expected VISA. For R&S VISA, make sure it is set to "Preferred". For example, for the Keysight Connection Expert, do the following.
Open the settings menu and select Tools > VISA Conflict Manager.
Under Enabled Implementations, make sure that your VISA vendor is selected.
Under Preferred Implementation, make sure that your VISA vendor is selected.
If you are using SCPI commands, check if your device responds to them as expected when they are issued from the configuration utility.
Use your VISA vendor's configuration utility to make sure that your device hardware is being detected. You can also check that your device responds to a
*IDN?
query.Use your VISA vendor's debug utility to check the Instrument I/O traffic for errors other than timeout errors.
Try installing a different supported VISA vendor's driver.
Interface-Specific VISA
You can use other Instrument Control Toolbox interfaces to troubleshoot VISA. Try connecting to your devices using these interfaces.
VISA-TCP/IP —
tcpclient
interfaceVISA-Serial —
serialport
interface
Working with icdevice
Objects
When working with icdevice
objects in the non-legacy mode,
you can use a visadev
object as an argument to the icdevice
function. Clearing
the visadev
object from the workspace removes references to it,
but the icdevice
still maintains a connection. As a result, a
subsequent attempt to create the same visadev
connection
generates an error.
v = visadev("USB0::0x0957::0x0407::MY44061035::0::INSTR"); d = icdevice("agilent_33120a",v,LegacyMode=false); clear v = visadev("USB0::0x0957::0x0407::MY44061035::0::INSTR");
Creating a second device for the USB0::0X0957::0X0407::MY44061035::0::INSTR resource is not supported.
To avoid this error, you can use icdevicefind
to locate and remove all such objects before
proceeding.
delete(icdevicefind) v = visadev("USB0::0x0957::0x0407::MY44061035::0::INSTR");