Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

digital event counting triggering - 6602

I want to implement the following if possible, I am using LV7.0 daqMX 7.2 and a NI6602 counter-timer board over PCI.
I have a sensor which puts out TTL pulses for each event. The pulse rate will range from ~ 100 per second to <10^6 per second. I want to set up a counter to determine if a rate is over a threashold and if it is set the output of the counter to high. The solution must be run in a hardware task with no software logic. I want to set the temporal bins of the counter to be run at 1MHz (ie 1 microsecond) and count events in each bin, if the bin is over the threashhold count value (software configurable), we set the out value to high, otherwise the output of the counter is low. Is this possible with the 6602, or should I look for other solutions (not 6602 custom circuits). Any help is greatly appreciated.

-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 1 of 5
(3,972 Views)
Paul,

Hmmmm. I haven't thought of a method yet, but I'm also not sure I understand 100% exactly what you need. I sorta suspect that you won't be able to do it in hw on the 6602 alone, though I'm not ready to give up either.

1. How many of the 6602's counters are available for you to use in this solution?

2. What's special about the 1 Mhz rate you mention? Are you generating it with one of the counters? Could you use the internal 20 Mhz timebase instead?

3. Do you need the output to go high just once if the threshold freq is exceeded? Or does the output state need to track the input freq in real-time? I.e., do you want it to go high instantly when a high freq is detected then drop low instantly on the next low freq, and so on?

4. I'm not sure what you mean by "temporal bins running at 1 MHz." If you sample at 1 MHz, and your source signal is < 1MHz, all your bins would only hold values of 0 or 1. (Assuming that you had properly set the 'Duplicate Count Prevention' property. Otherwise, you'd store only the 1's and not the 0's.)
On the other hand, if 1 MHz is your source signal and sample #'s of these between your sensor pulses, then a high pulse rate will register as a small # in a particular bin.


Offhand, I've only got one sketchy idea that might help some.

Setup a counter for position measurement from an Up/Down encoder using Ticks for units. Set your counter's initial value as close to TC as possible, let's say 2. Configure the counter to toggle on TC and setup the output polarity so it'll be initially low. Wire your sensor signal to 2 PFI lines, one for UP and the other for DOWN. Configure digital filtering on the UP line only, at a frequency corresponding to your threshold.

The idea: On each pulse from your sensor, the DOWN line sees it immediately while the UP line sees it after a short delay, if at all. Internally, the count will sit at 2 waiting for a sensor pulse, then go 1-2 in quick succession when one arrives. If the sensor pulse frequency is too high however, the UP count won't happen and the count sits at 1. Then the next pulse sends the counter DOWN to TC (0). The counter output then toggles high on reaching TC. Assuming the pulse is low freq, the UP count will set the count back to 1. I think the counter won't re-toggle the output on the next down count that sends the count to 0 again.

This method may let you generate a one-time state change from low-->high one sensor pulse after the high freq interval.

-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
(3,946 Views)
1 Mhz is not a magic number, in general I will have counts at rates near zero/second except when an event occurs then I will see 1000's/second for short durrations of arround 5microseconds. I chose 1Mhz because any slower would cause the events to be averaged out and I would not be able to get good time resolution. Usuing the 20Mhz clock is no problem as the gate though. My only worry is that 20MHz is too fast since a noise spike woulds be seen as an event. What I am doing is running sensor data into a photomultiplier photon counting unit, this unit will put out TTL pulses (40ns long) when photons are detected. Normally durring dark noise time the counts are near zero, but not always zero since there is some background noise, when a sensor event occurs, I will see a spike of ttl pulses with a high rate and durration in the order of 5 microseconds, I want to detect the rising and falling edges of this event in realtime and use it to gate other counter opperations, I have all other counter events working (5 of 8 counters are already taken on the 6602). I could use an analog trigger circuit but do not have the hardware for it at this time hence the all digital processing approach I was looking for. I was thinking of using the gate with a 1MHz external clock to bin the counts in realtime and if a 1 microsecond count sum was over a certain level to set the output polarity of the counter to high. I had something like this a long time ago with the 6602 to do electronic gearing of stepper motors using multiple counters on the 6602. I thought I had set the counter to count down from zero from some set number and when it hit zero trigger an event and start over, but thjis is much more complex since there is retriggering and other issues involved. I will probably wimp out and set up an external analog trigger using a schmitt trigger if I can get a hold of an analog PMT.

-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 5
(3,943 Views)
Keven,
Thanks for the suggestions I will try them out. The 6602 always seems to amaze me on how much it can do its just figuring out how to do it is the problem.

Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 5
(3,940 Views)
Paul,

Well my earlier idea won't do quite what you need, and I haven't been able to think up any other weird thing to do with the 6602 to get there from here either. I think you'll probably need that external circuit. Good luck with it, and please post back if you think of an all-digital solution.

-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 5 of 5
(3,925 Views)