Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

VISA Resource Name Control

LabVIEW 2011 Help

Edition Date: June 2011

Part Number: 371361H-01

»View Product Info

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 ([ ]).

InterfaceSyntaxClasses
VXI INSTRVXI[board]::VXI logical address[::INSTR] Instr;
VXI/GPIB-VXI MBD Instr;
VXI/GPIB-VXI/VME RBD Instr
VXI MEMACCVXI[board]::MEMACC VXI/GPIB-VXI/VME MemAcc
VXI BACKPLANEVXI[board][::VXI logical address]::BACKPLANE VXI/GPIB-VXI Backplane
VXI SERVANTVXI[board]::SERVANT VXI Servant
GPIB-VXI INSTRGPIB-VXI[board]::VXI logical address[::INSTR] VXI/GPIB-VXI MBD Instr;
VXI/GPIB-VXI/VME RBD Instr
GPIB-VXI MEMACCGPIB-VXI[board]::MEMACC VXI/GPIB-VXI/VME MemAcc
GPIB-VXI BACKPLANEGPIB-VXI[board][::VXI logical address]::BACKPLANE VXI/GPIB-VXI Backplane
GPIB INSTRGPIB[board]::primary address[::GPIB secondary address][::INSTR] GPIB Instr
GPIB INTFCGPIB[board]::INTFC GPIB BoardInterface
GPIB SERVANTGPIB[board]::SERVANT N/A
PXI INSTRPXI[bus]::device[::function][::INSTR] PXI Instr
PXI INSTRPXI[interface]::[bus-]device[.function][::INSTR] PXI Instr
PXI MEMACCPXI[interface]::MEMACC PXI MemAcc
Serial INSTRASRL[board][::INSTR] Serial Instr
TCPIP INSTRTCPIP[board]::host address[::LAN device name][::INSTR] TCP/IP Instr
TCPIP SOCKETTCPIP[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 SegmentDefault Value
board0
GPIB secondary addressNone
LAN device nameinst0
PXI function0
USB interface numberlowest numbered relevant interface

The following table shows examples of address strings.

Address StringDescription
VXI0::1::INSTRA VXI device at logical address 1 in VXI interface VXI0.
GPIB-VXI::9::INSTRA VXI device at logical address 9 in a GPIB-VXI controlled system.
GPIB::1::0::INSTRA GPIB device at primary address 1 and secondary address 0 in GPIB interface 0.
ASRL1::INSTRA serial device attached to interface ASRL1.
VXI::MEMACCBoard-level register access to the VXI interface.
GPIB-VXI1::MEMACCBoard-level register access to GPIB-VXI interface number 1.
GPIB2::INTFCInterface or raw resource for GPIB interface 2.
VXI::1::BACKPLANEMainframe resource for chassis 1 on the default VXI system, which is interface 0.
GPIB-VXI2::BACKPLANEMainframe resource for default chassis on GPIB-VXI interface 2.
GPIB1::SERVANTServant/device-side resource for GPIB interface 1.
VXI0::SERVANTServant/device-side resource for VXI interface 0.
TCPIP0::1.2.3.4::999::SOCKETRaw TCP/IP access to port 999 at the specified IP address.
TCPIP::dev.company.com::INSTRA TCP/IP device using VXI-11 located at the specified address. This uses the default LAN Device Name of inst0.
PXI::15::INSTRPXI device number 15 on bus 0.
PXI0::2-12.1::INSTRPXI bus number 2, device 12 with function 1.
PXI0::MEMACCPXI MEMACC session.
visa://hostname/resourceThe 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::INSTRA 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::RAWA 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 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.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit