Ivi_ClassDriverNew
Usage
ViStatus Ivi_ClassDriverNew (ViChar logicalName[], ViChar classPrefix[], ViString functionList[], ViSession vi);
Purpose
This function performs the following initialization actions:
- Creates a new IVI session to an IVI class driver and initializes the class driver to the settings specified in the IVI configuration store as follows:
- Sets the IVI_ATTR_USE_SPECIFIC_SIMULATION attribute to VI_FALSE if the logical name item maps to a driver session item that is configured to use a class simulation driver.
- Loads the specific driver through the COM Adaptor if, for the software module item referenced by the logical name (or driver session):
- The software module path field is empty but the progID field is non-empty
- Both the module path and progID fields are non-empty, and the
- Returns a ViSession handle which you use in subsequent function calls to identify the class driver session.
This function creates a new session each time you invoke it.
Although you can open more than one IVI session for the same resource, it is best not to do so. You can use the same session in multiple program threads. You can use the Ivi_LockSession and Ivi_UnlockSession functions to protect sections of code that require exclusive access to the resource.
Use the Ivi_DisposeSession function to dispose the session.
Parameters
Input | ||
Name | Type | Description |
---|---|---|
logicalName | ViChar[] | This parameter specifies the logical name item in the IVI configuration store that references the IVI specific driver, drivers session settings, and the hardware resources needed to initialize an IVI class driver. Use NI Measurement & Automation Explorer (MAX) to create and configure IVI logical names in the IVI configuration store. You may pass the name of an IVI driver session item instead of a logical name. However, using logical names is recommended because applications that use a logical names facilitate interchangeability by allowing you to interchange instruments without needing to rebuild the application. |
classPrefix | ViChar[] | Specifies the class prefix of the class driver. This value corresponds to the function prefix of the class driver API. for example, for a class driver complaint with the standard IVI-DMM class specification, the class prefix is "IviDmm". All class drivers functions then begin with this class prefix. The IVI engine sets the value of the IVI_ATTR_CLASS_DRIVER_PREFIX attribute to this value. The IVI engine uses this value to find and initialize the appropriate COM Adapter if the logical name references an IVI-COM specific driver. |
functionList | ViString[] | Specifies the names of all functions that the class driver looks for in any specific driver that complies with the class API. This list should include the inherent, class base capability group, and all class extension capability group functions defined by the IVI class specification. |
Output | ||
Name | Type | Description |
vi | 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 are using multiple specific drivers for the same IVI class. 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 the 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.