Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate and count on the same line?

NI - I need to determine the width of a signal at the 50% level. Since the value is expected to be 1.8mSec ±.5mSec, I was thinking of using a counter somehow. My first thought is to generate a continuous 1Mhz dig pulse on one channel and read it on another channel. I can then gate when to start and stop counting and convert the count into a time. This seems to be a waste of two channels but if this is the only way, so be it. Is there a way to use a count of an internal counter without having to use external pulses?
0 Kudos
Message 1 of 7
(4,404 Views)
 
 

Hi,

I would like to ask you first, what is 50 % level of the signal? So if you have 5 volts TTL signal you want to measure the width at 2.5? Or if the width is 1ms you want to be able to measure at 0.5ms?  and if this is tha case, why?

Inferring from your question here is a link that might guide you: Making Accurate Frequency Measurements

Also we have some already made example that will measure frequency, period and width. Take a look at the picture attach.

 

Let me know if you have more questions



Message Edited by Jaime F on 01-31-2008 12:36 PM

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 2 of 7
(4,392 Views)
Thanks for the reply - hopefully this will clear things up. I am reading a pulse whose peak value is approx 9Vp. See attached. This is the signal I need to read the 50% mark. I intend only to count the clock pulses from 50% Neg slope to 50% Pos slope. Reading the complete pulse width is not acceptable in this case. So is there a way to count internal clock pulses?
0 Kudos
Message 3 of 7
(4,384 Views)
Um, no disrespect to counters, I'm a big fan too.  But I don't think they're the right tool here, not unless you've got some kind of external comparator you didn't mention.
 
This seems like a straightforward app for analog input followed by post-processing.  With modest work, you could run the processing continuously in parallel with the acquisition (search for "producer consumer" design pattern with queues).  Any particular reason you can't approach this as an analog collection and data manipulation problem?
 
-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 4 of 7
(4,377 Views)
 

Hi,

Like Kevin said I don’t think this would be an application for a counter and one of the first reasons is that you will have to condition this signal to be a TTL to be able to use a counter with it. Acquiring the signal and doing some post processing is your best shoot and basically you will subtract the timestamps on for the voltage levels that you desire.

I’m going to point you to some articles that might help you trigger the acquisition when it enters the window.  Tips and Techniques in Data Acquisition Triggering - NI-DAQmx and Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 5 of 7
(4,366 Views)
Thank you both for your timely help. I did not know about analog edges and the ability to capture timing with the analog signal.
Here is my plan:
1) Sample the pulse height - Vp
2) Divide by two to get the Vp 50% mark
3) Use that value to generate the analog trigger
4) In a while loop, monitor the voltage of the pulse so that when it passes the other 50% mark it will stop reading values.
5) Examine the delta t (dt) of the waveform.
 
Question - does anyone know the precision of the dt in the waveform? (I hope it is in the uSecs.)
 
Thanks also for the articles - they have helped.
 
One more queation - Does NI have any training videos on understanding the DAQmx Vi's better? They seem to be so powerful but obviously you need to use with them proper understanding and some of the polymorphic uses are not very intuitive to less exposed designers. Plus all the possibilities of the property nodes...
0 Kudos
Message 6 of 7
(4,345 Views)
 

Hi,

I want you to remember that this approach is going to need post processing of the signal, so you first are going to use one of our different types of triggering to start and stop the acquisition and the you are going to use LabVIEW to do the measuring after the signal has been acquire, manipulating the array. The precision of the waveform is going to be determined by how fast you sample, so 100 Sample per second means you have a sample every 10ms. 

In your case what I would suggest is to divide your project in two parts, first acquire the signal and after this part is up and running like you need to then analyzing it would be just busy work. This is a very good resource: How Can I Learn LabVIEW?, Getting Started with NI-DAQmx. Search in National Instruments for “DAQmx videos”.

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 7 of 7
(4,330 Views)