Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

VISA Resource Name Control

LabVIEW 8.2 Help
August 2006

NI Part Number:
371361B-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 VISA 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 ([ ]).

InterfaceSyntax
VXI INSTRVXI[board]::VXI logical address[::INSTR]
VXI MEMACCVXI[board]::MEMACC
VXI BACKPLANEVXI[board][::VXI logical address]::BACKPLANE
VXI SERVANTVXI[board]::SERVANT
GPIB-VXI INSTRGPIB-VXI[board]::VXI logical address[::INSTR]
GPIB-VXI MEMACCGPIB-VXI[board]::MEMACC
GPIB-VXI BACKPLANEGPIB-VXI[board][::VXI logical address]::BACKPLANE
GPIB INSTRGPIB[board]::primary address[::GPIB secondary address][::INSTR]
GPIB INTFCGPIB[board]::INTFC
GPIB SERVANTGPIB[board]::SERVANT
PXI INSTRPXI[bus]::device[::function][::INSTR]
PXI INSTRPXI[interface]::[bus-]device[.function][::INSTR]
PXI MEMACCPXI[interface]::MEMACC
Serial INSTRASRL[board][::INSTR]
TCPIP INSTRTCPIP[board]::host address[::LAN device name][::INSTR]
TCPIP SOCKETTCPIP[board]::host address::port::SOCKET
USB INSTRUSB[board]::manufacturer ID::model code::serial number[::USB interface number][::INSTR]
USB RAWUSB[board]::manufacturer ID::model code::serial number[::USB interface number]::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 RS-232) 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 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 VISA resource name control in edit mode and selecting a different class from the shortcut menu.

Note  You can pass the Event classes in as a VISA resource name only to the VISA Close function and a Property Node.

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. If you wire VISA resource name to a function that does not accept the class of the session, or if you wire two VISA 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.

Resources


 

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