DAQmx - Retriggerable Pulse Train Generation - LabVIEW - CVI - ANSI C - VB.NET - C#.NET
Overview
This example demonstrates how to generate a finite pulse train from a Counter Output Channel for every rising or falling edge of a digital trigger. The Frequency, Duty Cycle, and Idle State are all configurable.
Downloads
Filename: lv_retrig-pulse-gen01.vi
Requirements: View
Filename: cvi_retrig-pulse-gen01.zip
Requirements: View
Filename: cs_retrig-pulse-gen01.zip
Requirements: View
Filename: vbnet_retrig-pulse-gen01.zip
Requirements: View
Filename: ansic_retrig-pulse-gen01.zip
Requirements: View
Example Category:
CO
Description:
This example demonstrates how to generate a finite pulse train from a Counter Output Channel for every rising or falling edge of a digital trigger. The Frequency, Duty Cycle, and Idle State are all configurable.
This example shows how to configure the pulse in terms of Frequency/Duty Cycle, but can easily be modified to generate a pulse in terms of Time or Ticks.
Instructions for Running:
1. Select the Physical Channel which corresponds to the counter you want to output your signal to on the DAQ device.
2. Enter the Frequency and Duty Cycle to define the pulse parameters. You can also change the Idle State to set the state the line will remain in after the generation is stopped. Additionally, you can set the Initial Delay (in seconds) which will delay the beginning of the pulse train from the start call; this is currently set to 0.0 by default.
3. Setup the Trigger Parameters. In this example the program is expecting a Rising Edge Digital Trigger on PFI9.
4. Enter the number of pulses to generate on the counter output for every rising or falling edge on the input trigger.
Steps:
1. Create a task.
2. Create a Counter Output channel to produce a Pulse in terms of Frequency. If the Idle State of the pulse is set to low
the first transition of the generated signal is from low to high.
3. Configure a digital edge trigger.
4. Call the Timing function (Implicit) to configure the duration of the pulse generation.
5. Set the operation to be retriggerable.
6. Call the Start function to arm the counter and begin the pulse train generation.
7. For continuous generation, the counter will continually write data until Stop button is pressed.
8. Call the Clear Task function to clear the Task.
9. Display an error if any.
I/O Connections Overview:
The counter will output the pulse train on the output terminal of the counter specified in the Physical Channel I/O control.
In this example the output will be sent to the default output terminal on ctr0.
For more information on the default counter input and output terminals for your device, open the NI-DAQmx Help, and refer to Counter Signal Connections found under the Device Considerations book in the table of contents.
Recommended Use:
1. Call Configure and Start functions.
2. Call Stop function at the end.
Requirements
Filename: lv_retrig-pulse-gen01.vi
Software Requirements
Application Software: LabVIEW Base Development System 7.1, LabVIEW Full Development System 7.1, LabVIEW Professional Development System 7.1
Language(s): LabVIEW
Additional Software: Visual Studio 7.0
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO), Counter/Timers (TIO)
Driver: NI-DAQmx 7.5
Software Requirements
Application Software: LabWindows/CVI Full Development System 7.1
Language(s): C
Additional Software: Visual Studio 7.0
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO), Counter/Timers (TIO)
Driver: NI-DAQmx 7.5
Software Requirements
Application Software: Measurement Studio .NET Support 7.0
Language(s): Visual Studio .NET, C#
Additional Software: Visual C++ 6.0
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO), Counter/Timers (TIO)
Driver: NI-DAQmx 7.5
Software Requirements
Application Software: Measurement Studio .NET Support 7.0
Language(s): Visual Studio .NET, Visual Basic .NET
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO), Counter/Timers (TIO)
Driver: NI-DAQmx 7.5
Software Requirements
Language(s): C
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO), Counter/Timers (TIO)
Driver: NI-DAQmx 7.5
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
