NI DAQMX Advanced Functions - ni/grpc-device GitHub Wiki

Advanced Functions

Real-Time

DAQmxWaitForNextSampleClock

int32 DAQmxWaitForNextSampleClock (TaskHandle taskHandle, float64 timeout, bool32 *isLate);

Purpose

Waits until the next pulse of the Sample Clock occurs. If an extra Sample Clock pulse occurs between calls to this function, the second call returns an error or warning and waits for the next Sample Clock pulse. Use the get/set/reset functions for the RealTimeConvLateErrorsToWarnings property to specify whether this function returns errors or warnings.

Use this function to ensure I/O cycles complete within Sample Clock periods. National Instruments recommends you use this function for certain applica tions only.

Use the [DAQmx Real-Time](mxcprop.chm::/AttributeClassReal- Time.html) properties to configure error reporting and waiting options.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
timeout float64 The maximum amount of time, in seconds, to wait for the next Sample Clock pulse. If the time elapses, this VI returns an error. The default timeout is 10 seconds. If you set timeout to -1, this VI waits indefinitely.
Output
Name Type Description
isLate int32 A value of 0 indicates the read or write function executed in real time. A value of 1 indicates the function did not execute in real time.

Return Value

Name Type Description
isLate int32 Indicates if this function detected an extra Sample Clock pulse after the specified number of warmup iterations execute. If you are using the C API, use DAQmxSetRealTimeNumOfWarmupIters to specify the number of warmup iterations. If you are using the CVI API, use DAQmxSetRealTimeAttribute to specify the number of iterations. This output is always FALSE until that number of loop iterations execute.

Obsolete

This function is obsolete and now always returns zero. The information below no longer applies but is provided for reference.

Signal Routing

DAQmxConnectTerms

int32 DAQmxConnectTerms (const char sourceTerminal[], const char destinationTerminal[], int32 signalModifiers);

Purpose

Creates a route between a source and destination terminal. The route can carry a variety of digital signals, such as triggers, clocks, and hardware events.

These source and destination terminals can be on different devices as long as a connecting public bus, such as RTSI or the PXI backplane, is available. DAQmxConnectTerms does not modify a task. When DAQmxConnectTerms runs, the route is immediately reserved and committed to hardware. This type of routing is called immediate routing.

Parameters

Input
Name Type Description
sourceTerminal const char [] The originating terminal of the route. You can specify a terminal name.
destinationTerminal const char [] The receiving terminal of the route. You can specify a terminal name.
signalModifiers int32 Specifies whether or not to invert the signal routed from the sourceTerminal to the destinationTerminal. If the device is not capable of signal inversion or if a previous route reserved the inversion circuitry in an incompatible configuration, attempting to invert the signal causes an error.
Value Description
DAQmx_Val_DoNotInvertPolarity Do not invert the signal.
DAQmx_Val_InvertPolarity Invert the signal.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxDisconnectTerms

int32 DAQmxDisconnectTerms (const char sourceTerminal[], const char destinationTerminal[]);

Purpose

Removes signal routes previously created using DAQmxConnectTerms. DAQmxDisconnectTerms cannot remove task-based routes, such as those created through timing and triggering configuration.

When this function executes, the route is unreserved immediately. For this reason, this type of routing is called immediate routing.

Parameters

Input
Name Type Description
sourceTerminal const char [] The originating terminal of the route. You can specify a terminal name.
destinationTerminal const char [] The receiving terminal of the route. You can specify a terminal name.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxTristateOutputTerm

int32 DAQmxTristateOutputTerm (const char outputTerminal[]);

Purpose

Sets a terminal to high-impedance state. If you connect an external signal to a terminal on the I/O connector, the terminal must be in high-impedance state. Otherwise, the device could double-drive the terminal and damage the hardware. If you use this function on a terminal in an active route, the function fails and returns an error.

DAQmxResetDevice sets all terminals on the I/O connector to high-impedance state but aborts any running tasks associated with the device.

Parameters

Input
Name Type Description
outputTerminal const char [] The terminal on the I/O connector to set to high-impedance state. You can specify a terminal name.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

Device Control

DAQmxResetDevice

int32 DAQmxResetDevice (const char deviceName[]);

Purpose

Immediately aborts all tasks associated with a device and returns the device to an initialized state. Aborting a task stops and releases any resources the task reserved.

