DAQmxRegisterSignalEvent
From NI-DAQmx C Functions
DAQmxRegisterSignalEvent
int32 DAQmxRegisterSignalEvent (TaskHandle taskHandle, int32 signalID, uInt32 options, DAQmxSignalEventCallbackPtr callbackFunction, void *callbackData);
Purpose
Registers a callback function to receive an event when the
specified hardware event occurs.
When you stop a task explicitly any pending events are discarded. For example,
if you call DAQmxStopTask then you do not
receive any pending events.
Parameters
| Input | |||||||||||||||||
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| taskHandle | TaskHandle | The task used in this function. | |||||||||||||||
| signalID |
|
The signal for which you want to receive results.
|
|||||||||||||||
| options |
|
Use this parameter to set certain options. You can combine flags with the bitwise-OR operator ('|') to set multiple options. Pass a value of zero if no options need to be set.
|
|||||||||||||||
| callbackFunction |
|
The function that you want DAQmx to call when the event occurs. The function
you pass in this parameter must have the following prototype: int32 CVICALLBACK Callback (TaskHandle taskHandle, int32 signalID, void *callbackData); Upon entry to the callback, the taskHandle parameter contains the handle to the task on which the event occurred. The signalID parameter contains the value you passed in the signalID parameter of this function. The callbackData parameter contains the value you passed in the callbackData parameter of this function. |
|||||||||||||||
| callbackData |
|
A value that you want DAQmx to pass to the callback function as the function data parameter. Do not pass the address of a local variable or any other variable that might not be valid when the function is executed. |
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. |