Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Two edge separation !?

Solved!
Go to solution

Hi all,

maybe a newbie question but I did not find an exact answer so far.

 

I have two signals.

A slow one which I want to use as start/stop trigger and a fast one from which I want to count the edges.

I want to measure the count of edges of the fast signal occurring between two rising edges of the slow trigger signal.

 

I read the two edge separation help and examples and always found three signals needed.

So my question.

Is it possibel to use two edge separation with only two signals and conncect the slow one (trigger)

to both GATE and AUX ?

Or maybe anyone can tell me how to accomplish this measurement task best.

 

Thanks a lot for any help,

Ralf

 

0 Kudos
Message 1 of 7
(7,141 Views)
Solution
Accepted by Pechmann

Since a picture's worth a thousand words, here, try something like this:

 

custom period.png

 

Here's the idea:

1. Counter is configured for period measurement with units set to Ticks.  Normally this would register the # of edges of an internal timebase clock between consecutive edges of the pulse train whose period is being measured.  Here we are overriding the normal behavior a little bit.

2. Note the DAQmx Channel property node.  We are going to tell the task to count your faster pulse train *instead* of counting an internal timebase clock.

3. In period mode, the count will reset to 0 on each cycle of the period signal.  So you'll get a buffer of values telling you how many faster pulses occurred between *every* consecutive pair of slower pulses.

4. We'll ignore element 0 of the array because its value will be fairly random, representing the time from when the task started until the 1st period edge.  It's very often not meaningful.

 

-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.
Message 2 of 7
(7,136 Views)

Hey Kevin,

thanks a lot. Works perfect.

 

You really helped me out,

Ralf

0 Kudos
Message 3 of 7
(7,110 Views)

I'm also working two edge separation with two signals measuring/plotting delta T between two rising edges. How do I change the acquisition rate? Right now I count 30 samples/second on the output spreadsheet. I need at least 200 kHz.

0 Kudos
Message 4 of 7
(2,197 Views)

Please post your code, preferably after File->Save For Previous Version back several years.  2016 maybe?

 

My guess is that you have a software-timed "on demand" task and then starting and stopping it each iteration of your main loop.  You need to configure a buffered measurement with DAQmx Timing.   You can get a pretty good head start with the shipping example "Counter - Read Pulse Width and Frequency (Continuous).vi"

 

 

-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 5 of 7
(2,191 Views)

HAHA I just saw your reply on this thread while I was sending you a question (same topic) on another thread where you will find the VI and a sample of the data. You must be THE guru! Thanks again so much for your help. Let me know if you need any other information from me.

0 Kudos
Message 6 of 7
(2,185 Views)

Followup is over in the other thread you linked where there's more history and context.

 

 

-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.
Message 7 of 7
(2,177 Views)