Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

stopping a buffered event counting on PCI6602

is there any trick to stop IMMEDIATELY a buffered event counting with an external/internal stop trigger? I have a starttrigger from an external source, but don't know how to stop in a similar way the counter. I need to acquire for a given period of time (very few ms!) defined by a start and a stop (don't mind if the same line or separated). If I knew exactly know how many pulses are there in this interval, there would not be a problem. I can't know that in advance so I have to set a large buffer, but how to stop the counter?
No way by software in fact I need very high accuracy.

If there exist a hardware solution, how can I notify the software program that the buffered acquisition has been stopped? Will a polling slow dow
n dramatically the DMA buffering?
I am using PCI6602 and the latest labview and DAQ.

thanks a lot
0 Kudos
Message 1 of 5
(3,648 Views)
Piero:
You can try the following:
Set up one counter (ex. counter 1) for gated pulse train generation (pulse will output from counter 1 when gate is high); this is the pulse train that is going to be used as the gate for the buffered event (ex. counter 2). The gate for counter 1 is generated from the other counter (ex. counter 0). Counter 0 should be set for simple event counting with an initial count of 1 and set to count down. The source for this counter is the trigger signals (start and stop signals). When the start trigger comes in, the counter will count down to 0, the terminal count. When this happens, the output of the counter 0 toggles high, this then starts the pulse train generation. When the stop trigger comes in, the counter counts down to 2^n - 1, whe
re n is the resolution of the counter. This will toggle the output low again and stop the pulse train generation.
There are few things to note:
1)By default, the terminal count pulse will not appear on the I/O connector. You will need to call either Route Signal.vi LabVIEW from GPCTR n output to GPCTR n output, (n being the counter number) in order for the signal to appear.
2)frequency of the pulse train generated from counter 1 will control how fast you are doing buffered event counting on counter 2.
3) You will still need to poll counter 0 to check the current count, if the current count is less than or equpal to 2^n - 1, then you can stop all operations. Polling the current count of counter 0 should not affect the DMA buffering dramatically.
Hope this helps.

June
0 Kudos
Message 2 of 5
(3,648 Views)
Hi June

I definitely appreciate your trick with the terminal count. It could be very useful to me for other types of measurements. Still I don't understand how it could work in my setup. In fact I need the gate of the buffered counter to be connected to my external signal (photodetector), the only pulses I want to timestamp.
When doing buffered event counting you have no longer the gate except for the pulses te be timetagged, at least I think.

Let me know please if I am mistaken

Piero
0 Kudos
Message 3 of 5
(3,648 Views)
Hi Piero:

I had mistakenly assumed that your gate is being generated by another counter, that's why I suggested the previous solution. Given the new information, I am not sure if I can't think of any hardware solution. Have you considered using one additional counter to perform buffered event counting and measure the time difference between your start and stop triggers and do post processing calculation?
If this is an acceptable solution, you will need to start both of the buffered event counting with a start trigger so that the data from both measurements can be correlated later.

June
0 Kudos
Message 4 of 5
(3,648 Views)
Hi June:

I presume the post processing should work. Now I am fully convinced that there is no other choice. But let me explain the drawback to you. Let's make that I need to periodically perform a buffered counting. In other words a sweep of 10ms acquiring and 10ms dead time. This is my case (and a common case indeed) in fact I need to
1)acquire timestamps in a particular setup of my photodetectors for 10ms or so,
2)change the settings by means of fast DC motors or switches. Allowing 5 or 10ms dead time for that,
3)start another acquiring with the new settings
4)and so on

You can see this is a real-time task. And with post processing you can't be as fast as required because of the lack of an immediate stop.
Nevertheless I am goin
g to try post processing in some way seeing that it's the best you can do with a PCI6602

Piero
0 Kudos
Message 5 of 5
(3,648 Views)