Generate a Pulse Using an External Clock as the Source
Primary Software: LabVIEW Development Systems>>LabVIEW Full Development System
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems, Driver Software>>NI-DAQ
Hardware: Multifunction DAQ (MIO)
If I want to generate a pulse train on a counter by dividing down the internal timebase of the counter (that is, the internal timebase is the source signal), I can use the Set Pulse Specs VI to determine the characteristics of that pulse.
However, if I want to use an external clock as the source signal to divide down and generate my pulse from, can I still use the Set Pulse Specs VI? If I specify the pulse in terms of the frequency and duty cycle or the delay and width, this VI calculates the appropriate internal timebase to use along with the raw pulse specs to set. If I set the raw pulse specs of the counter, the VI also expects a timebase to be specified. There is no way to explicitly set the counter to use an external source using this VI.
Can I generate a pulse or pulse train using an external clock as the timebase for the pulse?
You can configure the NI-TIO and DAQ-STC counters for a variety of pulse generation tasks such as generating a single pulse or a pulse train. To create a pulse signal, load registers on the counter are used to divide down the source signal into another signal to be output.
A pulse is defined by two phases, the delay of the pulse and the width of the pulse. Therefore, the number stored in the first load register of the counter defines the number of active source edges that will occur during the delay phase of the pulse being generated. The second load register stores the number of active source edges that will occur during the width phase of the output pulse. The counter can use an internal timebase or an external signal for its source.
In LabVIEW, you can program these load registers using the Counter Set Attribute VI. To set the delay of the pulse (load register 1), use the Counter Set Attribute VI with the attribute ID set to pulse spec 1 and the attribute value number set to the delay value (load register 1). To set the width of the pulse (load register 2), use the Counter Set Attribute VI with the attribute ID set to pulse spec 2 and the attribute value number set to the pulse width (load register 2).
You also can use the Set Pulse Specs VI in the
There is a shipping example with the DAQmx driver that allows for a pulse to be generated from an external clock. The only action item in this example is to specify which PFI line on which you will bring in the external clock.
The example can be found by navigating to Help»Find Examples...»Hardware Input and Output»DAQmx»Generating Digital Pulses»Gen Dig Pulse Train-Buff- Ext Clk- Cont.vi
KnowledgeBase 31TELI6I. How Do I Scale the Frequency of My Pulse Train Using a Counter?
Developer Zone Tutorial: Generating a Pulse Train with a Counter
Developer Zone Example: Generating a Finite Pulse Train
Community Example: Generate a Continuous Digital Pulse Train With a Variable Frequency
Report Date: 03/26/2002
Last Updated: 04/16/2010
Document ID: 2JPC08B5