niDMM_InitWithOptions
ViStatus = niDMM_InitWithOptions(ViString Resource_Name, ViBoolean ID_Query, ViBoolean Reset_Device, ViString Option_String, ViSession* Instrument_Handle)
Purpose
This function completes the following tasks:
- Creates a new IVI instrument driver session and, optionally, sets the initial state of the following session attributes: RangeCheck, QueryInstrStatus, Cache, Simulate, Recordcoercions.
- Opens a session to the device 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_Device 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.
Parameters
Input | ||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||
Resource_Name | ViString | Contains the Resource_Name of the device to initialize. The Resource_Name is assigned in Measurement & Automation Explorer (MAX).
Refer to Related Documentation for the NI Digital Multimeters Getting Started Guide for more information about configuring and testing the DMM in MAX. Valid Syntax:
|
||||||||||||||||||||||||
ID_Query | ViBoolean | Verifies that the
device you initialize is one that the driver supports. NI-DMM
automatically performs this query, so setting this parameter is not necessary. Defined Values:
|
||||||||||||||||||||||||
Reset_Device | ViBoolean | Specifies whether to reset the instrument during the initialization procedure. Defined Values:
|
||||||||||||||||||||||||
Option_String | ViString | Sets the initial value of certain attributes for the session. The following table specifies the attribute name, attribute constant, and default value for each attribute that you can use in this parameter:
The format of this string is, "AttributeName=Value." To set multiple attributes, separate their assignments with a comma. If you pass NULL or an empty string for this parameter, the session uses the default values for the attributes. You can override the default values by assigning a value explicitly in an Option_String parameter. You do not have to specify all of the attributes and may leave any of them out (those left out use the default value). Refer to Simulating NI Digital Multimeters for more information. |
||||||||||||||||||||||||
Output | ||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||
Instrument_Handle | ViSession* | Returns a ViSession handle that you use to identify the instrument in all subsequent instrument driver function calls. |
Return Value
Name | Type | Description |
Status | ViStatus | Reports the Status of this operation. To obtain a text description of the status code, call niDMM_error_message. To obtain additional information concerning the error condition, use niDMM_GetError. |