Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I generate two digital pulses which are synchronized?

One needs to be a continuous pulse train. The second only need to be a single pulse; however I need the falling edge to coincide with a rising edge of the the continuous train.
0 Kudos
Message 1 of 4
(3,723 Views)
Are there any other timing requirements? If not, here's a fairly simple method using traditional DAQ. It should work with either the DAQ-STC or NI-TIO counters. The basic idea is that the continuous pulse train acts as the timebase that drives the generation of the other pulse, guaranteeing that both transitions of the single pulse are sync'ed to rising edges of the continuous pulse train:

1. Configure the single pulse counter to use "other counter output" as its source signal, using rising edge polarity.

2. Configure the single pulse counter's pulse specs using raw counts. (The minimum legal value is 2.) Let's suppose you choose a delay (Pulse Spec 1) of m and a pulse width (Pulse Spec 2) of n.

3. Configure the continuous pul
se train with the frequency & duty cycle that suits your app, but don't start it yet.

4. Arm / Start the single pulse counter. (Nothing will happen yet).

5. Arm / Start the continuous pulse train.

6. On the mth rising edge of the continuous pulse train, your single pulse produces its leading edge (a rising edge by default). On the (m+n)th rising edge of the continuous pulse train, your single pulse produces its trailing edge (a falling edge by default).

The sequence I outlined allows you to choose exactly which one of the continuous pulse train's rising edges will correspond to the single pulse's falling edge. You may not need this specified precisely for your app but neither will it hurt, and it may be useful to someone else reading the thread.
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 2 of 4
(3,723 Views)
Hello,

Thank you for contacting National Instruments.

I have attached an example program below that demonstrates how to do this using DAQmx. Counter 0 on your board will generate a pulse train with the frequency and duty cycle that you specify. Counter 1 will produce a single pulse triggered by the first falling edge of the pulse train produced on Counter 0. You can adjust the high and low time of this pulse produced on Counter 1.

Regards,
Bill B
Applications Engineer
National Instruments
Message 3 of 4
(3,723 Views)
Thank you very much. Your attachment worked spectacularly.
0 Kudos
Message 4 of 4
(3,723 Views)