Summary: In this lesson, you will learn how to perform analog output.
Use analog output to perform digital-to-analog (D/A) conversions. The available analog output types for a task are voltage and current.
![]() |
To perform a voltage or current task, a compatible device must be installed that can generate that form of signal.
When performing analog output, the task can be timed to Generate 1 Sample, Generate n Samples, or Generate Continuously.
Use single updates if the signal level is more important than the generation rate. For example, generate one sample at a time if you need to generate a constant, or DC, signal. You can use software timing to control when the device generates a signal.
This operation does not require any buffering or hardware timing. For example, if you need to generate a known voltage to stimulate a device, a single update would be an appropriate task.
One way to generate multiple samples for one or more channels is to generate single samples in a repetitive manner. However, generating a single data sample on one or more channels over and over is inefficient and time consuming. Moreover, you do not have accurate control over the time between each sample or channel. Instead, you can use hardware timing, which uses a buffer in computer memory to generate samples more efficiently.
You can use software timing or hardware timing to control when a signal is generated. With software timing, the rate at which the samples are generated is determined by the software and operating system instead of by the measurement device. With hardware timing, a TTL signal, such as a clock on the device, controls the rate of generation. A hardware clock can run much faster than a software loop. A hardware clock is also more accurate than a software loop.
Programmatically, you need to include the timing function,
specifying the sample rate and the sample
mode (finite). As with other functions, you can
generate multiple samples for a single channel or multiple
channels.
Use Generate
Continuous generation is similar to Generate continuous.
When a device controlled by NI-DAQmx does something, it performs an action. Two very common actions are producing a sample and starting a generation. Every NI-DAQmx action needs a stimulus or cause. When the stimulus occurs, the action is performed. Causes for actions are called triggers. The start trigger starts the generation. The reference trigger is not supported for analog output tasks.
"A full introductory course on programming with LabVIEW."