|
OpenTAP 9.34
API Reference
|
Collection of all visa functions. More...
Public Member Functions | |
| delegate int | ViEventHandler (int vi, int eventType, int context, int userHandle) |
| Event handler for visa events. | |
| delegate int | ViOpenDefaultRmDelegate (out int sesn) |
| This function returns a session to the Default Resource Manager resource. This function must be called before any VISA functions can be invoked. The first call to this function initializes the VISA system, including the Default Resource Manager resource, and also returns a session to that resource. Subsequent calls to this function return unique sessions to the same Default Resource Manager resource. | |
| delegate int | ViFindRsrcDelegate (int sesn, string expr, out int findList, out int retCount, StringBuilder desc) |
| This function queries a VISA system to locate the resources associated with a specified interface. This function matches the value specified in the expr parameter with the resources available for a particular interface. On successful completion, it returns the first resource found in the list and returns a count to indicate if there were more resources found that match the value specified in the expr parameter. | |
| delegate int | ViFindNextDelegate (int findList, StringBuilder desc) |
| This function returns the next resource found in the list created by viFindRsrc. The list is referenced by the handle that was returned by viFindRsrc. | |
| delegate int | ViParseRsrcDelegate (int sesn, string desc, ref short intfType, ref short intfNum) |
| Parse a resource string to get the interface information. This operation parses a resource string to verify its validity. It should succeed for all strings returned by viFindRsrc and recognized by viOpen. This operation is useful if you want to know what interface a given resource descriptor would use without actually opening a session to it. | |
| delegate int | ViParseRsrcExDelegate (int sesn, string desc, ref short intfType, ref short intfNum, StringBuilder rsrcClass, StringBuilder expandedUnaliasedName, StringBuilder aliasIfExists) |
| This function parses a resource string to get extended interface information. It should succeed for all strings returned by viFindRsrc and recognized by viOpen. This operation is useful if you want to know what interface a given VISA address (resource descriptor) would use without actually opening a session to it. | |
| delegate int | ViOpenDelegate (int sesn, string viDesc, int accessMode, int timeout, out int vi) |
| This function opens a session to the specified device. It returns a session identifier that can be used to call any other functions to that device. | |
| delegate int | ViCloseDelegate (int vi) |
| This function closes the specified resource manager session, device session, find list (returned from the viFindRsrc function), or event context (returned from the viWaitOnEvent function, or passed to an event handler). In this process, all the data structures that had been allocated for the specified vi are freed. | |
| delegate int | ViGetAttributeBDelegate (int vi, int attrName, out byte attrValue) |
| This function retrieves the state of an attribute for the specified session. | |
| delegate int | ViGetAttributeSbDelegate (int vi, int attrName, StringBuilder attrValue) |
| delegate int | ViGetAttributeIDelegate (int vi, int attrName, out int attrValue) |
| delegate int | ViSetAttributeBDelegate (int vi, int attrName, byte attrValue) |
| This function sets the state of an attribute for the specified session. The viSetAttribute operation is used to modify the state of an attribute for the specified session, event, or find list. | |
| delegate int | ViSetAttributeIDelegate (int vi, int attrName, int attrValue) |
| delegate int | ViStatusDescDelegate (int vi, int status, StringBuilder desc) |
| This function returns a user-readable string that describes the status code passed to the function. If a status code cannot be interpreted by the session, viStatusDesc returns the warning VI_WARN_UNKNOWN_STATUS. | |
| delegate int | ViEnableEventDelegate (int vi, int eventType, short mechanism, int context) |
| This function enables notification of an event identified by the eventType parameter for mechanisms specified in the mechanism parameter. The specified session can be enabled to queue events by specifying VI_QUEUE. | |
| delegate int | ViDisableEventDelegate (int vi, int eventType, short mechanism) |
| This function disables servicing of an event identified by the eventType parameter for the mechanisms specified in the mechanism parameter. Specifying VI_ALL_ENABLED_EVENTS for the eventType parameter allows a session to stop receiving all events. The session can stop receiving queued events by specifying VI_QUEUE. Applications can stop receiving callback events by specifying either VI_HNDLR or VI_SUSPEND_HNDLR. Specifying VI_ALL_MECH disables both the queuing and callback mechanisms. viDisableEvent prevents new event occurrences from being added to the queue(s). However, event occurrences already existing in the queue(s) are not discarded. | |
| delegate int | ViInstallHandlerDelegate (int vi, int eventType, ViEventHandler handler, int userHandle) |
| This function allows applications to install handlers on sessions for event callbacks. The handler specified in the handler parameter is installed along with previously installed handlers for the specified event. Applications can specify a value in the userHandle parameter that is passed to the handler on its invocation. | |
| delegate int | ViUninstallHandlerDelegate (int vi, int eventType, ViEventHandler handler, int userHandle) |
| This function allows applications to uninstall handlers for events on sessions. Applications should also specify the value in the userHandle parameter that was passed to viInstallHandler while installing the handler. VISA identifies handlers uniquely using the handler reference and the userHandle. All the handlers or which the handler reference and the userHandle matches are uninstalled. | |
| delegate int | ViWaitOnEventDelegate (int vi, int eventType, int timeout, out int outEventType, IntPtr outContext) |
| This function waits for an occurrence of the specified event for a given session. In particular, this function suspends execution of an application thread and waits for an event inEventType for at least the time period specified by timeout. | |
| delegate int | ViReadDelegate (int vi, ArraySegment< byte > buffer, int count, out int retCount) |
| This function synchronously transfers data from a device. The data that is read is stored in the buffer represented by buf. This function returns only when the transfer terminates. Only one synchronous read function can occur at any one time. | |
| delegate int | ViWriteDelegate (int vi, ArraySegment< byte > buffer, int count, out int retCount) |
| This function synchronously transfers data to a device. The data to be written is in the buffer represented by buf. This function returns only when the transfer terminates. Only one synchronous write function can occur at any one time. If you pass VI_NULL as the retCount parameter to the viWrite operation, the number of bytes transferred will not be returned. This may be useful if it is important to know only whether the operation succeeded or failed. | |
| delegate int | ViReadStbDelegate (int vi, ref short status) |
| Read a status byte of the service request. This operation reads a service request status from a service requester (the message-based device). For example, on the IEEE 488.2 interface, the message is read by polling devices. For other types of interfaces, a message is sent in response to a service request to retrieve status information. | |
| delegate int | ViClearDelegate (int vi) |
| Clear a device. This operation performs an IEEE 488.1-style clear of the device. | |
| delegate int | ViLockDelegate (int vi, int lockType, int timeout, string requestedKey, StringBuilder accessKey) |
| This function is used to obtain a lock on the specified resource. The caller can specify the type of lock requested (exclusive or shared lock) and the length of time the operation will suspend while waiting to acquire the lock before timing out. This function can also be used for sharing and nesting locks. | |
| delegate int | ViUnlockDelegate (int vi) |
| This function is used to relinquish a lock previously obtained using the VisaFunctions.ViLockRef function. | |
Public Attributes | |
| ViOpenDefaultRmDelegate | ViOpenDefaultRmRef |
| ViFindRsrcDelegate | ViFindRsrcRef |
| ViFindNextDelegate | ViFindNextRef |
| ViParseRsrcDelegate | ViParseRsrcRef |
| ViParseRsrcExDelegate | ViParseRsrcExRef |
| ViOpenDelegate | ViOpenRef |
| ViCloseDelegate | ViCloseRef |
| ViGetAttributeBDelegate | ViGetAttribute1Ref |
| ViGetAttributeSbDelegate | ViGetAttribute2Ref |
| ViGetAttributeIDelegate | ViGetAttribute3Ref |
| ViSetAttributeBDelegate | ViSetAttribute1Ref |
| ViSetAttributeIDelegate | ViSetAttribute2Ref |
| ViStatusDescDelegate | ViStatusDescRef |
| ViEnableEventDelegate | ViEnableEventRef |
| ViDisableEventDelegate | ViDisableEventRef |
| ViInstallHandlerDelegate | ViInstallHandlerRef |
| ViUninstallHandlerDelegate | ViUninstallHandlerRef |
| ViWaitOnEventDelegate | ViWaitOnEventRef |
| ViReadDelegate | ViReadRef |
| ViWriteDelegate | ViWriteRef |
| ViReadStbDelegate | ViReadStbRef |
| ViClearDelegate | ViClearRef |
| ViLockDelegate | ViLockRef |
| ViUnlockDelegate | ViUnlockRef |
Collection of all visa functions.
| delegate int OpenTap.VisaFunctions.ViClearDelegate | ( | int | vi | ) |
Clear a device. This operation performs an IEEE 488.1-style clear of the device.
| vi | Unique logical identifier to a session. |
| delegate int OpenTap.VisaFunctions.ViCloseDelegate | ( | int | vi | ) |
This function closes the specified resource manager session, device session, find list (returned from the viFindRsrc function), or event context (returned from the viWaitOnEvent function, or passed to an event handler). In this process, all the data structures that had been allocated for the specified vi are freed.
| vi | Unique logical identifier to a session, event, or find list. |
https://helpfiles.keysight.com/IO_Libraries_Suite/English/IOLS_Linux/VISA/Content/visa/viClose.htm
| delegate int OpenTap.VisaFunctions.ViDisableEventDelegate | ( | int | vi, |
| int | eventType, | ||
| short | mechanism ) |
This function disables servicing of an event identified by the eventType parameter for the mechanisms specified in the mechanism parameter. Specifying VI_ALL_ENABLED_EVENTS for the eventType parameter allows a session to stop receiving all events. The session can stop receiving queued events by specifying VI_QUEUE. Applications can stop receiving callback events by specifying either VI_HNDLR or VI_SUSPEND_HNDLR. Specifying VI_ALL_MECH disables both the queuing and callback mechanisms. viDisableEvent prevents new event occurrences from being added to the queue(s). However, event occurrences already existing in the queue(s) are not discarded.
| vi | Unique logical identifier to a session. |
| eventType | Logical event identifier. |
| mechanism | Specifies event handling mechanisms to be disabled. The queuing mechanism is disabled by specifying VI_QUEUE. The callback mechanism is disabled by specifying VI_HNDLR or VI_SUSPEND_HNDLR. It is possible to disable both mechanisms simultaneously by specifying VI_ALL_MECH. |
| delegate int OpenTap.VisaFunctions.ViEnableEventDelegate | ( | int | vi, |
| int | eventType, | ||
| short | mechanism, | ||
| int | context ) |
This function enables notification of an event identified by the eventType parameter for mechanisms specified in the mechanism parameter. The specified session can be enabled to queue events by specifying VI_QUEUE.
| vi | Unique logical identifier to a session. |
| eventType | Logical event identifier. |
| mechanism | Specifies event handling mechanisms to be enabled. The queuing mechanism is enabled by VI_QUEUE, and the callback mechanism is enabled by VI_HNDLR or VI_SUSPEND_HNDLR. It is possible to enable both mechanisms simultaneously by specifying "bit-wise OR" of VI_QUEUE and one of the two mode values for the callback mechanism. |
| context | VI_NULL (Not used for VISA 1.0.) |
| delegate int OpenTap.VisaFunctions.ViFindNextDelegate | ( | int | findList, |
| StringBuilder | desc ) |
This function returns the next resource found in the list created by viFindRsrc. The list is referenced by the handle that was returned by viFindRsrc.
| findList | Describes a find list. This parameter must be created by viFindRsrc. |
| desc | Returns a string identifying location of a device. Strings can be passed to viOpen to establish a session to the device. |
| delegate int OpenTap.VisaFunctions.ViFindRsrcDelegate | ( | int | sesn, |
| string | expr, | ||
| out int | findList, | ||
| out int | retCount, | ||
| StringBuilder | desc ) |
This function queries a VISA system to locate the resources associated with a specified interface. This function matches the value specified in the expr parameter with the resources available for a particular interface. On successful completion, it returns the first resource found in the list and returns a count to indicate if there were more resources found that match the value specified in the expr parameter.
| sesn | Resource Manager session (should always be the Default Resource Manager for VISA returned from viOpenDefaultRM). |
| expr | This expression sets the criteria to search an interface or all interfaces for existing devices. |
| findList | Returns a handle identifying this search session. This handle will be used as an input in viFindNext. |
| retCount | Number of matches. |
| desc | Returns a string identifying the location of a device. Strings can then be passed to viOpen to establish a session to the given device. |
| delegate int OpenTap.VisaFunctions.ViGetAttributeBDelegate | ( | int | vi, |
| int | attrName, | ||
| out byte | attrValue ) |
This function retrieves the state of an attribute for the specified session.
| vi | Unique logical identifier to a session, event, or find list. |
| attrName | Resource attribute for which the state query is made. |
| attrValue | The state of the queried attribute for a specified resource. The interpretation of the returned value is defined by the individual resource. Note that you must allocate space for character strings returned. |
| delegate int OpenTap.VisaFunctions.ViInstallHandlerDelegate | ( | int | vi, |
| int | eventType, | ||
| ViEventHandler | handler, | ||
| int | userHandle ) |
This function allows applications to install handlers on sessions for event callbacks. The handler specified in the handler parameter is installed along with previously installed handlers for the specified event. Applications can specify a value in the userHandle parameter that is passed to the handler on its invocation.
| vi | Unique logical identifier to a session. |
| eventType | Logical event identifier. |
| handler | Interpreted as a valid reference to a handler to be installed by an application. |
| userHandle | A value specified by an application that can be used for identifying handlers uniquely for an event type. |
| delegate int OpenTap.VisaFunctions.ViLockDelegate | ( | int | vi, |
| int | lockType, | ||
| int | timeout, | ||
| string | requestedKey, | ||
| StringBuilder | accessKey ) |
This function is used to obtain a lock on the specified resource. The caller can specify the type of lock requested (exclusive or shared lock) and the length of time the operation will suspend while waiting to acquire the lock before timing out. This function can also be used for sharing and nesting locks.
| vi | Unique logical identifier to a session. |
| lockType | Specifies the type of lock requested, which can be VI_EXCLUSIVE_LOCK or VI_SHARED_LOCK. |
| timeout | Absolute time period (in milliseconds) that a resource waits to get unlocked by the locking session before returning this operation with an error. VI_TMO_IMMEDIATE and VI_TMO_INFINITE are also valid values. |
| requestedKey | This parameter is not used and should be set to VI_NULL when lockType is VI_EXCLUSIVE_LOCK (exclusive lock). When trying to lock the resource as VI_SHARED_LOCK (shared lock), a session can either set it to VI_NULL so that VISA generates an accessKey for the session, or the session can suggest an accessKey to use for the shared lock. |
| accessKey | This parameter should be set to VI_NULL when lockType is VI_EXCLUSIVE_LOCK (exclusive lock). When trying to lock the resource as VI_SHARED_LOCK (shared lock), the resource returns a unique access key for the lock if the operation succeeds. This accessKey can then be passed to other sessions to share the lock. |
https://helpfiles.keysight.com/IO_Libraries_Suite/English/IOLS_Linux/VISA/Content/visa/viLock.htm
| delegate int OpenTap.VisaFunctions.ViOpenDefaultRmDelegate | ( | out int | sesn | ) |
This function returns a session to the Default Resource Manager resource. This function must be called before any VISA functions can be invoked. The first call to this function initializes the VISA system, including the Default Resource Manager resource, and also returns a session to that resource. Subsequent calls to this function return unique sessions to the same Default Resource Manager resource.
| sesn | Unique logical identifier to a Default Resource Manager session. |
| delegate int OpenTap.VisaFunctions.ViOpenDelegate | ( | int | sesn, |
| string | viDesc, | ||
| int | accessMode, | ||
| int | timeout, | ||
| out int | vi ) |
This function opens a session to the specified device. It returns a session identifier that can be used to call any other functions to that device.
| sesn | Resource Manager session (should always be the Default Resource Manager for VISA returned from VisaFunctions.ViOpenDefaultRmRef). |
| viDesc | Unique symbolic name (VISA address) of a resource. Can also be a VISA alias (defined in the Keysight Connection Expert utility). |
| accessMode | Specifies the modes by which the resource is to be accessed. The value VI_EXCLUSIVE_LOCK 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 VI_LOAD_CONFIG value is used to configure attributes specified by some external configuration utility. If this value is not used, the session uses the default values provided by this specification. Multiple access modes can be used simultaneously by specifying a "bit-wise OR" of the values. (Must use VI_NULL in VISA 1.0.) |
| timeout | If the accessMode parameter requires a lock, this parameter specifies the absolute time period (in milliseconds) that the resource waits to get unlocked before this operation returns an error. Otherwise, this parameter is ignored. (Must use VI_NULL in VISA 1.0.) Note: The timeout parameter affects ONLY the LOCK; it does not impact the overall viOpen command timing. |
| vi | Unique logical identifier reference to a session. |
https://helpfiles.keysight.com/IO_Libraries_Suite/English/IOLS_Linux/VISA/Content/visa/viOpen.htm
| delegate int OpenTap.VisaFunctions.ViParseRsrcDelegate | ( | int | sesn, |
| string | desc, | ||
| ref short | intfType, | ||
| ref short | intfNum ) |
Parse a resource string to get the interface information. This operation parses a resource string to verify its validity. It should succeed for all strings returned by viFindRsrc and recognized by viOpen. This operation is useful if you want to know what interface a given resource descriptor would use without actually opening a session to it.
| sesn | Resource Manager session (should always be the Default Resource Manager for VISA returned from VisaFunctions.ViOpenDefaultRmRef). |
| desc | Unique symbolic name (VISA address or VISA alias) of a resource. |
| intfType | Interface type of the given resource string. |
| intfNum | Board number of the interface of the given resource string. |
| delegate int OpenTap.VisaFunctions.ViParseRsrcExDelegate | ( | int | sesn, |
| string | desc, | ||
| ref short | intfType, | ||
| ref short | intfNum, | ||
| StringBuilder | rsrcClass, | ||
| StringBuilder | expandedUnaliasedName, | ||
| StringBuilder | aliasIfExists ) |
This function parses a resource string to get extended interface information. It should succeed for all strings returned by viFindRsrc and recognized by viOpen. This operation is useful if you want to know what interface a given VISA address (resource descriptor) would use without actually opening a session to it.
| sesn | Resource Manager session (should always be the Default Resource Manager for VISA returned from VisaFunctions.ViOpenDefaultRmRef). |
| desc | Unique symbolic name of a resource. |
| intfType | Interface type of the given resource string. |
| intfNum | Board number of the interface of the given resource string. |
| rsrcClass | Specifies the resource class (for example, “INSTR”) of the given resource string, as defined in VISA Resource Classes. |
| expandedUnaliasedName | This is the expanded version of the given resource string. The format should be similar to the VISA-defined canonical resource name. |
| aliasIfExists | Specifies the user-defined alias for the given resource string, if a VISA implementation allows aliases and an alias exists for the given resource string. |
| delegate int OpenTap.VisaFunctions.ViReadDelegate | ( | int | vi, |
| ArraySegment< byte > | buffer, | ||
| int | count, | ||
| out int | retCount ) |
This function synchronously transfers data from a device. The data that is read is stored in the buffer represented by buf. This function returns only when the transfer terminates. Only one synchronous read function can occur at any one time.
| vi | Unique logical identifier to a session. |
| buffer | Represents the location of a buffer to receive data from device. |
| count | Number of bytes to be read. |
| retCount | Represents the location of an integer that will be set to the number of bytes actually transferred. |
https://helpfiles.keysight.com/IO_Libraries_Suite/English/IOLS_Linux/VISA/Content/visa/viRead.htm
| delegate int OpenTap.VisaFunctions.ViReadStbDelegate | ( | int | vi, |
| ref short | status ) |
Read a status byte of the service request. This operation reads a service request status from a service requester (the message-based device). For example, on the IEEE 488.2 interface, the message is read by polling devices. For other types of interfaces, a message is sent in response to a service request to retrieve status information.
| vi | Unique logical identifier to the session. |
| status | Service request status byte. |
https://helpfiles.keysight.com/IO_Libraries_Suite/English/IOLS_Linux/VISA/Content/visa/viReadSTB.htm
| delegate int OpenTap.VisaFunctions.ViSetAttributeBDelegate | ( | int | vi, |
| int | attrName, | ||
| byte | attrValue ) |
This function sets the state of an attribute for the specified session. The viSetAttribute operation is used to modify the state of an attribute for the specified session, event, or find list.
| vi | Unique logical identifier to a session, event, or find list. |
| attrName | Resource attribute for which the state is modified. |
| attrValue | The state of the attribute to be set for the specified resource. The interpretation of the individual attribute value is defined by the resource. |
| delegate int OpenTap.VisaFunctions.ViStatusDescDelegate | ( | int | vi, |
| int | status, | ||
| StringBuilder | desc ) |
This function returns a user-readable string that describes the status code passed to the function. If a status code cannot be interpreted by the session, viStatusDesc returns the warning VI_WARN_UNKNOWN_STATUS.
| vi | Unique logical identifier to a session, event, or find list. |
| status | Status code to interpret. |
| desc | The user-readable string interpretation of the status code passed to the function. Must be at least 256 characters to receive output. |
| delegate int OpenTap.VisaFunctions.ViUninstallHandlerDelegate | ( | int | vi, |
| int | eventType, | ||
| ViEventHandler | handler, | ||
| int | userHandle ) |
This function allows applications to uninstall handlers for events on sessions. Applications should also specify the value in the userHandle parameter that was passed to viInstallHandler while installing the handler. VISA identifies handlers uniquely using the handler reference and the userHandle. All the handlers or which the handler reference and the userHandle matches are uninstalled.
| vi | Unique logical identifier to a session. |
| eventType | Logical event identifier. |
| handler | Interpreted as a valid reference to a handler to be uninstalled by an application. |
| userHandle | A value specified by an application that can be used for identifying handlers uniquely in a session for an event. |
| delegate int OpenTap.VisaFunctions.ViUnlockDelegate | ( | int | vi | ) |
This function is used to relinquish a lock previously obtained using the VisaFunctions.ViLockRef function.
| vi | Unique logical identifier to a session. |
https://helpfiles.keysight.com/IO_Libraries_Suite/English/IOLS_Linux/VISA/Content/visa/viUnlock.htm
| delegate int OpenTap.VisaFunctions.ViWaitOnEventDelegate | ( | int | vi, |
| int | eventType, | ||
| int | timeout, | ||
| out int | outEventType, | ||
| IntPtr | outContext ) |
This function waits for an occurrence of the specified event for a given session. In particular, this function suspends execution of an application thread and waits for an event inEventType for at least the time period specified by timeout.
| vi | Unique logical identifier to a session. |
| eventType | Logical identifier of the event(s) to wait for. |
| timeout | Absolute time period in time units that the resource shall wait for a specified event to occur before returning the time elapsed error. The time unit is in milliseconds. |
| outEventType | Logical identifier of the event actually received. |
| outContext | A handle specifying the unique occurrence of an event. |
| delegate int OpenTap.VisaFunctions.ViWriteDelegate | ( | int | vi, |
| ArraySegment< byte > | buffer, | ||
| int | count, | ||
| out int | retCount ) |
This function synchronously transfers data to a device. The data to be written is in the buffer represented by buf. This function returns only when the transfer terminates. Only one synchronous write function can occur at any one time. If you pass VI_NULL as the retCount parameter to the viWrite operation, the number of bytes transferred will not be returned. This may be useful if it is important to know only whether the operation succeeded or failed.
| vi | Unique logical identifier of a session. |
| buffer | Represents the location of a data block to be sent to device. |
| count | Specifies number of bytes to be written. |
| retCount | Represents the location of an integer that will be set to the number of bytes actually transferred. |
https://helpfiles.keysight.com/IO_Libraries_Suite/English/IOLS_Linux/VISA/Content/visa/viWrite.htm
OpenTAP 9.34 API built Wed Jul 1 2026 09:21:15