VISA viOpen

Aus ExpeccoWiki

Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

Schema

VISA viOpen.png

Description

The viOpen() operation opens a session to the specified resource. It returns a session identifier that can be used to call any other operations of that resource. The address string passed to viOpen() must uniquely identify a resource.

Input Pins

  • viInterface
    The handle to the visa interface
  • rmSession
    The resource manager session
  • resourceString
    The visa identifier of the device (see remarks)
  • accessMode
    The mode how the device should be accessed
  • timeout
    Timeout for opening the device

Output Pins

  • viOpenInterface
    The handle to the device

Remarks

ResourceString

The resourceString ist the Identifier for VISA to select the proper device you want to connect to. You can check the resourceString if you select the device in the NI Measurement & Automation Explorer and select the Tab VISA properties. Then you can see the resourceString on the top. If you specify an VISA alias it should be also possible to use it as resourceString.

VI_ATTR_RSRC_NAME is the unique identifier for a resource compliant with the address structure shown in the following table. Optional string segments are shown in square brackets.

Interface Syntax

 GPIB INSTR              GPIB[board]::primary address[::secondaryaddress][::INSTR]
 GPIB INTFC              GPIB[board]::INTFC
 GPIB SERVANT            GPIB[board]::SERVANT
 GPIB-VXI INSTR          GPIB-VXI[board]::VXI logical address[::INSTR]
 GPIB-VXIBACKPLANE       GPIB-VXI[board][::mainframe logical address]::BACKPLANE
 GPIB-VXIMEMACC          GPIB-VXI[board]::MEMACC
 PXI INSTR               PXI[bus]::device[::function][::INSTR]
 PXI INSTR               PXI[interface]::[bus-]device[.function][::INSTR]
 PXI MEMACC              PXI[interface]::MEMACC
 Serial INSTR            ASRL[board][::INSTR]
 TCPIP INSTR             TCPIP [board]::host address[::LAN device name][::INSTR]
 TCPIP SOCKET            TCPIP [board]::host address::port::SOCKET
 USB INSTR               USB[board]::manufacturer ID::modelcode::serial number[::USBinterfacenumber][::INSTR]
 USB RAW                 USB[board]::manufacturer ID::modelcode::serial number[::USBinterfacenumber]::RAW
 VXI INSTR               VXI[board]::VXI logical address[::INSTR]
 VXI BACKPLANE           VXI[board][::mainframe logical address]::BACKPLANE
 VXI MEMACC              VXI[board]::MEMACC
 VXI SERVANT             VXI[board]::SERVANT

AccessMode

The mode specifies the VISA Access Mode. It can have the following values:

 0 = VI_NO_LOCK
 1 = VI_EXCLUSIVE_LOCK
 2 = VI_SHARED_LOCK

For the parameter accessMode, the value VI_EXCLUSIVE_LOCK (1) is used to acquire an exclusive lock immediately upon opening a session; if a lock cannot be acquired, the session is closed and an error is returned. The value VI_LOAD_CONFIG (4) is used to configure attributes to values specified by some external configuration utility. Multiple access modes can be used simultaneously by specifying a bit-wise OR of the values other than VI_NULL. NI-VISA currently supports VI_LOAD_CONFIG only on Serial INSTR sessions.

Revisions

These blocks have been in the VISA Interface Library since 1.0.



Back to VISA Interface Library.
Previous: VISA [ Open Interface ]
Next: VISA [ viOpenDefaultRM ]


Meine Werkzeuge