Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

counting TTL pulses, PCI-6602

Dear all
 
I was wandering if it is possible to count TTL pulses from an APD with a fixed integration time (of 10ms) using the PCI-6602 using labview 7?
 
Based on the 6601/6602 manual, I beleive I should try and do a "Buffered periodic event counting": source = APD pulses and ideally I would like to  use as gate the internal clock of the card.
 
So far,  I have tried counting edges but the counts are cumulative (not number of counts / 10ms) and have no idea on how to set the gate.
 
I will appreciate any help on this regard
 
Daniel
0 Kudos
Message 1 of 8
(6,484 Views)

Hello Daniel,

It sounds like you are on the right track.  Here are a couple things to note:

You cannot gate the counter with the internal clock, but you could generate a pulse train with one of your other counters. 

The only way to have a non-cumulative count is to start and stop the counter task every 10ms, which would be fairly inefficient.  You might instead consider determining the number of counts in software instead. 

Good luck!

Micaela N
National Instruments
0 Kudos
Message 2 of 8
(6,467 Views)

Yes this can definitely be done.  I have done something very similar with the 6602 in the past with LV 7.0 and daqMX7.3 as well as 6.1 and traditional daq drivers.  One word of advice, think about multithreading your application form the start, that is put the data acquisition in its own loop and send the results to a separate process loop using a queue, this architecture will allow you to collect and buffer the data as fast as needed and allow for processing and displaying the results in a second loop without a bottleneck, especially if the processing time is nondeterministic. 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 8
(6,453 Views)
The way my application worked is that counters 0 and 1 were reserved for generating a pulse train (in your case 10ms or 100 Hz), which can be configured to have a software start or armed to start on an external TTL pulse on the gate and will either run continuously or have a finite number of pulses (software settable) the remaining counters were set to count the source pin pfi (external TTL pulses) buffered between the "gate" rising edge, where the gate was just the output of the pulse train from the first two counters (some pulse train setups like the retrigerable finite modes require 2 counters that's why I needed to set aside two counters and not just one).  works great I collected TTLs at over 1000 Hz with a lot of processing with no problems of buffer overruns or lost data.  I was using a Photon counting PMT as my source not an APD but the source should not matter.  The only problems which could cause problems is when the TTLs come in faster than 80 MHz (should not be an issue) or when no TTLs came in.  daqMX by default will filter out zeros from the buffer and if this is a possibility you must set the CI.DupCountPrevention to TRUE.  Good luck
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 8
(6,453 Views)
Daniel-
 
NI-DAQmx has the exact functionality that you are looking for built in using the High Frequency Two Counter Period or Frequency Measurement methods.  With this application, a pair of counters on your 6602 are used to count the number of edges that occur over a certain amount of time (measurement time), in a non-cumulative fashion.  The default method will convert the number of edges counted into a period of frequency measurement value, but if you'd rather just have the count values, you can either return your measurement values in "as ticks" units, or you can use the Counter U32 read.  There are both finite and continuous examples that ship with NI-DAQ for this application:
 
Meas Dig Periods-Buffered-Finite-High Freq 2 Ctr.vi
Meas Dig Periods-Buffered-Continuous-High Freq 2 Ctr.vi
 
I hope this helps!
gus....
0 Kudos
Message 5 of 8
(6,448 Views)
Dear All

Thanks for your reply and help provided.

I have made an attempt to tackle the problem I posted, details in the files attached

Basically it does the following
- count a finite number of edges using as sample clock a signal generated by the counter (CO pulse time, continuous samples)
- Read the counts in consecutive pairs, so that I can substract them and obtain the counts / clock time continuously (avoiding the cumulative count display)
 
Given that I am not an experienced LabView user, I am not sure if with this VI the timing  is ok.

I will try your suggestions as well.

Thanks for your help.

Daniel
Download All
0 Kudos
Message 6 of 8
(6,438 Views)
Dear all

I (later) tryed buffered period measurement, using duplicate count prevention and setting the units to ticks and it worked quite ok.

The vi is attached to this message

Thanks for your help
Daniel
0 Kudos
Message 7 of 8
(6,434 Views)
Dear falkpl

Do you have a vi that illustrates your suggestions? If so, could you send me a copy?

Kindest regards

Daniel
0 Kudos
Message 8 of 8
(5,452 Views)