LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter/Timer in terms of micro sec using PCI6025E board

I need a counter that can count up to a resolution of micro secs, however the best i can get now is in term of millisecs only using tick count.vi. how can i implement this?
0 Kudos
Message 1 of 7
(3,256 Views)
Your 6025 board comes with (2) 24-bit counters which can run at 20 MHz. These counters can be used to count time between TTL pulses, or they can generate a TTL pulse or pulses with very good accuracy.

Would you like to use these counters to count the time of events, or use them to control the timing of other things? I would like to determine whether these counters are really what you need to use, depending on your application. I ask this because of your mention of the tick count VI.

Mark
0 Kudos
Message 2 of 7
(3,256 Views)
The tick count.vi is based on your computer's system clock which only counts in milliseconds. This VI is not using the counters on your PCI-6025E board. LabVIEW has many excellent shipping examples for using counters to count elapsed time, events, frequency of ttl signals etc... I would reference those examples. Remember that the PCI-6025E has the DAQ-STC ship on-board and so you need to reference counter examples for the DAQ-STC chip. Hope this helps...Todd
0 Kudos
Message 3 of 7
(3,256 Views)
actually, i need a counter to count in terms of micro secs. Sorry but I don't really understand what u meant by counting the time of events? Actually, what I need is a counter to give me the time taken from start of the program till the detection of particular pulses. The board counter you've mentioned above seems to fit my application, pls enlighten on how to utillize this onboard counter in 6025E. Thks & best regards!
0 Kudos
Message 4 of 7
(3,256 Views)
I'm not sure you can use your counters to perform the action you are asking.

The counters can be set up to count while a signal to the counter is high, or transitions. You can start the counter counting when your program starts, but doing it in software is not reliable to microseconds.

Your counter *is* accurate to microseconds when using TTL input signals to the counter, and counting the time between TTL pulses, or the length of a TTL line being high or low.

The counter will return a number. That number divided by 20 million gives you the time duration in seconds, accurate down to 1/20,000,000th of a second.

Hope that made sense.

As from some of your other posts, I'm assuming that you are doing some data acquisition as well
. At what point do you want to "start" this timing, specifically--when your data acquisition starts?

Mark
0 Kudos
Message 5 of 7
(3,256 Views)
Are the counters you've mentioned the tick_count.vi, wait_ms.vi & wait_for_multiple_ms.vi?

I'm not really sure how to use these counters/timers because their outputs are very big numbers which I'm unable to interpret, hence unable to use them even after reading the help.

Is the "divide by 20 million..." you've mentioned referring to the counters I've named above?

How to use them effectively?

In my application, I will be capturing a waveform from the analog pin0 of 6025E. Upon completion of the waveform acquisition, my counter/timer will start counting till my hardware detect a particular signal. The purpose of the counter/timer is to obtain the time duration between the end of the waveform acquisition to the detection of that pa
rticular signal.

For your advise, thks & best regards.
0 Kudos
Message 6 of 7
(3,256 Views)
Lyn,

You are confusing counter/timers with Time & Dialog Vi's, which don't use DAQ timers at all.

First, let's start with the VI's you have mentioned. The tick count vi just returns some millesecond value from a timer on the motherboard of the PC. It has no base reference, meaning you can't directly relate it to world time. But you CAN read the tick_count at a certain time in your code, read it again at some other point in your code, subtract the two, and get a decent idea of how many milliseconds it took to run that portion of the code. However, this VI does not use any hardware from your 6025 board.

The wait(ms) VI just waits a certain amount of time in millliseconds before it allows the code to continue. This is useful when running while loops, to keep them from consuming all the CPU time and not allowing other tasks to run, such as screen refreshes, mouse clicks, etc.

The wait for multiple ms VI is similar to the wait(ms) vi, but it waits for the ms timer on the motherboard to be a multiple of the time wired to the vi.

i.e. If 1000 (1 second) was wired to the wait(ms) vi, it would wait 1 second no matter when it was called.

If that 1000 was wired to the wait for multiple.vi, it would only wait until the motherboard ms timer reaches a multiple of 1000, which depends on when the vi was called.

All of the "timing" of these VIs is dependent on the operating system that you are using, and with Windows, it is not deterministic. Therefore, there is no guarantee that a 1 second wait VI would wait *exactly* 1 second. If Windows gave priority to a mouse movement during that time, the wait might be 1.116 seconds, for example.

Plus, the maximum resolution of these VIs is one millisecond, not the microsecond resolution you are looking for.

To get the type of timing I was mentioning, I was referring to using the timer/counters on your DAQ board. You can see a whole palette of VIs to use with your counters under the Data Acquisition->Counter palette in your diagram. These DO use the counter/timer hardware on your DAQ card, and are deterministic, meaning that they are not dependent on the operating system.

It is the values returned from these counters that I was referring to that would need to be divided by 20 million to get the elapsed time.

Take a look at those VIs, and see if they meet your needs.


Hope that helped,

Mark
0 Kudos
Message 7 of 7
(3,256 Views)