Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Using 6602 to count number of pulses on the gate

Hello
I'm using 6602, NI-DAQ,WinXp,VC++
I have an external pulse (about 30HZ 50% d.c) which I need to synchronize my process to.
On every High level of the pulse I need to issue a thread that run for about 4ms.
I think for 2 options to solve it:
1. Receive an interrupt for every pulse and increase a global vaiable (counter) in memory. My applicaion will poll this varable and will issue the thread on every counter increament.
I didn't find any way to receive this interrupt via the 6602!
2. Increase one of the 6602 counters when the external pulse is connected to its gate/source. The problem is that I found that I can't poll (check the ND_COUNT) insoftware as long as the counter is armed.
Can you please direct me how can I solve the problem in both cases?
Many thanks
Shali
0 Kudos
Message 1 of 2
(3,228 Views)

Hi Shali,

Thanks for contacting National Instrument's support!  It sounds like you have an interesting application involving our 6602 card. 

I would recommend going with your first solution.  You could simply perform a Count Digital events measurement and constantly monitor the output.  Then, you would use an event structure to monitor the variable where you're storing the count value.  If the value has changed, then you fire off your interrupt event.  If not, continue polling that variable. 

I'm not sure if I understand what you're trying to do with the second solution, but hopefully the first solution will work for you.  If not, please let me know and I'd be glad to help you out further.

Regards,

Daniel L.
Applications Engineer
National Instruments

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