Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

use timing measured using counter 1 to set the pulse width on counter 2

I am measuring time between 2 edges on counter 1.  I want to be able to generate a pulse on counter 2 that is dependent on the time measured by counter 1.  The delay on counter 2 is a multiplicative of the time measured on counter 1. Is this even possible?
0 Kudos
Message 1 of 5
(3,807 Views)
Hi V,

This should be possible as long as your data acquisition card has enough counters to perform both operations.  It may help if you specify what data acquisition card you are using and whether you are using the DAQmx or the Traditional NI-DAQ drivers.

I am assuming you are measuring the time between two edges via the two-signal edge seperation method, and I am also assuming you are using LabVIEW and the DAQmx drivers.  With these assumptions, you will have your edge seperation measurement happening within a While loop.  From within the While loop, you may want to implement something similar to the Gen Dig Pulse.vi DAQmx examples (Help>>Find Examples>> Hardware Input and Output>>DAQmx>>Generating Digital Pulses) to generate a single pulse with your calculated delay.

Thaison V
Message 2 of 5
(3,789 Views)

Hi Thaison V,

I am using a PCI 6251 M series card and using DAQMX.  Your assumptions are alomost correct.  I am using a period measurement to measure time in between two leading edges on counter 1 inside a while loop.  I had set up the second counter to generate a single pulse on each trigger (retriggerable digital trigger) inside the same loop and update the low time of the pulse using the channel property.  There seems to be a 2 iteration delay between when counter 2 catches up with time measured on counter 1 time.  I believe this is because the pulse is already generated before the vaule is measured on counter 1.  I suppose if I can use counter write after the counter 1 is read out it might work, but I haven't figured out how to use DAQMX write to write a single pulse ( it works only for pulse train??).

thanks for your help

V


 

0 Kudos
Message 3 of 5
(3,779 Views)
V,

The Gen Dig Pulse.vi example I mentioned in my previous post allows you to generate just 1 pulse using the DAQmx drivers.  If you need the pulse to be retriggerable, you may want to check out the Gen Dig Pulse-Retriggerable.vi example as well.

Thaison V
Message 4 of 5
(3,770 Views)

Hi,

I happen to have similar needs that generate a pulse according to the "two-edge-seperation measurement" in my application. But I have no idea how to let the read-out of the two-edge-seperation measurement to digital trigger (re-triggerable) the pulse generation on another counter output?  Could you guys please help me? Thanks a lot!

-Claude.

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