LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating continuous digital pulse train from a Counter Output based on ticks and time.

Into DigPulseTrain-Cont-PauseTrig example I saw this configuration for a continuous digital pulse train based on an external digital pause trigger, but I would like to know how to define this channel based on ticks. And another to base it on time.
 
DAQmxErrChk (DAQmxCreateCOPulseChanFreq(taskHandle,chan,"",DAQmx_Val_Hz,idle,0.0,freq,duty));
DAQmxErrChk (DAQmxSetTrigAttribute(taskHandle,DAQmx_PauseTrig_Type,DAQmx_Val_DigLvl));
DAQmxErrChk (DAQmxSetTrigAttribute(taskHandle,DAQmx_DigLvl_PauseTrig_Src,triggerSource));
DAQmxErrChk (DAQmxSetTrigAttribute (taskHandle, DAQmx_DigLvl_PauseTrig_When,pauseWhen));
DAQmxErrChk (DAQmxCfgImplicitTiming(taskHandle,DAQmx_Val_ContSamps,1000));
 
Thanks
0 Kudos
Message 1 of 2
(3,052 Views)
Hello mhhernand,

You can set the specifications of a counter pulse train in terms of frequency (Hz and duty cycle), ticks (timebase ticks for the low and high portions of the pulse), and time (low and high time in seconds).  All you need to do is alter that example you have found, DigPulseTrain-Cont-PauseTrig, by replacing the DAQmxCreateCOPulseChanFreq with one of the following two functions:

DAQmxCreateCOPulseChanTicks(....)
DAQmxCreateCOPulseChanTime(....)

For detailed information about the parameters used in these functions, check out the DAQmx C Reference Help, which should be installed on your computer when you install the NI-DAQmx driver.  You can find the DAQmx C Reference Help at Start > All Programs > National Instruments > NI-DAQ.  This document contains a full list of all NI-DAQmx functions, along with a detailed description of its use, and descriptions of the input parameters for each function.

I hope this helps!

Travis G.
Applications Engineering
0 Kudos
Message 2 of 2
(3,036 Views)