Overview:
This example demonstrates how to output a sine waveform.
Description:
This example VI will output a ramping up sine wave followed by a steady state sine wave. This method allows for a nearly seamless transition from the ramp state to steady state.
Requirement:
NI LabVIEW 2012 or compatible
NI-DAQmx 9.0 or compatible
Steps to Implement or Execute Code:
Steps to Complete:
- Create an Analog Output Voltage channel.
- Configure the task to prohibit the automatic regeneration of data.
- Call the DAQmx (Sample Clock) VI to set the sample clock rate. Additionally, set the sample mode to Continuous.
- Read the actual sample clock rate.
- 5a. True Case: Compute the desired waveform for the ramp up. We use a Formula Waveform.vi which allows the user to input an equation. This is only needed when the loop is executed for the first time.
5b. False Case: Use the Basic Function Generator.vi to create a steady state sine wave.
- Write the waveform to the output buffer.
- 7a. Call the Start VI. This is only needed when the loop is executed for the first time.
7b. Do nothing.
- Loop continuously until user presses the Stop button. Every iteration computes and writes a new waveform to the buffer.
- Call the Clear Task VI to clear the Task.
- Use the popup dialog box to display an error or warning if any.

**This document has been updated to meet the current required format for the NI Code Exchange.**