Example Code

DAQmx Linear DC Power Supply Sweep

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Download All

Overview

This example emulates the functionality of a benchtop DC power supply using only DAQmx driver functions to output a low-to-high sweeping DC signal.

Description

Based on the Voltage - Finite Output example which can be located in LabVIEW's example finder, this example creates an array which uses the parameters under the Sweep Settings section to create a positively sloped DC signal.

Requirements

Software

  • LabVIEW 2013 or compatible
    • Ported to LabVIEW 2010 (not guaranteed to work %100)
  • DAQmx 9.8 or compatible

Hardware

  • NI DAQ hardware with hardware-timed Analog Output

Steps to Implement or Execute Code

  1. Choose your Voltage Range: Note that the range must be within the range the card/device is capable of.
  2. Choose your Sweep Duration: This is the period of time over which the sweep will be completed. For instance, if your Voltage range is 10 volts and your duration is 10 seconds, the signal will increase at a rate of 1V/s
  3. Choose your Step Size: This will determine the number of points that you write. The smaller the step size, the greater the # of samples you'll write.

There were a variety of input parameters I could have chosen from, but any required input can be calculated using these parameters. For instance, if you have a required step duration, you could adjust your step size and sweep duration to meet your requirement.

Additional Information or References

Note that most NI DAQ analog output cards are only capable of driving very small amounts of current.  Overdriving your card will put it into protection mode and risks damaging it.  Review the specifiations for your NI DAQ device for the maximum output current drive.

L DC Sweep 2013.png

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

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors