niFgen_InitializeWithChannels
- Updated2023-02-21
- 4 minute(s) read
ViStatus niFgen_InitializeWithChannels (ViRsrc resourceName, ViConstString channelName, ViBoolean resetDevice, ViConstString optionString, ViSession *vi);
Purpose
Creates and returns a new NI-FGEN session to the specified channel of a waveform generator that is used in all subsequent NI-FGEN function calls.
Parameters
Input | |||||||||||||||||||||||||
Name | Type | Description | |||||||||||||||||||||||
resourceName | ViRsrc | Specifies the resource name of the device to initialize.
For NI-DAQmx devices, the syntax is just the device name specified in MAX, as shown in Example 1. Typical default names for NI-DAQmx devices in MAX are An alternate syntax for NI-DAQmx devices consists of DAQ::NI-DAQmx device name, as shown in Example 2. 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 3. 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 4. A logical name identifies a particular virtual instrument. A virtual name identifies a specific device and specifies the initial settings for the session.
|
|||||||||||||||||||||||
channelName | ViConstString | Specifies the channel that this VI uses.
Default Value: "0" |
|||||||||||||||||||||||
resetDevice | ViBoolean | Specifies whether you want to reset the device during the initialization procedure. VI_TRUE specifies that the device is reset and performs the same function as the niFgen_reset function.
Defined Values
Default Value: VI_FALSE |
|||||||||||||||||||||||
optionString | ViConstString |
Sets the initial value of certain session attributes.
The syntax for optionString is <attributeName> = <value> where attributeName is the name of the attribute and value is the value to which the attribute is set To set multiple attributes, separate them with a comma. If you pass NULL or an empty string for this parameter, the session uses the default values for these attributes. You can override the default values by assigning a value explicitly in a string that you pass for this parameter. You do not have to specify all of the attributes and may leave any of them out. However, if you do not specify one of the attributes, its default value is used. If simulation is enabled (Simulate=1), you may specify the device that you want to simulate. To specify a device, enter the following syntax in optionString. DriverSetup=Model:<driver model number>;Channels:<channel names>;BoardType:<module type>;MemorySize:<size of onboard memory in bytes> Syntax Examples
Attributes and Defined Values
Default Values: "Simulate=0,RangeCheck=1,QueryInstrStatus=1,Cache=1" |
|||||||||||||||||||||||
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:
|