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.
Parameters
Input | |||||||||||||||||
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
deviceName |
|
The name of the device, as configured in Measurement & Automation Explorer (MAX), to which this operation applies. | |||||||||||||||
taskName |
|
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 |
|
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.
|
|||||||||||||||
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 |
|
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. |