From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-13-2007 03:02 PM
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.
06-14-2007 03:44 AM
06-14-2007 05:21 AM
06-15-2007 12:20 PM
DAQmxCreateCICountEdgesChan
int32 DAQmxCreateCICountEdgesChan (TaskHandle taskHandle, const char counter[], const char nameToAssignToChannel[], int32 edge, uInt32 initialCount, int32 countDirection);
Purpose
Creates a channel to count the number of rising or falling edges of a digital signal and adds the channel to the task you specify with taskHandle. You can create only one counter input channel at a time with this function because a task can include only one counter input channel. To read from multiple counters simultaneously, use a separate task for each counter. Connect the input signal to the default input terminal of the counter unless you select a different input terminal.
Parameters
Input Name Type Description taskHandle TaskHandle The task to which to add the channels that this function creates. counter const char [] The name of the counter to use to create virtual channels. nameToAssignToChannel const char [] The name(s) to assign to the created virtual channel(s). If you do not specify a name, NI-DAQmx uses the physical channel name as the virtual channel name. If you specify your own names for nameToAssignToChannel, you must use the names when you refer to these channels in other NI-DAQmx functions.
If you create multiple virtual channels with one call to this function, you can specify a list of names separated by commas. If you provide fewer names than the number of virtual channels you create, NI-DAQmx automatically assigns names to the virtual channels.edge int32 Specifies on which edges of the input signal to increment or decrement the count.
Value Description DAQmx_Val_Rising Rising edge(s). DAQmx_Val_Falling Falling edge(s). initialCount uInt32 The value from which to start counting. countDirection int32 Specifies whether to increment or decrement the counter on each edge.
Value Description DAQmx_Val_CountUp Increment the count register on each edge. DAQmx_Val_CountDown Decrement the count register on each edge. DAQmx_Val_ExtControlled The state of a digital line controls the count direction. Each counter has a default count direction terminal. 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.
(Continued in next post...)
06-15-2007 12:21 PM
(...Continued from previous post)
DAQmxCfgSampClkTiming
int32 DAQmxCfgSampClkTiming (TaskHandle taskHandle, const char source[], float64 rate, int32 activeEdge, int32 sampleMode, uInt64 sampsPerChanToAcquire);
Purpose
Sets the source of the Sample Clock, the rate of the Sample Clock, and the number of samples to acquire or generate.
Parameters
Input Name Type Description taskHandle TaskHandle The task used in this function. source const char [] The source terminal of the Sample Clock. To use the internal clock of the device, use NULL or use OnboardClock. rate float64 The sampling rate in samples per second per channel. If you use an external source for the Sample Clock, set this value to the maximum expected rate of that clock. activeEdge int32 Specifies on which edge of the clock to acquire or generate samples.
Value Description DAQmx_Val_Rising Acquire or generate samples on the rising edges of the Sample Clock. DAQmx_Val_Falling Acquire or generate samples on the falling edges of the Sample Clock. sampleMode int32 Specifies whether the task acquires or generates samples continuously or if it acquires or generates a finite number of samples.
Value Description DAQmx_Val_FiniteSamps Acquire or generate a finite number of samples. DAQmx_Val_ContSamps Acquire or generate samples until you stop the task. DAQmx_Val_HWTimedSinglePoint Acquire or generate samples continuously using hardware timing without a buffer. Hardware timed single point sample mode is supported only for the sample clock and change detection timing types. sampsPerChanToAcquire uInt64 The number of samples to acquire or generate for each channel in the task if sampleMode is DAQmx_Val_FiniteSamps. If sampleMode is DAQmx_Val_ContSamps, NI-DAQmx uses this value to determine the buffer size. 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.
You can find ANSI C examples for NI-DAQmx at C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C. Again, you may be most interested in the example called Cnt-Buf-Cont-ExtClk.c located at C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Count Digital Events\Cnt-Buf-Cont-ExtClk.
06-18-2007 03:50 AM
06-19-2007 12:15 AM
06-20-2007 10:59 AM
Hello Matt,
I have tried the function DAQmxErrChk DAQmxCfgDigEdgeAdvTrig(taskHandlePulse, "Dev1/PFI31", DAQmx_Val_Edge1_Rising) , for selecting the signal to start the trigger but getting an error as "Specified property is not supported bu the device or is not applicable to the task ", I have used the same task for both generation of pulse and for configuring the task.
Thanks
06-21-2007 07:35 PM
06-25-2007 03:48 AM