This function does not wait for the device to reset before continuing execution. When resetting a chassis, attached modules are unavailable. If you attempt to reset an attached module during this time, you will receive an error.

Parameters

Input
Name Type Description
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxSelfTestDevice

int32 DAQmxSelfTestDevice (const char deviceName[]);

Purpose

Causes a device to self-test.

Parameters

Input
Name Type Description
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxCfgWatchdogAOExpirStates

DAQmxCfgWatchdogAOExpirStates(TaskHandle taskHandle, const char channelNames[], const float64 expirStateArray[], const int32 outputTypeArray[], uInt32 arraySize);

Purpose

Configures the analog output channel expiration states for a watchdog timer task.

Parameters

Input
Name Type Description
calHandle CalHandle A reference to the calibration session that you created using the DAQmxInitExtCal function.
channelNames const char [] A string specifying a list or range of physical channel(s) to use.
expirStateArray float64 [] The array containing the values to set the channels to upon expiration. The units of this parameter must be specified in volts for an analog output voltage expiration state, or amps for an analog output current expiration state. Each element of the array corresponds to the channels specified in channelNames and elements of outputTypeArray.
outputTypeArray int32 [] The array containing the output types of the physical channels. Each element of the array corresponds to the channels specified in channelNames and elements of expirStateArray.
Value Description
DAQmx_Val_Voltage Voltage output.
DAQmx_Val_Current Current output.
DAQmx_Val_NoChange Expiration does not affect the port. Do not change the state of any lines in the port, and do not lock the port.
arraySize uInt32 The size of expirStateArray and outputTypeArray. This must correspond to the number of channels specified in channelNames.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxCfgWatchdogCOExpirStates

DAQmxCfgWatchdogCOExpirStates(TaskHandle taskHandle, const char channelNames[], const int32 expirStateArray[], uInt32 arraySize);

Purpose

Configures the counter output channel expiration states for a watchdog timer task.

Parameters

Input
Name Type Description
calHandle CalHandle A reference to the calibration session that you created using the DAQmxInitExtCal function.
channelNames const char [] A string specifying a list or range of physical channel(s) to use.
expirStateArray int32 [] The array containing the states to set the corresponding channels to when the watchdog timer expires. Each element of the array corresponds to the channels specified in channelNames.
Value Description
DAQmx_Val_High High logic.
DAQmx_Val_Low Low logic.
DAQmx_Val_NoChange Expiration does not affect the state of the counter output. The channels retain their states at the time of the watchdog timer expiration, and no further counter generation runs.
arraySize uInt32 The size of expirStateArray. This must correspond to the number of channels specified in channelNames.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxCfgWatchdogDOExpirStates

DAQmxCfgWatchdogDOExpirStates(TaskHandle taskHandle, const char channelNames[], const int32 expirStateArray[], uInt32 arraySize);

Purpose

Configures the digital output channel expiration states for a digital watchdog timer task created with DAQmxCreateWatchdogTimerTaskEx. You can also create a task with digital expiration states configured by using DAQmxCreateWatchdogTimerTask

Parameters

Input
Name Type Description
calHandle CalHandle A reference to the calibration session that you created using the DAQmxInitExtCal function.
channelNames const char [] A string specifying a list or range of physical channel(s) to use.
expirStateArray int32 [] The array containing the digital states to set the corresponding channels to when the watchdog timer expires. Each element of the array corresponds to the channels specified in channelNames.
Value Description
DAQmx_Val_High High logic.
DAQmx_Val_Low Low logic.
DAQmx_Val_NoChange Expiration does not affect the port. Do not change the state of any lines in the port, and do not lock the port. For example, if a line is high when the timer expires, that line stays high, and you can write new values to the line. You can select this value only for entire ports.
DAQmx_Val_Tristate High-impedance state. You can select this state only on devices with bidirectional ports, and you can select it only for entire ports. You cannot select this state for dedicated digital output lines.
arraySize uInt32 The size of expirStateArray. This must correspond to the number of channels specified in channelNames.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxControlWatchdogTask

int32 DAQmxControlWatchdogTask (TaskHandle taskHandle, int32 action);

Purpose

