Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Creating a Delayed, Retriggerable and Finite Pulse Generator

Primary Software: Driver Software>>NI-DAQmx
Primary Software Version: 8.5
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Multifunction DAQ (MIO)>>E Series

Problem: I want to perform a delayed, retriggerable, finite pulse train generation.  When I generate a single finite pulse from a retriggerable counter (Fig. 1 - Delayed retriggerable single pulse), it behaves differently than generating a finite pulse train from a retriggerable counter (Fig. 2 - Delayed retriggerable pulse train).

When I generate a pulse train of one pulse, I get the expected behavior according to: Knowledgebase 3GSKKKR6: Different Counter Retrigger and Initial Delay Behavior in Traditional (Legacy) NI-DAQ and DAQmx.  When the first trigger occurs, the counter will wait an Initial Delay  in the Idle State before it changes state.  For all subsequent triggers, the counter starts in the Idle State, then switches to the non-Idle state immediately (regardless of the Initial Delay).  In the case of Fig. 1, each triggered subsequent pulse has a Low Time specified that is less than the Initial  Delay.  With a single pulse, you can also set the Low Time equal to the Initial Delay and it will appear with an offset of this value on each triggered pulse.

 Delayed retriggerable single pulse (1kHz pulse train + 1ms initial delay)

Fig. 1  - Delayed retriggerable single pulse (1kHz pulse train + 1ms initial delay)

When I try to do a delayed, retriggerable finite pulse train generation, the delay occurs properly only at the first trigger but not at the others.  For latter triggers, the counter acts immedicately and the finite pulse train is triggered with no delay even when the Low Time is set.

Delayed retriggerable pulse train (1kHz pulse train + 1ms initial delay)

Fig. 2  - Delayed retriggerable pulse train (1kHz pulse train + 1ms initial delay)

How can I setup this issue?



Solution:
In order to setup a delayed, retriggerable finite pulse train with more than one pulse, two counters need to be used.

The first counter (ctr 0) should be configured to generate a continous pulse train on its OUT pin.  This pulse train is then gated by the second counter (Ctr 1).  Using the DAQmx Trigger property node, you configure the continuous pulse train to pause when the internal output of the second counter goes low.  This means that the only visible pulses will be when ctr 1 is high, which is gating the continuous pulse train to be configured as a finite generation.

In the following picture, the number of pulses that will be seen is configured by dividing the number of desired pulses (5) by the frequency of the continuous pulse train (1000 Hz).  This gives a high time for the gating counter of 5 ms.  The low time is also configured to be 5 ms.  This means that when the trigger is received, which is PFI 1 in this case, there will be 5 ms of low time on the gate before the 5 pulses are seen.  This effectively creates a delay for each retriggerable generation. 

 


 

A LabVIEW example is also linked below.



Related Links:

KnowledgeBase 2P5EJFUV: How Can I Set the Counters on My E Series DAQ Card to Achieve a Re-Triggerable Analog Input Acquisition?


KnowledgeBase 3ZPA11IU: Using One Counter to Generate a Retriggerable Finite Digital Pulse Train with a PCI-6602 and DAQmx


KnowledgeBase 2JDFL3XA: Finite Pulse Train Generation Triggered by Both Rising and Falling Edges of a Trigger Pulse Using Analog Triggering


KnowledgeBase 1VQ9J3LL: Configuring an Analog Input Acquisition with Multiple Triggers on an E Series DAQ Device


KnowledgeBase 3GSKKKR6: Different Counter Retrigger and Initial Delay Behavior in Traditional (Legacy) NI-DAQ and NI-DAQmx




Attachments:

Delayed retriggerable pulse train (1kHz pulse train + 1ms initial delay)Pulse Train Trigger Multiple Pulse.jpg

Delayed retriggerable multiple pulses (1kHz pulse train + 1ms initial delay)Pulse Train Trigger Multiple Pulse.jpg

Delaye, Retriggerable, Finite Pulse Triain.jpgDelayed Finite Pulse Train.JPG

Delayed Finite Pulse Train.viDelayed Finite Pulse Train.vi

 

 






Report Date: 10/17/2007
Last Updated: 02/03/2008
Document ID: 4EG9AN46

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit