Admin Production ni-theme
Current Publication

Ivi_SetSpecificDriverSession

IVI Compliance Package

Ivi_SetSpecificDriverSession

Usage

ViStatus Ivi_SetSpecificDriverSession (ViSession vi, ViSession specificDriverSession);

Purpose

This function specifies the specific driver session that is associated with the class driver session.

Use this function after initializing the specific driver to associate the specific driver session with the class driver session. Use the Ivi_GetSpecificDriverSession function to obtain the specific driver session in subsequent class driver function calls.

Parameters

Input
Name Type Description
vi ViSession The ViSession handle that you obtain from Ivi_SpecificDriverNew. The handle identifies a particular IVI session.
specificDriverSession ViSession Returns a ViSession handle that you use to identify the session in subsequent function calls.

This function creates a new session each time you invoke it.

This is useful if you have multiple physical instances of the same type of instrument.

Avoid creating multiple concurrent sessions to the same physical instrument. Although you can create more than one IVI session for the same resource, it is best not to do so. A better approach is to use same session in multiple execution threads. You can use the Ivi_LockSession and Ivi_UnlockSession functions to protect sections of code that require exclusive access to the resource.

Return Value

Contains the status code that the function call returns. IVI engine functions can return error and warning values from several sets of status codes. Some status codes are unique to the IVI engine. Other status codes are the same codes that VISA Library functions return. Still others are error or warning values that functions in specific instrument drivers return. Each set of status codes has its own numeric range.

Regardless of the source of the status code, 0 always indicates success, a positive value indicates a warning, and a negative value indicates an error.

Related Topic

IVI Status Codes