02-02-2006 10:36 AM
02-02-2006 12:41 PM
1 way:
A. Configure counter 2 to generate a single pulse, using low idle and high pulse (default settings). Set high pulse time to be the required "gate time" you mentioned.
B. Configure counters 0, 1 for edge counting with a "pause trigger." (I'm not at my LV PC to check -- the "pause trigger" may require use of the DAQmx Trigger property node rather than the regular DAQmx Trigger vi.) Set the pause trigger source / terminal to be the output of counter 2. Set polarity of pause trigger to mean "count while pause trigger is high, do not count while low".
C. Start counters 0, 1. They are ready to count, but because counter 2's output is low no counting is happening yet.
D. Start counter 2. Its pulse will act to gate the counting operation on counters 0, 1. Since they both use the exact same signal for gating, they count during he exact same interval.
Variations are possible that involve a Start Trigger, but I don't think that's necessary. The gating pulse IS necessary and seems sufficient for synchronization in itself. You also have a spare counter that could support a buffered mode if desired.
-Kevin P.
02-03-2006 03:05 AM
02-03-2006 10:16 AM
Fred,
So now it sounds like you want to a series of measurements, each one being counts during a particular 100 msec interval. And you want all these 100 msec intervals to be continuous, right -- no time gaps between them?
Because you want to reset the count to 0 at the start of each interval, that naturally leads to a different type of measurement than I first described. You should plan to do period measurement which causes the count to reset to 0 after each sample right down at the hw level.
Your 2 measurement counters should perform buffered period measurement, and they'll need to by sync'ed using a Start Trigger. The 3rd pulse counter will now need to generate a continuous pulse train with a total period of 100 msec (rather than a pulse width of 100 msec) and be used as a Sampling Clock by the other 2 (rather than being used as a Pause Trigger). Finally, you may need to set the "Duplicate Count Prevention" property for the 2 measurement counters. This will allow you to buffer up values of 0 during 100 msec intervals in which there are no incoming pulses from one of your external sources. I don't know whether you should set it to True or False though -- its default behavior hasn't been constant for all board types over various DAQmx versions so the safest thing is just experiment and find out which setting does what you need.
Somehow you'll need to generate a pulse for your Start Trigger too. This can be done with a pulse from your 4th counter or by using a digital output (using a digital output may require physical wiring).
Finally, you'll need one of the counters configured to use Interrupts for data transfer rather than the faster, more efficient DMA. The 6601 provides only 1 channel of DMA for data transfer, so only 1 buffered counting task gets to transfer data to RAM this way. The other one will need to be explicitly configured to use interrupts.
This is such a substantial and significant set of changes that you'll probably have to start over from scratch. Try searching the ni site for examples and search the forums for prior discussions about photon detector apps. There've been several threads about PDT's that typical have similar data collection requirements to yours. I can't build up a whole example for you, but post again once you think you've found / reworked something close.
(Note: the 6602 provides 3 channels of DMA to support 3 simultaneous buffered counting tasks. Though it costs twice as much as the 6601, I think it offers well over twice the capability. Still, you should be ok with the 6601 because you're only buffering at 10 Hz which should be absolutely no problem for interrupts. A few kHz would be different...)
-Kevin P.
07-27-2006 09:56 AM
07-27-2006 09:58 AM
08-17-2006 08:24 AM
08-20-2006 04:12 PM