Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I generate 2 synchronized pulse trains using a pxi-6602 - one half the frequency of the other?

I've been able to generate a down-selected frequency that is 1/4 of the master pulse using "DAQmxCreateCOPulseChanTicks" with lowTicks and highTicks set to 2, but it won't accept 1 input cycle.  Is there another way to generate a synchronized (rising edges aligned) output that is 1/2 the master pulse train frequency?
0 Kudos
Message 1 of 3
(3,852 Views)

Yes you can.  While you're stuck with the minimum value of 2 for both low ticks and high ticks, there's another way.

Normally, the pulsetrain tasks will countdown low ticks, toggle the output state, countdown high ticks, toggle the output state, countdown low ticks, toggle....  However there is a DAQmx property node setting that allows you to specify a "pulse" output behavior rather than a toggle behavior.  So it'll countdown 2 low ticks and pulse, then countdown 2 high ticks and pulse again, etc.  The pulse width will be 1 cycle of the timebase.  In this case, I'd expect it to treat your external signal as the timebase rather than using one of its own internal clocks.  If so, you'll produce square waves where both falling and rising edges of the divide-by-2 pulsetrain correspond are synced to rising edges of the master.

I'm not at a LV machine to find the exact setting, but you'll probably be digging down deep in the DAQmx Channel properties, looking for terms like "output behavior" and/or "pulse on TC" where TC stands for terminal count. 

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 3
(3,847 Views)
That works and I thank you much.  The DAQmx call to change the attribute is:
 
DAQmxSetExportedSignalAttribute( taskHandle, DAQmx_Exported_CtrOutEvent_OutputBehavior, DAQmx_Val_Pulse )
0 Kudos
Message 3 of 3
(3,842 Views)