Controls the watchdog task according to the action you specify.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
action int32 Specifies how to control the watchdog task.
Value Description
DAQmx_Val_ResetTimer Resets the internal timer to 0. You must continually reset the internal timer to prevent it from timing out and locking out the device.
DAQmx_Val_ClearExpiration Unlocks a device whose watchdog expired.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxCreateWatchdogTimerTask

int32 DAQmxCreateWatchdogTimerTask (const char deviceName[], const char taskName[], TaskHandle *taskHandle, float64 timeout, const char channelName[], int32 expState, ...);

Purpose

Creates and configures a task that controls the watchdog timer of a device. The timer activates when you start the task. This function sets digital physical channel expiration states. If your device supports expiration states for other channel types or you do not want to set initial expiration states, use the DAQmxCreateWatchdogTimerTaskEx function.

Parameters

Input
Name Type Description
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.
taskName const char [] The name to assign to the task. If you use this function in a loop and specify a name for the task, you must use DAQmxClearTask within the loop after you are finished with the task. Otherwise, NI-DAQmx attempts to create multiple tasks with the same name, which results in an error.
timeout float64 The time, in seconds, until the watchdog timer expires. A value of DAQmx_Val_WaitInfinitely indicates that the internal timer never expires. Use DAQmx_Val_WaitInfinitely when you use a trigger to signal an expiration of the timer. If this time elapses, the device sets the physical channels to the states you specify in expState.
Use DAQmxControlWatchdogTask with action set to DAQmx_Val_ResetTimer to prevent the watchdog timer from expiring.
channelName const char [] The digital line or port to modify. You cannot modify dedicated digital input lines. You can specify a list or range of physical channels
expState int32 The state to which to set the digital physical channel when the watchdog timer expires.
Value Description
DAQmx_Val_High High logic
DAQmx_Val_Low Low logic
DAQmx_Val_Tristate High-impedance state. You can select this state only on devices with bidirectional ports, and you can select it only for entire ports. You cannot select this state for dedicated digital output lines.
DAQmx_Val_NoChange Expiration does not affect the port. Do not change the state of any lines in the port, and do not lock the port. For example, if a line is high when the timer expires, that line stays high, and you can write new values to the line. You can select this value only for entire ports.
moreChannelsAndStates any type (passed by value) Pairs of additional channels and the states to set the channels to when the device powers up or when the device is reset. You must pass NULL at the end of the argument list.
If you do not want to pass additional channels and states, the function call can be similar to the following example:
DAQmxCreateWatchdogTimerTask ("Dev1", "myTask", &taskHandle, DAQmx_Val_WaitInfinitely, "Dev1/do0", DAQmx_Val_High, NULL);
If you pass additional channels and states, the function call can be similar to the following example:
DAQmxCreateWatchdogTimerTask ("Dev1", "myTask", &taskHandle, DAQmx_Val_WaitInfinitely, "Dev1/do0", DAQmx_Val_High, "Dev1/do1", DAQmx_Val_Tristate, NULL);
Output
taskHandle TaskHandle * A reference to the new task.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxCreateWatchdogTimerTaskEx

int32 DAQmxCreateWatchdogTimerTaskEx(const char deviceName[], const char taskName[], TaskHandle *taskHandle, float64 timeout);

Purpose

Creates a task that controls the watchdog timer of a device. The timer activates when you start the task. Use DAQmxCfgWatchdogAOExpirStates, DAQmxCfgWatchdogCOExpirStates, or DAQmxCfgWatchdogDOExpirStates to configure expiration states for the appropriate output type.

Parameters

Input
Name Type Description
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.
taskName const char [] The name to assign to the task. If you use this function in a loop and specify a name for the task, you must use DAQmxClearTask within the loop after you are finished with the task. Otherwise, NI-DAQmx attempts to create multiple tasks with the same name, which results in an error.
timeout float64 The time, in seconds, until the watchdog timer expires. A value of DAQmx_Val_WaitInfinitely indicates that the internal timer never expires. Use DAQmx_Val_WaitInfinitely when you use a trigger to signal an expiration of the timer. If this time elapses, the device sets the physical channels to the states you specify using DAQmxCfgWatchdogAOExpirStates, DAQmxCfgWatchdogCOExpirStates, or DAQmxCfgWatchdogDOExpirStates.
Use DAQmxControlWatchdogTask with action set to DAQmx_Val_ResetTimer to prevent the watchdog timer from expiring.
Output
taskHandle TaskHandle * A reference to the new task.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

