NI DAQMX Triggering - ni/grpc-device GitHub Wiki

Triggering

Start Trigger

DAQmxCfgAnlgEdgeStartTrig

int32 DAQmxCfgAnlgEdgeStartTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerSlope, float64 triggerLevel);

Purpose

Configures the task to start acquiring or generating samples when an analog signal crosses the level you specify.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] The name of a channel or terminal where there is an analog signal to use as the source of the trigger. For E Series devices, if you use a channel name, the channel must be the first channel in the task. The only terminal you can use for E Series devices is PFI0.
triggerSlope int32 Specifies on which slope of the signal to start acquiring or generating samples when the signal crosses triggerLevel.
Value Description
DAQmx_Val_RisingSlope Trigger on the rising slope of the signal.
DAQmx_Val_FallingSlope Trigger on the falling slope of the signal.
triggerLevel float64 The threshold at which to start acquiring or generating samples. Specify this value in the units of the measurement or generation. Use triggerSlope to specify on which slope to trigger at this threshold.

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.

DAQmxCfgAnlgMultiEdgeStartTrig

int32 DAQmxCfgAnlgMultiEdgeStartTrig (TaskHandle taskHandle, const char triggerSources[], int32 triggerSlopeArray[], float64 triggerLevelArray[], uInt32 arraySize);

Purpose

Configures the task to start acquiring or generating samples when any of the configured analog signals cross the respective levels you specified. Multi-edge triggering treats the configured triggers as if a logical OR is applied.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSources const char [] * A comma-separated string specifying a list of terminals, physical channel names, or ranges of physical channels where there are an analog signals to use as the sources of the trigger.
triggerSlopeArray int32 [] The array containing the slopes of the signals to start acquiring or generating samples when the respective signal crosses the specified trigger level. Each element of the array corresponds to the sources specified in triggerSources and triggerLevelArray.
Value Description
DAQmx_Val_RisingSlope Trigger on the rising slope of the signal.
DAQmx_Val_FallingSlope Trigger on the falling slope of the signal.
triggerLevelArray float64 [] The array containing the thresholds at which to start acquiring or generating samples. Each element of the array corresponds to the sources specified in triggerSources and triggerSlopeArray. Specify these values in the units of the measurement or generation. Use the triggerSlopeArray to specify on which slopes to trigger at the respective thresholds.
arraySize uInt32 The size of triggerSlopeArray and triggerLevelArray. This must correspond to the number of sources specified in triggerSources.

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.

DAQmxCfgAnlgWindowStartTrig

int32 DAQmxCfgAnlgWindowStartTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerWhen, float64 windowTop, float64 windowBottom);

Purpose

Configures the task to start acquiring or generating samples when an analog signal enters or leaves a range you specify.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] The name of a virtual channel or terminal where there is an analog signal to use as the source of the trigger.
For E Series devices, if you use a virtual channel, it must be the first channel in the task. The only terminal you can use for E Series devices is PFI0.
triggerWhen int32 Specifies whether the task starts measuring or generating samples when the signal enters the window or when it leaves the window. Use windowBottom and windowTop to specify the limits of the window.
Value Description
DAQmx_Val_EnteringWin Trigger when the signal enters the window.
DAQmx_Val_LeavingWin Trigger when the signal leaves the window.
windowTop float64 The upper limit of the window. Specify this value in the units of the measurement or generation.
windowBottom float64 The lower limit of the window. Specify this value in the units of the measurement or generation.

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.

DAQmxCfgDigEdgeStartTrig

int32 DAQmxCfgDigEdgeStartTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerEdge);

Purpose

Configures the task to start acquiring or generating samples on a rising or falling edge of a digital signal.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] The name of a terminal where there is a digital signal to use as the source of the trigger.
triggerEdge int32 Specifies on which edge of a digital signal to start acquiring or generating samples.
Value Description
DAQmx_Val_Rising Rising edge(s).
DAQmx_Val_Falling Falling edge(s).

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.

DAQmxCfgDigPatternStartTrig

int32 DAQmxCfgDigPatternStartTrig (TaskHandle taskHandle, const char triggerSource[], const char triggerPattern[], int32 triggerWhen);

Purpose

Configures a task to start acquiring or generating samples when a digital pattern is matched.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] Specifies the physical channels to use for pattern matching. The order of the physical channels determines the order of the pattern. If a port is included, the order of the physical channels within the port is in ascending order.
triggerPattern const char [] Specifies the digital pattern that must be met for the trigger to occur.
triggerWhen int32 Specifies the conditions under which the trigger occurs.
Value Description
DAQmx_Val_PatternMatches Pattern matches
DAQmx_Val_PatternDoesNotMatch Pattern does not match

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.

