Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming a Time Delay without Gating

I would like to program a Time Delay using the Simple-Event counting scheme with one counter, without it being gated.

I would specify the initial count and then count DOWN the number of events until it reaches zero. At zero, the counter would automatically become disabled and would trigger an event or pulse notifying me that the counter has reached zero.

The examples I've seen always use gated signals or buffers. To simulate a delay all I want is to count down events and leave when it's done, without
having to manually stop the counting.

Please let me know if this is possible.

Thanks,
Nandeesh
0 Kudos
Message 1 of 5
(3,951 Views)
Hi Nandeesh,

I think there is something that will do just what you want even though it doesn't count down. If you use a counter in single pulse generation mode, then you could set the number of source cycles for delay (your countdown value), and as soon as the counter passes that number of cycles, you would get a single rising edge (and later a falling edge) on the counter output.

You can use the "Generate Single Pulse" example program included with LabVIEW (there are similar examples with our other environements). For LabVIEW, just change the pulse specs input from time specifications to raw specifications.

Hope that helps in your search Nandeesh,

John N
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,951 Views)
Hello,

Thanks for the information! I have tried that succesfully, using a pulse timer and defining the pulse width (time delay) and pulse delay (trigger pulse).
I would rather that the counter send a software event notifying me that the count has reached ZERO. The counter shouldn't be gated or buffered.

Please let me know if this is still possible,
Thank you
Nandeesh
0 Kudos
Message 3 of 5
(3,951 Views)
Hi Nandeesh,

I think you could do this indirectly with another counter in event counting mode. Since you want a software timed notification, then you could write a background loop that constantly runs after you setup the countdown timer. It will just poll the second counter until it sees the first event.

It sounds like you really want to avoid using two counters, but I don't know of any way to do this using only one DAQ board and only one counter. You could do a simple external latch circuit to watch for the pulse. Then watch the output of the latch on one of your DIO lines.

I am sure you (or someone else here) can come up with a way to get what you need. If you want more ideas, I suggest you post more detailed information about your applicat
ion and your equipment. Then it is easier for everybody to think about what you have to work with.

Take care,

John N
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,951 Views)
Nandeesh, I was thinking of another way to do things with one counter. If you set a single counter to do event counting, then you could set the initial count to whatever countdown value you want. Set the counter to count Down instead of Up, and then just poll for an overflow (the overflow shouldn't reset even if your count continues).

This is all in software and uses only one counter with no external pieces.

Good luck,

John N
Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(3,951 Views)