Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Using DAQmx how can I count edges and pulse after n counts?

I need to count edges on an external clock and after n number of counts generate a pulse of settable width. The rising edge of the pulse needs to be synchronized to the rising edge of the measured clock. Does anyone have a method to do this with DAQmx?
0 Kudos
Message 1 of 4
(3,827 Views)
Hello DRNIK,

I see you are trying to create an application that has the following functions: one task that counts the edges of the incoming clock. Once the count gets to a certain number you want to trigger a second task that outputs a variable pulse width that is sharing the same clock signal.

What hardware are you using?

For this application, you would need to two seperate task. One that will do the counter function. You can then monitor the value that you read in to get the number events you count. Then using some sort of case structure to create a state machine that will have a state where a seperate variable pulse width task is started.

Can you clarify on what you mean about sharing the same clock signal. I am still unclear about that part of your application.

Let me know if I have misunderstood what you are trying to do.

Regards,
  Sandra T.

Applications Engineer | National Instruments
0 Kudos
Message 2 of 4
(3,791 Views)

Sandra,

I am sorry I did not reply sooner but I found a solution from NI support. To answer your question, I need a clock at 200kHz at 25% duty cycle to control a particular device. This clock is based on the number of ticks from the 80MHz timebase of the 6602. 1 tick = 1.25e-08 seconds. The period of the 200kHz clock is 5.0e-06seconds. The number of ticks then in (1) 200kHz cycle period is 400. I also need another clock which has a high pulse equal to 100 ticks and then wait for 910 edges of the first clock to transpire or 364,000 low ticks before the next 100 tick high. In addition, I need a sample clock that is 200kHz and 50 to 75% duty cycle or 200 to 300 ticks which is used as an external sample clock on an analog input DAQ card which is triggered by the falling edge of the 100 tick period clock (configured to be re-triggerable). The three clocks need to be syncronized so the internal timebase is used. As it turns out, counting edges is not necessary.

Regards,

DRNIK

0 Kudos
Message 3 of 4
(3,772 Views)
DRNIK,

Thanks for the posting to the forums. I appreciate the reply. I see that you have found a different solution for your application.

~ Sandra

0 Kudos
Message 4 of 4
(3,759 Views)