Calibration

DAQmxGetAIChanCalCalDate

int32 DAQmxGetAIChanCalCalDate (TaskHandle taskHandle, const char channelName[], uInt32 *year, uInt32 *month, uInt32 *day, uInt32 *hour, uInt32 *minute);

Purpose

Indicates the last date and time that the channel underwent a channel calibration.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
channelName const char [] Name of the local or global channel to query calibration for.
Output
Name Type Description
year uInt32 * The last year that the channel underwent a channel calibration.
month uInt32 * The last month that the channel underwent a channel calibration.
day uInt32 * The last day that the channel underwent a channel calibration.
hour uInt32 * The last hour, on a 24-hour clock, that the channel underwent a channel calibration.
minute uInt32 * The last minute that the channel underwent a channel calibration.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxGetAIChanCalExpDate

int32 DAQmxGetAIChanCalExpDate (TaskHandle taskHandle, const char channelName[], uInt32 *year, uInt32 *month, uInt32 *day, uInt32 *hour, uInt32 *minute);

Purpose

Indicates the last date and time that the channel underwent an external channel calibration.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
channelName const char [] Name of the local or global channel to query calibration for.
Output
Name Type Description
year uInt32 * The last year that the channel underwent an external channel calibration.
month uInt32 * The last month that the channel underwent an external channel calibration.
day uInt32 * The last day that the channel underwent an external channel calibration.
hour uInt32 * The last hour, on a 24-hour clock, that the channel underwent an external channel calibration.
minute uInt32 * The last minute that the channel underwent an external channel calibration.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxSelfCal

int32 DAQmxSelfCal (const char deviceName[]);

Purpose

Measures the onboard reference voltage of the device and adjusts the self-calibration constants to account for any errors caused by short-term fluctuations in the operating environment. When you self-calibrate a device, no external signal connections are necessary.

Parameters

Input
Name Type Description
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxSetAIChanCalCalDate

int32 DAQmxSetAIChanCalCalDate (TaskHandle taskHandle, const char channelName[], uInt32 *year, uInt32 *month, uInt32 *day, uInt32 *hour, uInt32 *minute);

Purpose

Sets the date and time that the channel underwent a channel calibration.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
channelName const char [] Name of the local or global channel to calibrate.
year uInt32 The last year that the channel underwent a channel calibration.
month uInt32 The last month that the channel underwent a channel calibration.
day uInt32 The last day that the channel underwent a channel calibration.
hour uInt32 The last hour, on a 24-hour clock, that the channel underwent a channel calibration.
minute uInt32 The last minute that the channel underwent a channel calibration.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxSetAIChanCalExpDate

int32 DAQmxSetAIChanCalExpDate (TaskHandle taskHandle, const char channelName[], uInt32 *year, uInt32 *month, uInt32 *day, uInt32 *hour, uInt32 *minute);

Purpose

Sets the date and time that the channel underwent an external channel calibration.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
channelName const char [] Name of the local or global channel to calibrate.
year uInt32 The last year that the channel underwent an external channel calibration.
month uInt32 The last month that the channel underwent an external channel calibration.
day uInt32 The last day that the channel underwent an external channel calibration.
hour uInt32 The last hour, on a 24-hour clock, that the channel underwent an external channel calibration.
minute uInt32 The last minute that the channel underwent an external channel calibration.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

Storage

DAQmxDeleteSavedGlobalChan

int32 DAQmxDeleteSavedGlobalChan (const char channelName[]);

Purpose

Deletes the specified global virtual channel from MAX. This function does not remove the global virtual channel from tasks that use it.

Parameters

Input
Name Type Description
channelName const char [] Name of the global virtual channel to delete.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxDeleteSavedScale

int32 DAQmxDeleteSavedScale (const char scaleName[]);

Purpose

Deletes the specified custom scale from MAX. This function does not remove the custom scale from virtual channels that use it.

Parameters

Input
Name Type Description
scaleName const char [] Name of the custom scale to delete.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxDeleteSavedTask

int32 DAQmxDeleteSavedTask (const char taskName[]);

Purpose

Deletes the specified task from MAX. This function does not clear the copy of the task stored in memory. Use DAQmxClearTask to clear the copy of the task.

Parameters

