These example programs are a modification of LabVIEW DAQmx shipping example Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi that shipped with LabVIEW 2011 and earlier. They are modified so that the user and start and stop the output on demand. The documentation of the Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi still apply and is quoted below:
This example demonstrates how to continuously output a waveform using an internal sample clock. The automatic regeneration of data has been disabled, so new data has to be provided throughout the duration of the continuous Analog Output operation. This allows the generation of any arbitrary frequency as this VI computes new data for each iteration of the loop, maintaining phase continuity of the signal.
LabVIEW 8.6 or compatible
DAQmx 8.7.2 or compatible
NI DAQ device with Analog Output
Steps to Implement or Execute Code
1. Select the Physical Channel to correspond to where your signal is output on the DAQ device. 2. Enter the Minimum and Maximum Voltage range. 3. Specify the desired Sample Clock Rate of the output Waveform. Higher sample clock rates will produce a smoother waveform. 4. Manually specify the Analog Output buffer size, in number of samples. A larger buffer would help non-regenerative operations avoid errors due to occasional high CPU load. Note: The Analog Output buffer has to be at least as big as the amount of data being written to the board per iteration. The recommended buffer size would be at least twice the amount of data being written to the board per iteration. 5. Enter the Waveform Information. See the documentation of the Basic Function Generator SubVI for information on each parameter
The function generator 2 channel.vi is designed for using two analog outputs and the function generator 4 channel.vi is designed for using four analog outputs. Using the Basic Function Generator VI you can generate a waveform that can be outputted on an along output.
Screenshot of function generator 2 channel.vi block diagram.
Screenshot of function generator 4 channel.vi block diagram.
**This document has been updated to meet the current required format for the NI Code Exchange.**