|Download Help (Windows Only)|
To form the ClassPrefix_ of the function name, use the prefix of the class driver with which you are working. For example, if you are working with the IviDmm class driver, use the prefix IviDmm_ to create the correct function name, IviDmm_InitWithOptions.
ViStatus ClassPrefix_InitWithOptions (ViRsrc logicalName, ViBoolean IDQuery,ViBoolean resetDevice,ViConstString optionString,ViSession*vi);
This function performs the following initialization actions:
|Note 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. You can use the same session in multiple execution threads. You can use the ClassPrefix_LockSession and the ClassPrefix_UnlockSession functions to protect sections of code that require exclusive access to the resource.|
|Caution All IVI names, such as logical names or virtual names, are case-sensitive. If you use logical names, driver session names, or virtual names in your program, you must make sure that the name you use matches the name in the IVI Configuration Store file exactly, without any variations in the case of the characters in the name.|
|logicalName||ViRsrc||Pass the logical name that identifies the particular driver session to use. The driver session, in turn, identifies a specific driver and device and specifies the initial settings for the session. You configure the logical name, driver session, specific driver, and device in MAX.
If you want to use your program with a different physical instrument, you change the configuration of the logical name to use the driver session for the new physical instrument. You can change the initial settings for the session by changing the configuration of the driver session.
Default Value: "SampleClassPrefix"
|IDQuery||ViBoolean||Specify whether you want the instrument driver to perform an ID Query.
VI_TRUE (1)Perform ID Query (Default Value)
VI_FALSE (0)Skip ID Query
When you set this parameter to VI_TRUE, the driver verifies that the instrument you initialize is a type that this driver supports.
Circumstances can arise where it is undesirable to send an ID Query command string to the instrument. When you set this parameter to VI_FALSE, the function initializes the instrument without performing an ID Query.
|resetDevice||ViBoolean||Specify whether you want to reset the instrument during the initialization procedure.
VI_TRUE (1)Reset Device (Default Value)
VI_FALSE (0)Don't Reset
|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.
The format of this string is "AttributeName=Value" where AttributeName is the name of the attribute and Values is the value to which the attribute is set. 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 values that you configure in MAX. You can override the values from MAX by assigning a value explicitly in a string you pass for this parameter. You do not have to specify all of the attributes and may leave any of them out. If you do not specify one of the attributes, the driver uses the value stored in MAX.
The following are the valid values for ViBoolean attributes:
True: 1, TRUE, or VI_TRUE
False: 0, FALSE, or VI_FALSE
|vi||ViSession||The instrument handle that you obtain from the ClassPrefix_init or ClassPrefix_InitWithOptions functions. The handle identifies a particular IVI session.|