Input
Name Type Description
taskName const char [] Name of the task to delete.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxSaveGlobalChan

int32 DAQmxSaveGlobalChan (TaskHandle taskHandle, const char channelName[], const char saveAs[], const char author[], uInt32 options);

Purpose

Saves the specified local or global virtual channel to MAX as a global virtual channel. You must specify both the local or global virtual channel to save and a task that contains that channel.

Programmatically saved global virtual channels cannot be viewed in the DAQ Assistant for versions of NI-DAQ earlier than 7.4. To view a programmatically saved global virtual channel in an earlier version of NI-DAQ, first use the DAQ Assistant in NI-DAQ 7.4 or later to save the global virtual channel.

Visit the DAQmx Professional Developer Tools website for more information and examples of programmatically saving global virtual channels.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task that contains the local or global virtual channel you want to save.
channelName const char [] Name of the local or global virtual channel to save.
saveAs const char [] Name to save the global virtual channel as. If you pass an empty string ("") or NULL, the name currently assigned to the global virtual channel will be used.
author const char [] Name to store with the global virtual channel.
options uInt32 Use this parameter to set certain options. You can combine options with the bitwise-OR operator ('
Value Description
DAQmx_Val_Save_Overwrite Overwrite a global virtual channel of the same name if one is already saved in MAX. If you do not set this flag and a global virtual channel of the same name is already saved in MAX, the function returns an error.
DAQmx_Val_Save_AllowInteractiveEditing Allow the global virtual channel to be edited in the DAQ Assistant. If you set this flag, the DAQ Assistant must support all global virtual channel settings.
DAQmx_Val_Save_AllowInteractiveDeletion Allow the global virtual channel to be deleted through MAX.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxSaveScale

int32 DAQmxSaveScale (const char scaleName[], const char saveAs[], const char author[], uInt32 options);

Purpose

Saves the specified custom scale to MAX.

Visit the DAQmx Professional Developer Tools website for more information and examples of programmatically saving global channels.

Parameters

Input
Name Type Description
scaleName const char [] Name of the custom scale to save.
saveAs const char [] Name to save the custom scale as. If you pass an empty string ("") or NULL, the name currently assigned to the scale is used.
author const char [] Name to store with the custom scale.
options uInt32 Use this parameter to set certain options. You can combine options with the bitwise-OR operator ('
Value Description
DAQmx_Val_Save_Overwrite Overwrite a custom scale of the same name if one is already saved in MAX. If you do not set this flag and a custom scale of the same name is already saved in MAX, the function returns an error.
DAQmx_Val_Save_AllowInteractiveEditing Allow the custom scale to be edited in the DAQ Assistant.
DAQmx_Val_Save_AllowInteractiveDeletion Allow the custom scale to be deleted through MAX.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxSaveTask

int32 DAQmxSaveTask (TaskHandle taskHandle, const char saveAs[], const char author[], uInt32 options);

Purpose

Saves the specified task and any local channels it contains to MAX. This function does not save global channels. Use DAQmxSaveGlobalChan to save global channels.

Programmatically saved tasks cannot be viewed in the DAQ Assistant for versions of NI-DAQ earlier than 7.4. To view a programmatically saved task in an earlier version of NI-DAQ, first use the DAQ Assistant in NI-DAQ 7.4 or later to save the task.

Visit the DAQmx Professional Developer Tools website for more information and examples of programmatically saving global channels.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task to save.
saveAs const char [] Name to save the task as. If you pass an empty string ("") or NULL, the name currently assigned to the task will be used.
author const char [] Name to store with the task.
options uInt32 Use this parameter to set certain options. You can combine options with the bitwise-OR operator ('
Value Description
DAQmx_Val_Save_Overwrite Overwrite a task of the same name if one is already saved in MAX. If you do not set this flag and a task of the same name is already saved in MAX, the function returns an error.
DAQmx_Val_Save_AllowInteractiveEditing Allow the task to be edited in the DAQ Assistant. If you set this flag, the DAQ Assistant must support all task settings.
DAQmx_Val_Save_AllowInteractiveDeletion Allow the task to be deleted through MAX.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

TEDS

DAQmxClearTEDS

int32 DAQmxClearTEDS (const char physicalChannel[]);

Purpose

Removes TEDS information from the physical channel you specify. This function temporarily overrides any TEDS configuration for the physical channel that you performed in MAX.

Parameters

Input
Name Type Description
physicalChannel const char[] The name of the physical channel you want to clear.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxConfigureTEDS

int32 DAQmxConfigureTEDS (const char physicalChannel[], const char filePath[]);

Purpose

Associates TEDS information with the physical channel you specify. If you do not specify the filename of a data sheet in the filePath parameter, this function attempts to find a TEDS sensor connected to the physical channel. This function temporarily overrides any TEDS configuration for the physical channel that you performed in MAX.

Parameters

Input
Name Type Description
physicalChannel const char [] The name of the physical channel you want to configure.
filePath const char [] The path to a Virtual TEDS data sheet that you want to associate with the physical channel. If you do not specify the filename of a data sheet, this function attempts to find a TEDS sensor connected to the physical channel.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxWriteToTEDSFromArray

int32 DAQmxWriteToTEDSFromArray (const char physicalChannel[], uInt8 bitstream[], uInt32 arraySize, int32 basicTEDSOptions);

Purpose

Writes TEDS data, stored as a 1D array of 8-bit unsigned integers, to the sensor connected to the physical channel you specify.

Parameters

Input
Name Type Description
physicalChannel const char [] The name of the physical channel you want to configure.
bitstream uInt8 Represents the TEDS bitstream to write to the sensor. This bitstream must be constructed according to the IEEE 1451.4 specification.
arraySize uInt32 Number of bytes in the bitstream.
basicTEDSOptions int32 Specifies how to handle basic TEDS data in the bitstream.
Value Description
Do Not Write Ignore basic TEDS data.
Write to EEPROM Write basic TEDS data to the EEPROM, even if the sensor includes a PROM. You cannot write basic TEDS data if the PROM contains data.
Write to PROM Write basic TEDS data to the PROM. Any subsequent attempts to write basic TEDS data result in an error.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxWriteToTEDSFromFile

int32 DAQmxWriteToTEDSFromFile (const char physicalChannel[], const char filePath[], int32 basicTEDSOptions);

Purpose

Writes TEDS data from a virtual TEDS file to the sensor connected to the physical channel you specify.

Parameters

Input
Name Type Description
physicalChannel const char [] The name of the physical channel you want to configure.
filePath const char [] Specifies the filename of a virtual TEDS file that contains the bitstream to write.
basicTEDSOptions int32 Specifies how to handle basic TEDS data in the bitstream.
Value Description
Do Not Write Ignore basic TEDS data.
Write to EEPROM Write basic TEDS data to the EEPROM, even if the sensor includes a PROM. You cannot write basic TEDS data if the PROM contains data.
Write to PROM Write basic TEDS data to the PROM. Any subsequent attempts to write basic TEDS data result in an error.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

Network DAQ Functions

DAQmxAddNetworkDevice

int32 DAQmxAddNetworkDevice (const char IPAddress[], const char deviceName[], bool32 attemptReservation, float64 timeout, char deviceNameOut[], uInt32 deviceNameOutBufferSize);

Purpose

Adds a Network cDAQ device to the system and, if specified, attempts to reserve it.

Parameters

Input
Name Type Description
IPAddress const char [] The IP address, in dotted decimal notation, of the device to add to the system.
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.
attemptReservation bool32 Indicates if a reservation should be attempted after the device is successfully added.
timeout float64 The time, in seconds, to wait for the device to respond before timing out.
Output
deviceNameOut const char [] The name of the device the operation is applied to.
deviceNameOutBufferSize uInt32 The size of the buffer of the specified device.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxDeleteNetworkDevice

int32 DAQmxDeleteNetworkDevice (const char deviceName[]);

Purpose

Deletes a Network DAQ device previously added to the host. If the device is reserved, it is unreserved before it is removed.

Parameters

Input
Name Type Description
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxReserveNetworkDevice

int32 DAQmxReserveNetworkDevice (const char deviceName[], bool32 overrideReservation);

Purpose

Reserves the Network DAQ device for the current host. Reservation is required to run NI-DAQmx tasks, and the device must be added in MAX before it can be reserved.

Note This functionality is performed implicitly for the NI 9163, so this function is not supported on the NI 9163 carrier.

Parameters

Input
Name Type Description
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.
overrideReservation bool32 Indicates if an existing reservation should be overridden by this reservation.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxUnreserveNetworkDevice

int32 DAQmxUnreserveNetworkDevice (const char deviceName[]);

Purpose

Unreserves or releases a Network DAQ device previously reserved by the host.

Parameters

Input
Name Type Description
deviceName const char [] Specifies the name to assign to the device. If unspecified, NI-DAQmx chooses the device name.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

CDAQ Sync Functions

DAQmxAddCDAQSyncConnection

int32 DAQmxAddCDAQSyncConnection(const char portList[]);

Purpose

Adds a cDAQ Sync connection between devices. The connection is not verified.

Parameters

Input
Name Type Description
portList const char [] Specifies the cDAQ Sync ports to connect.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxAreConfiguredCDAQSyncPortsDisconnected

int32 DAQmxAreConfiguredCDAQSyncPortsDisconnected(const char chassisDevicesPorts[], float64 timeout, bool32* disconnectedPortsExist);

Purpose

Verifies configured cDAQ Sync connections between devices. Failures generally indicate a wiring issue or that a device has been powered off or removed. Stop all NI-DAQmx tasks running on the devices prior to running this function because any running tasks cause the verification process to fail.

Note Verification toggles lines on ports during configuration.

Parameters

Input
Name Type Description
chassisDevicesPorts const char [] Specifies the names of the CompactDAQ chassis, C Series modules, or cDAQ Sync ports in comma separated form to search. If no names are specified, all cDAQ Sync ports on non-simulated devices are scanned.
timeout float64 The amount of time, in seconds, to wait for the device to respond before timing out. If a timeout occurs, no configuration is changed.
Output
Name Type Description
disconnectedPortsExist bool32 * Indicates if any port connections are unverified.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxAutoConfigureCDAQSyncConnections

int32 DAQmxAutoConfigureCDAQSyncConnections(const char chassisDevicesPorts[], float64 timeout);

Purpose

Detects and configures cDAQ Sync connections between devices. Stop all NI-DAQmx tasks running on the devices prior to running this function because any running tasks cause auto-configuration to fail.

Parameters

Input
Name Type Description
chassisDevicesPorts const char [] Specifies the names of the CompactDAQ chassis, C Series modules, or cDAQ Sync ports in comma separated form to search. If no names are specified, all cDAQ Sync ports on connected, non-simulated devices are scanned.
timeout float64 The amount of time, in seconds, to wait for the device to respond before timing out. If a timeout occurs, no configuration is changed.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxGetAutoConfiguredCDAQSyncConnections

int32 DAQmxGetAutoConfiguredCDAQSyncConnections(char portList[], uInt32 portListSize);

Purpose

Gets the list of port connections configured by DAQmxAutoConfigureCDAQSyncConnections.

Parameters

Output
Name Type Description
portList const char [] The list of port connections configured, in comma-separated format. Connected ports are specified in pairs. For example, "dev1/port0, dev4/port2" indicates a configured connection between dev1/port0 and dev4/port2. If you specify a NULL string or a string of size 0, this function returns a string of a size required to fit the port list.
portListSize uInt32 The number of cDAQ Sync ports auto-configured.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxGetDisconnectedCDAQSyncConnections

int32 DAQmxGetDisconnectedCDAQSyncPorts(char portList[], uInt32 portListSize);

Purpose

Gets the list of ports disconnected after calling DAQmxAreConfiguredCDAQSyncPortsDisconnected. Disconnected ports are pairs of ports that are declared as being connected, but cannot be verified.

Parameters

Output
Name Type Description
portList const char [] The list of port unverified port connections, in comma-separated format. Unverified port connections are specified in pairs. For example, "dev1/port0, dev4/port2" indicates an unverified connection between dev1/port0 and dev4/port2. If you specify a NULL string or a string of size 0, this function returns a string of a size required to fit the port list.
portListSize uInt32 The number of cDAQ Sync ports disconnected.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

DAQmxRemoveCDAQSyncConnection

int32 DAQmxRemoveCDAQSyncConnection(const char portList[]);

Purpose

Removes a cDAQ Sync connection between devices. The connection is not verified.

Parameters

Input
Name Type Description
portList const char [] Specifies the cDAQ Sync ports to disconnect.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.
⚠️ **GitHub.com Fallback** ⚠️