Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Gate two retriggered counters using a seperate counter

Hi everybody,

 

please let me explain my setup (PCI 6602) in a few words:

I have a light barrier, a flash lamp and a spectrometer. The light barrier measures the frequency of my device continuously and works as some kind of a clock for the whole system.

 

A spectrometer counter (retriggered) is producing triggers continuously after some defined delay. This delay changes based on the frequency and some factors and is updated using CO.Pulse.LowTime.

 

The lamp trigger/counter is configured retriggerable as well and is armed (internal routing) with a defined delay on the spec trigger.

 

The data aquisition is done using the spectrometer drivers and an USB connection. The spectrometer is programmed to aquire a defined # of spectra on command.

 

This setup is based upon the Queued State Machine - Producer Consumerarchitecture and works perfectly. It is fast, stable and so on, BUT:

A lot of unnecessary triggers are produced because there is always some waiting time from aquisition to aquistion. This is not important for the spectrometer. Hence, for the flash lamp it might be a problem because its lifetime is very limited.

 

Therefore a thought about some kind of gating counter which turns on/off the output of the spectromter and lamp triggers. The state trigger could be turned on with the spectrometer DAQ-commad and turned off afterwards. By means of this almost every lamp flash could be utilized (some in the end might get lost).

 

Somebody has some idea how to realize this without loosing too much performance? The gating of the spec and lamp counters should be as fast as possible (it has to be less than 5ms).

 

Thank you so much for your support.

 

Johannes

0 Kudos
Message 1 of 5
(5,846 Views)

Push. 🙂

Has nobody some hint for me?

0 Kudos
Message 2 of 5
(5,797 Views)

Hey Johannes,

 

ich have found a hint fo you 🙂

 

Counter Event Pause Trigger

https://decibel.ni.com/content/docs/DOC-2095

 

This VI allows you to pause the counter and hence the trigger signals.

I hope this example may help you out

 

Roman Imhoff

Applications Engineer

National Instruments

0 Kudos
Message 3 of 5
(5,783 Views)

Hi Roman,

 

thanks for your reply! Unfortunatly this doesn't seem to work with retriggered pulses. Any other ideas?

0 Kudos
Message 4 of 5
(5,746 Views)

One of the nice things you get with all the counters available on the 6602 is some extra flexibility to accomplish things indirectly that can't readily be done directly.

 

The reason for your problem is that a pause trigger would need to map to the same internal counter pin as the retriggering signal.  That's why you can't do both at once, at least not *directly*.

 

I'm not near hw and don't have time to whip up a whole example, but here's one way to solve the problem IN-directly.

 

1. The key to the whole thing is to set up a 3rd counter for pause-triggered continuous generation.  This is going to be your master timebase.  I'd probably aim to set it up for 1 MHz.  It's a nice round number which will just help make things more intuitive.

 

2. Both of your retriggerable pulse tasks need to be configured to use the 3rd counter as their timebase.  I'd also define the pulse parameters in terms of "Ticks" rather than seconds.   This is where the round 1 MHz is convenient because 1 tick == 1 microsec.

 

3. Now, by pause triggering the counter that acts as a timebase, you can stop the retriggering counters from generating pulses.

 

Note that when you pause the timebase counter, the retriggerable counters will (I'm pretty sure) essentially have their output state frozen rather than reverting to a known idle state.  Odds are this won't be a problem because the external devices you're driving are probably edge sensitive.

 

 

-Kevin P

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 5 of 5
(5,740 Views)