niFgen_init
ViStatus niFgen_init (ViRsrc resourceName, ViBoolean idQuery, ViBoolean resetDevice, ViSession* vi);
Purpose
Performs the following initialization actions:
- Creates a new IVI instrument driver session.
- Opens a session to the specified device using the interface and address that you specify for the resourceName parameter.
- If the IDQuery parameter is set to VI_TRUE, this function queries the device ID and checks that the ID is valid for NI-FGEN.
- If the resetDevice parameter is set to VI_TRUE, this function resets the device to a known state.
- Sends initialization commands to set the device to the state necessary for the operation of NI-FGEN.
- Returns a session handle that you can use to identify the device in all subsequent NI-FGEN function calls.
Parameters
Input | |||||||||||||||||||||||||||||
Name | Type | Description | |||||||||||||||||||||||||||
resourceName | ViRsrc | Specifies the resource name of the device to initialize.
For Traditional NI-DAQ devices, the syntax is DAQ::n, where n is the device number assigned by MAX, as shown in Example 1. For NI-DAQmx devices, the syntax is just the device name specified in MAX, as shown in Example 2. Typical default names for NI-DAQmx devices in MAX are Dev1 or PXI1Slot1. You can rename an NI-DAQmx device by right-clicking on the name in MAX and entering a new name. An alternate syntax for NI-DAQmx devices consists of DAQ::NI-DAQmx device name, as shown in Example 3. This naming convention allows for the use of an NI-DAQmx device in an application that was originally designed for a Traditional NI-DAQ device. For example, if the application expects DAQ::1, you can rename the NI-DAQmx device to 1 in MAX and pass in DAQ::1 for the resource name, as shown in Example 4. If you use the DAQ::n syntax and an NI-DAQmx device name already exists with that same name, the NI-DAQmx device is matched first. You can also pass in the name of an IVI logical name or an IVI virtual name configured with the IVI Configuration utility, as shown in Example 5. A logical name identifies a particular virtual instrument. A virtual name identifies a specific device and specifies the initial settings for the session.
|
|||||||||||||||||||||||||||
idQuery | ViBoolean | Specifies whether you want NI-FGEN to perform an ID query.
When you set this parameter to VI_TRUE, NI-FGEN verifies that the device that you initialize is supported. Circumstances can arise where sending an ID query to the device is undesirable. When you set this parameter to VI_FALSE, the function initializes the device without performing an ID query. Defined Values
Default Value: VI_TRUE |
|||||||||||||||||||||||||||
resetDevice | ViBoolean | Specifies whether you want to reset the device during the initialization procedure.
Defined Values
Default Value: VI_TRUE |
|||||||||||||||||||||||||||
Output | |||||||||||||||||||||||||||||
Name | Type | Description | |||||||||||||||||||||||||||
vi | ViSession* | Returns a session handle that you can use to identify the device in all subsequent NI-FGEN function calls. |
Return Value
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 can examine the status code from each call to an NI-FGEN function to determine if an error occurred.
To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function. The general meaning of the status code is as follows:
|