From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample C or CPP code for Continuous Pulse Train Generation on the PCIe 6612 card

Hello,

We would like to generate a continuous pulse train from one of the counters of an NI PCIe 6612 card using C/C++ language, with the NIDAQmx interface.

Our software needs to be able to continuously go to sleep and wake up each time counter output changes from low level to high level (i.e. on the rising edge of the counter output).

In some scenarios, we need to wake up on the falling edge of the counter output.

Note that we do not want to poll in a busy-loop for counter output.

The pulse train frequency needs to be constant (e.g. 100 Hz).

Is there an example program that demonstrates how to do that?

Thank you,

Itai

 

0 Kudos
Message 1 of 2
(3,361 Views)

Does your hardware support change detection?  Seems like it would be pretty suitable in this situation.  There's this example here, which sort of covers it.

 

http://www.ni.com/example/29947/en/

 

Here's another article which talks about change detection.

 

http://www.ni.com/tutorial/4102/en/

0 Kudos
Message 2 of 2
(3,347 Views)