Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I implement an 'If then' statement with counter/timer hardware operation?

Dear All,
We have a PCI-6602 card and LabVIEW 8.0/DAQmx running it, and I'm using it to control the operation of a laser scanning microscope. Essentially, the task is as follows...
Counter A is setup to output a pulse everytime it gets some x number of input TTL pulses from a photomultiplier tube module (corresponding to x detected photons). I then do a bufered period measurement with counter B to measure the time between the output pulses from counter A and thus generate an array of waiting times which is essentially the image itself.

Here's the problem - I want to setup a condition wherein counter A gives an output pulse and resets its count back to 0, if the x input pulses do not come within a timeframe t. This is essentially like an 'If-then' operation, but I do not know how to implement it in hardware. Note that such an operation has to be done in hardware, since photon counting rate is some 20 MHz -  a timescale of the order of 0.1 microseconds, and way to fast for software control.
Would appreciate any ideas you might have reg this...
Regards,
Ashesh
0 Kudos
Message 1 of 4
(4,395 Views)

I'm a little confused about what you're trying to do -- it's not quite making sense in my head. Here's what I think you're saying:

1. Counter A generates 1 output pulse for every 'X' input edges from a PMT.

2. Counter B measures buffered periods of Counter A's output, establishing timestamps for equal-size groups of 'X' PMT edges.

3. You would like counter A to "reset to 0" AND (?) generate an output pulse if some time 'T' passes before receiving 'X' input PMT edges.

I don't understand why you'd want counter A to generate a pulse for less than 'X' PMT edges.  You'd end up with a buffered period measurement in counter B which represents something different than all the other ones.  That period would represent the time for less than 'X' pulses, and you wouldn't know how many.

Or do you only want to reset A but NOT output a pulse in case of a timeout scenario?

-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 4
(4,391 Views)
thanks for your reply kevin, I'll try to explain my app a little better...
Counter A's output is used as a clock to time analog output of a predefined waveform (on a different card) - this is what moves the scan mirrors around, which in turn move the laser beam across the field of view. The trouble is that if the laser beam is currently positioned over a dark region, the PMT count rate is very slow and hence for a darkish field of view, it takes a long time to get even a single frame.
Thus, I wanted to introduce an cutoff, such that if 'x' photons are not detected in some time t, the scanner moves the laser beam to the next pixel and the photon count can be reset to 0 - this would speed up imaging time, and its no problem since I only want to look at the brighter pixels (i.e. the ones with time< t for x photons).

So, to summarize, counter A needs to be reset to 0, and I need an output pulse at time t; however, this output pulse could be from another counter, not neccessarily counter A.

I hope I've made things clearer now
Regards,
-Ashesh


0 Kudos
Message 3 of 4
(4,388 Views)

Hi Ashesh,

As far as I’ve been able to determine, there isn’t a way to do this (completely in hardware) using the DAQmx API. You might be able to do this if you develop your own driver, and you would certainly be able to do this with the onboard FPGA of an R Series card. I have a couple solutions that would work, but require restarting a task (software element). If you’re interested, let me know and I’ll post it.

Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
0 Kudos
Message 4 of 4
(4,353 Views)