How can I output a static DC-Voltage with DAQmx-based hardware?

Updated Oct 5, 2024

Environment

Driver

  • NI-DAQ™mx

I want to generate a DC voltage signal at the output(s) of my DAQmx-based hardware module.
Which functions do I have to call to achieve this?

  1. create a DAQmx task and one or more Analog Output channel(s) using "DAQmx Create Virtual Channel.vi" and chose "AO Voltage"
  2. Start the task with "DAQmx Start Task.vi"
  3. Write voltage value(s) to the analog output(s) using "DAQmx Write.vi" (this can also be done in a loop)
  4. Stop the task using "DAQmx Stop Task.vi"
  5. Clear the task using "DAQmx Clear Task.vi"
  6. Check for errors

The code looks like this in LabVIEW:

Screenshot 2023-10-24 at 17.01.39.png

The example shown above can be found in the DAQmx shipping examples:

LabVIEW:

C:\Program Files\National Instruments\LabVIEW 20xx\examples\DAQmx\Analog Output\Voltage - On Demand Output.vi

LabWindows CVI:
C:\Users\Public\Documents\National Instruments\CVI\samples\DAQmx\Analog Out\Generate Voltage\Volt Update

Other languages:

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples