Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Question on NI PCIe-6320 events counting

Solved!
Go to solution

Hello, all:

 

 I am using 6320 for digital events counting. I am using a gated buffer counting method. At the end of each counting period, I read all buffered events out to get their timestamps. However, there is a problem with this method. When the events number exceed 1 million (?), all buffered events lost and I can not read out anything. My guess is this is due to buffer size or counting clock rollover. (?)  There are basically two ways to overcome this problem. One is to do multiple events reading and the other is prescale the events. Does anything know how to perform prescale counting? For example I may just count the timing of every fifth event.

 

 My counting method was be seen in the attached vi.

 

 Thank you.   

0 Kudos
Message 1 of 5
(6,631 Views)

You've configured your task to sample (and buffer) counts of the internal 100 MHz timebase using the signal found on PFI8 as the sample clock.  Looks fine so far.   But you've also wired a sample rate input of 100 MHz.  I think that's probably a problem.  It's either inaccurate or ill-chosen.

 

The other thing I note is that you ask to read all available samples immediately after starting the task.  You aren't allowing any time for those samples to accumulate.  If you were to change the task to "Finite Samples" and specify a total number to accumulate, *then* your "Read" call would wait for them to come in.  Under Continuous Sampling, the "Read" call for "-1 == all available samples" will immediately return whatever samples happen to be there at that instant.

 

-Kevin P

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 5
(6,620 Views)

Many thanks, Kevin.

 

In the actual measurements, I do wait for some time and then try to read out all events at once.

 

In the help manual I found the following explanations for the rate which I set to 100000000: rate specifies the sampling rate in samples per channel per second. If you use an external source for the Sample Clock, set this input to the maximum expected rate of that clock.

My idea is to give a maximum expected rate of 100000000. If you think this is not a proper way to do it can you suggest anything? 

 

Do you know what"s the maximum number of pulses that 6320 can count at once? My trouble is I can not count over may be 1 million. So I am looking for any suggestions like prescale counting. 

 

Thanks.

 

Lixin

0 Kudos
Message 3 of 5
(6,613 Views)
Solution
Accepted by topic author LCHEN5154

Since your real code is different than what was posted, I can only take some guesses for why you can't count more than (about?) 1 million pulses.

 

1.  If your real code doesn't wire a "# of samples" value to DAQmx Timing.vi, then a continuous task that is told it's acquiring at 100 MHz will use a default buffer size of 1 million samples.  You can create a bigger buffer by wiring in a bigger value.  You can also loop over your Read calls to help prevent a buffer overflow.

 

2.  Theres a limit to the rate you can stream data from the board to system RAM.  The X-series is very VERY much better than most of its predecessors in this regard for counter-based measurements.  (See this thread and associated links.)  But it still won't handle 100 MHz effective sampling rates for any appreciable duration.

 

3. Another option I've seen used is count binning.  That method works kinda inside-out from your method by letting the external pulses increment the count while that count is sampled at a constant sample rate.

 

4. I haven't yet been able to do any real-life playing with an X-series board, but I think there's also a mode for measuring precise frequency while sampling at a constant rate.  That mode might prove useful for you as well.

 

-Kevin P

 

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 4 of 5
(6,609 Views)

Thanks Kevin for your answer. I changed the default buffer size and the problem solved.

 

Lixin

0 Kudos
Message 5 of 5
(6,594 Views)