DAQmxCfgTimeStartTrig

int32 DAQmxCfgTimeStartTrig (TaskHandle taskHandle, CVIAbsoluteTime when, int32 timescale);

Purpose

Configures the task to start acquiring or generating samples at a specified time.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
when CVIAbsoluteTime Specifies when to trigger.
timescale int32 Specifies the start trigger timestamp time scale.
Value Description
DAQmx_Val_HostTime Use the host device.
DAQmx_Val_IOTime Use the I/O 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.

DAQmxDisableStartTrig

int32 DAQmxDisableStartTrig (TaskHandle taskHandle);

Purpose

Configures the task to start acquiring or generating samples immediately upon starting the task.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.

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.

Reference Trigger

DAQmxCfgAnlgEdgeRefTrig

int32 DAQmxCfgAnlgEdgeRefTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerSlope, float64 triggerLevel, uInt32 pretriggerSamples);

Purpose

Configures the task to stop the acquisition when the device acquires all pretrigger samples, an analog signal reaches the level you specify, and the device acquires all post-trigger samples.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] The name of a virtual channel or terminal where there is an analog signal to use as the source of the trigger.
For E Series devices, if you use a virtual channel, it must be the only channel in the task. The only terminal you can use for E Series devices is PFI0.
triggerSlope int32 Specifies on which slope of the signal the Reference Trigger occurs.
Value Description
DAQmx_Val_RisingSlope Trigger on the rising slope of the signal.
DAQmx_Val_FallingSlope Trigger on the falling slope of the signal.
triggerLevel float64 Specifies at what threshold to trigger. Specify this value in the units of the measurement or generation. Use triggerSlope to specify on which slope to trigger at this threshold.
pretriggerSamples uInt32 The minimum number of samples per channel to acquire before recognizing the Reference Trigger. The number of posttrigger samples per channel is equal to number of samples per channel in the NI-DAQmx Timing functions minus pretriggerSamples.

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.

DAQmxCfgAnlgMultiEdgeRefTrig

int32 DAQmxCfgAnlgMultiEdgeRefTrig (TaskHandle taskHandle, const char triggerSources[], int32 triggerSlopeArray[], float64 triggerLevelArray[], uInt32 pretriggerSamples, uInt32 arraySize);

Purpose

Configures the task to stop the acquisition when the device acquires all pretrigger samples, any of the configured analog signals reaches the levels you specify, and the device acquires all post-trigger samples. Multi-edge triggering treats the specified triggers as if a logical OR is applied.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSources const char [] * A comma-separated string specifying a list of terminals, physical channel names, or ranges of physical channels where there are an analog signals to use as the sources of the trigger.
triggerSlopeArray int32 [] The array containing the slopes of the signals to start acquiring or generating samples when the respective signal crosses the specified trigger level. Each element of the array corresponds to the sources specified in triggerSources and triggerLevelArray.
Value Description
DAQmx_Val_RisingSlope Trigger on the rising slope of the signal.
DAQmx_Val_FallingSlope Trigger on the falling slope of the signal.
triggerLevelArray float64 [] The array containing the thresholds at which to start acquiring or generating samples. Each element of the array corresponds to the sources specified in triggerSources and triggerSlopeArray. Specify these values in the units of the measurement or generation. Use the triggerSlopeArray to specify on which slopes to trigger at the respective thresholds.
pretriggerSamples uInt32 The minimum number of samples per channel to acquire before recognizing the Reference Trigger. The number of posttrigger samples per channel is equal to number of samples per channel in the NI-DAQmx Timing functions minus pretriggerSamples.
arraySize uInt32 The size of triggerSlopeArray and triggerLevelArray. This must correspond to the number of sources specified in triggerSources.

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.

DAQmxCfgAnlgWindowRefTrig

int32 DAQmxCfgAnlgWindowRefTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerWhen, float64 windowTop, float64 windowBottom, uInt32 pretriggerSamples);

Purpose

Configures the task to stop the acquisition when the device acquires all pretrigger samples, an analog signal enters or leaves a range you specify, and the device acquires all post-trigger samples.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] The name of a virtual channel or terminal where there is an analog signal to use as the source of the trigger.
For E Series devices, if you use a virtual channel, it must be the only channel in the task. The only terminal you can use for E Series devices is PFI0.
triggerWhen int32 Specifies whether the Reference Trigger occurs when the signal enters the window or when it leaves the window. Use windowBottom and windowTop to specify the limits of the window.
Value Description
DAQmx_Val_EnteringWin Trigger when the signal enters the window.
DAQmx_Val_LeavingWin Trigger when the signal leaves the window.
windowTop float64 The upper limit of the window. Specify this value in the units of the measurement or generation.
windowBottom float64 The lower limit of the window. Specify this value in the units of the measurement or generation.
pretriggerSamples uInt32 The minimum number of samples per channel to acquire before recognizing the Reference Trigger. The number of posttrigger samples per channel is equal to number of samples per channel in the NI-DAQmx Timing functions minus pretriggerSamples.

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.

