ViStatus pi40iv_InitWithOptions (ViRsrc resourceName, ViBoolean IDQuery, ViBoolean resetDevice, ViString optionString, ViPSession instrumentHandle);
This function performs the following initialization actions:
- Creates a new IVI instrument driver and optionally sets the initial state of the following session attributes:
PI40IV_ATTR_RANGE_CHECK
PI40IV_ATTR_QUERY_INSTR_STATUS
PI40IV_ATTR_CACHE
PI40IV_ATTR_SIMULATE
PI40IV_ATTR_RECORD_COERCIONS
- Opens a session to the specified device using the interface and address you specify for the Resource Name parameter.
- If the ID Query parameter is set to VI_TRUE, this function queries the instrument ID and checks that it is valid for this instrument driver.
- If the Reset parameter is set to VI_TRUE, this function resets the instrument to a known state.
- Sends initialization commands to set the instrument to the state necessary for the operation of the instrument driver.
- Returns a ViSession handle that you use to identify the instrument in all subsequent instrument driver function calls.
Note: 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 pi40iv_LockSession and pi40iv_UnlockSession functions to protect sections of code that require exclusive access to the resource.
Input | ||
Name | Type | Description |
resourceName | ViRsrc |
Pass the resource name of the device to initialize.
|
IDQuery | ViBoolean |
Specify whether you want the instrument driver to perform an ID Query.
|
resetDevice | ViBoolean |
Specify whether you want the to reset the instrument during the initialization procedure.
|
optionString | ViString |
You can use this control to set the initial value of certain attributes for the session. The following table lists the attributes and the name you use in this parameter to identify the attribute.
|
Output | ||
Name | Type | Description |
instrumentHandle | ViSession (passed by reference) |
Returns a ViSession handle that you use to identify the instrument in all subsequent instrument driver function calls.
|
Name | Type | Description |
status | ViStatus |
Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. You examine the status code from each call to an instrument driver function to determine if an error occurred.
|
Pickering Interfaces PXI/LXI IVI Switch
Alphabetical Function Index
Hierarchical Function Index