Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006

User-defined duty cycle for a square wave output using the DDS mode of operation for the NI 5401, NI 5411, or NI 5431 (program written in LabWindows/CVI).

0 ratings | 0.00 out of 5
Print

Downloads

Filename: squareduty.zip
Requirements: View

When outputting a signal using DDS mode, an array consisting of 16,384 points representing the waveform is loaded into the DDS buffer. The Configure Standard Waveform function in NI-FGEN has a 'waveform' input which automatically creates an array representing a standard waveform and loads this into the DDS buffer. When 'square' is selected as the waveform input to this function, the square wave loaded into the buffer has a duty cycle of 50%.

If you want to output a square wave with a duty cycle other than 50%, you must create and load the raw data corresponding to this waveform into the DDS buffer manually. The following example demonstrates how to create the square wave with the desired duty cycle in C, and then how to load this data into the DDS buffer for output.

Requirements


Filename: squareduty.zip

Software Requirements


Application Software: LabWindows/CVI Full Development System 5.5
Language(s): C

Hardware Requirements


Hardware Group: Signal Source (AWG/FG/AO)
Driver: NI-FGEN 1.0.1

 
0 ratings | 0.00 out of 5
Print

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/).