DAQmxCfgDigEdgeRefTrig

int32 DAQmxCfgDigEdgeRefTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerEdge, uInt32 pretriggerSamples);

Purpose

Configures the task to stop the acquisition when the device acquires all pretrigger samples, detects a rising or falling edge of a digital signal, and acquires all posttrigger samples.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] Specifies the name of a terminal where there is a digital signal to use as the source of the trigger.
triggerEdge int32 Specifies on which edge of the digital signal the Reference Trigger occurs.
Value Description
DAQmx_Val_Rising Rising edge(s).
DAQmx_Val_Falling Falling edge(s).
pretriggerSamples uInt32 The minimum number of samples per channel to acquire before recognizing the Reference Trigger. The number of posttrigger samples per channel is equal to number of samples per channel in the NI-DAQmx Timing functions minus pretriggerSamples.

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.

DAQmxCfgDigPatternRefTrig

int32 DAQmxCfgDigPatternRefTrig (TaskHandle taskHandle, const char triggerSource[], const char triggerPattern[], int32 triggerWhen, uInt32 pretriggerSamples);

Purpose

Configures the task to stop the acquisition when the device acquires all pretrigger samples, matches or does not match a digital pattern, and acquires all posttrigger samples.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] Specifies the physical channels to use for pattern matching. The order of the physical channels determines the order of the pattern. If a port is included, the order of the physical channels within the port is in ascending order.
triggerPattern const char [] Specifies the digital pattern that must be met for the trigger to occur.
triggerWhen int32 Specifies the conditions under which the trigger occurs.
Value Description
DAQmx_Val_PatternMatches Pattern matches
DAQmx_Val_PatternDoesNotMatch Pattern does not match
pretriggerSamples uInt32 The minimum number of samples per channel to acquire before recognizing the Reference Trigger. The number of posttrigger samples per channel is equal to number of samples per channel in the NI-DAQmx Timing functions minus pretriggerSamples.

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.

DAQmxDisableRefTrig

int32 DAQmxDisableRefTrig (TaskHandle taskHandle);

Purpose

Disables reference triggering for the measurement or generation.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.

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.

Advanced Trigger

DAQmxCfgDigEdgeAdvTrig

int32 DAQmxCfgDigEdgeAdvTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerEdge);

Purpose

Configures a switch task to advance to the next entry in a scan list on a rising or falling edge of a digital signal.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] The terminal where there is a digital signal to use as the source of the trigger.
triggerEdge int32 Specifies on which edge of a digital signal to advance to the next entry in the scan list.
Value Description
DAQmx_Val_Rising Rising edge(s).
DAQmx_Val_Falling Falling edge(s).

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.

DAQmxDisableAdvTrig

int32 DAQmxDisableAdvTrig (TaskHandle taskHandle);

Purpose

Disables the advance triggering for the task.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.

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.

DAQmxSendSoftwareTrigger

int32 DAQmxSendSoftwareTrigger (TaskHandle taskHandle, int32 triggerID);

Purpose

Generates the specified software trigger.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerID int32 Specifies which software trigger to generate.
Value Description
DAQmx_Val_AdvanceTrigger Generate the advance trigger

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.

DAQmxWaitForValidTimestamp

int32 DAQmxWaitForValidTimestamp (TaskHandle taskHandle, int32 timestampEvent, float64 timeout, CVIAbsoluteTime* timestamp);

Purpose

Configures the task to start acquiring or generating samples at a specified time.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
timestampEvent int32 Specifies the timestamp event to wait on.
Value Description
DAQmx_Val_ArmStartTrigger Arm Start Trigger timestamp.
DAQmx_Val_FirstSampleTimestamp First Sample timestamp.
DAQmx_Val_ReferenceTrigger Reference Trigger timestamp.
DAQmx_Val_StartTrigger Start Trigger timestamp.
timeout float64 The amount of time, in seconds, to wait for a valid timestamp before timing out. If a timeout occurs, no configuration is changed.
Output
Name Type Description
timestamp CVIAbsoluteTime * A reference to the value of the timestamp.

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** ⚠️