Use the VISA resource name control to specify the resource to which a VISA session will be opened and to maintain the session and class. A VISA session is a unique logical identifier used by VISA to communicate with a resource. The VISA session is maintained by the VISA resource name control and is not seen by the user. VISA resource name out is a copy of the resource name that is passed out of the VISA functions. By passing the resource name in and out of functions and VIs, you can simplify dataflow programming by chaining functions and VIs together. This is similar to the file refnum outputs used by the File I/O functions.
The following table shows the syntax for the VISA resource name string. Optional parameters are shown in square brackets ([ ]).
Interface | Syntax | Classes |
---|---|---|
VXI INSTR | VXI[board]::VXI logical address[::INSTR] | Instr; VXI/GPIB-VXI MBD Instr; VXI/GPIB-VXI/VME RBD Instr |
VXI MEMACC | VXI[board]::MEMACC | VXI/GPIB-VXI/VME MemAcc |
VXI BACKPLANE | VXI[board][::VXI logical address]::BACKPLANE | VXI/GPIB-VXI Backplane |
VXI SERVANT | VXI[board]::SERVANT | VXI Servant |
GPIB-VXI INSTR | GPIB-VXI[board]::VXI logical address[::INSTR] | VXI/GPIB-VXI MBD Instr; VXI/GPIB-VXI/VME RBD Instr |
GPIB-VXI MEMACC | GPIB-VXI[board]::MEMACC | VXI/GPIB-VXI/VME MemAcc |
GPIB-VXI BACKPLANE | GPIB-VXI[board][::VXI logical address]::BACKPLANE | VXI/GPIB-VXI Backplane |
GPIB INSTR | GPIB[board]::primary address[::GPIB secondary address][::INSTR] | GPIB Instr |
GPIB INTFC | GPIB[board]::INTFC | GPIB BoardInterface |
GPIB SERVANT | GPIB[board]::SERVANT | N/A |
PXI INSTR | PXI[bus]::device[::function][::INSTR] | PXI Instr |
PXI INSTR | PXI[interface]::[bus-]device[.function][::INSTR] | PXI Instr |
PXI MEMACC | PXI[interface]::MEMACC | PXI MemAcc |
Serial INSTR | ASRL[board][::INSTR] | Serial Instr |
TCPIP INSTR | TCPIP[board]::host address[::LAN device name][::INSTR] | TCP/IP Instr |
TCPIP SOCKET | TCPIP[board]::host address::port::SOCKET | TCP/IP Socket |
USB INSTR | USB[board]::manufacturer ID::model code::serial number[::USB interface number][::INSTR] | USB Instr |
USB RAW | USB[board]::manufacturer ID::model code::serial number[::USB interface number]::RAW | USB Raw |
The VXI keyword is used for VXI instruments through either embedded or MXIbus controllers. The GPIB keyword is used to establish communication with a GPIB device. The GPIB-VXI keyword is used for a GPIB-VXI controller. The ASRL keyword is used to establish communication with an asynchronous serial (such as RS232) device.
The INSTR keyword specifies a VISA resource of the type INSTR.
The following table shows the default value for optional string segments.
Optional String Segment | Default Value |
---|---|
board | 0 |
GPIB secondary address | None |
LAN device name | inst0 |
PXI function | 0 |
USB interface number | lowest numbered relevant interface |
The following table shows examples of address strings.
Address String | Description |
---|---|
VXI0::1::INSTR | A VXI device at logical address 1 in VXI interface VXI0. |
GPIB-VXI::9::INSTR | A VXI device at logical address 9 in a GPIB-VXI controlled system. |
GPIB::1::0::INSTR | A GPIB device at primary address 1 and secondary address 0 in GPIB interface 0. |
ASRL1::INSTR | A serial device attached to interface ASRL1. |
VXI::MEMACC | Board-level register access to the VXI interface. |
GPIB-VXI1::MEMACC | Board-level register access to GPIB-VXI interface number 1. |
GPIB2::INTFC | Interface or raw resource for GPIB interface 2. |
VXI::1::BACKPLANE | Mainframe resource for chassis 1 on the default VXI system, which is interface 0. |
GPIB-VXI2::BACKPLANE | Mainframe resource for default chassis on GPIB-VXI interface 2. |
GPIB1::SERVANT | Servant/device-side resource for GPIB interface 1. |
VXI0::SERVANT | Servant/device-side resource for VXI interface 0. |
TCPIP0::1.2.3.4::999::SOCKET | Raw TCP/IP access to port 999 at the specified IP address. |
TCPIP::dev.company.com::INSTR | A TCP/IP device using VXI-11 located at the specified address. This uses the default LAN Device Name of inst0. |
PXI::15::INSTR | PXI device number 15 on bus 0. |
PXI0::2-12.1::INSTR | PXI bus number 2, device 12 with function 1. |
PXI0::MEMACC | PXI MEMACC session. |
visa://hostname/resource | The resource on the specified remote system. The hostname can be represented as either an IP address (dot-notation) or network machine name. This remote system need not be explicitly configured on the client system. |
USB::0x1234::125::A22-5::INSTR | A USB Test & Measurement class device with manufacturer ID 0x1234, model code 125, and serial number A22-5. This uses the first available USBTMC interface of the device. This is usually number 0. |
USB::0x5678::0x33::SN999::1::RAW | A raw USB nonclass device with manufacturer ID 0x5678, model code 0x33, and serial number SN999. This uses the device interface number 1. |
By default, the VISA resource name control is set to the Instr class, which also corresponds to the class of the session to be opened. You can change the class type by right-clicking the control in edit mode and selecting a different class from the shortcut menu.
VISA functions vary in the class of VISA resource name that can be wired to them. The valid classes for each function are listed in the NI-VISA Help. For example, the functions on the Register Access and Low Level Register Access palettes do not accept VISA sessions of class GPIB Instr or Serial Instr.
Note You can wire resource names set to the Event classes only to the VISA Close function and a Property Node. |
If you wire the VISA resource name control to a function that does not accept the class of the session, or if you wire two resource names of differing classes together, the block diagram will not run and a Class Conflict error is reported.
Note VISA name controls and constants are available on all platforms. However, if you try to run a VI with a name control that contains a resource string for a device that your platform does not support, you will receive an error. |