Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to output one pulse (with counter) when the continuous analog output function completes every N sampling outputs

Solved!
Go to solution

Dear everyone,

     I need your help. I want to output one pulse immediatly (with counter) when the continuous analog output function completes every N sampling output, the device I use is PXI-6230. As shown in the attachment, I use the node of "Reg Event " to generate an event every time the output of N sampling points is completed in the continuous analog output function. In the meanwhile, I set up a counter finitude output task with retrigger function. My idea is to retrigger the counter output task when the mentioned "Reg event" occurs, but I don't know how to realize it, please help me.

0 Kudos
Message 1 of 3
(1,935 Views)
Solution
Accepted by topic author qianlushuai

A better way is to handle it all in hardware.  I was just in a fairly related thread, see more details over here.

 

Define your pulse in units of "Ticks" of the AO Sample Clock terminal.  You'll need to use all 3 pulse timing inputs -- low ticks, high ticks, and initial delay.

 

Let's say you want to generate the rising edge of a pulse after every 25 samples.  You'd set initial delay to 25 ticks, and then set low ticks and high ticks such that they sum to 25.  (The high ticks value will control the width of the pulse.)   After this, you'll need to be sure to start the counter output task *before* starting the AO task.

 

Here's a partial snippet to illustrate.  The "reserve" call to DAQmx Control Task is there to make the AO task identify an internal terminal for exporting its sample clock, a behavior it wouldn't do by default.

 

 

-Kevin P

 

pulse every N ao samples.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 3
(1,900 Views)

Dear Kevin P,

     Thank you very much. The method you replied perfectly solves my demand and achieves higher synchronicity than I expected. Thank you again and learn from you.

 

Lushuai Qian

0 Kudos
Message 3 of 3
(1,889 Views)