Example Code

Hardware timed non periodic analog output

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

Overview
This example demonstrates how you can update an analog output using hardware timing using a non periodic digital waveform.

Description:
This can allow the user to maintain a high timing resolution while saving memory space for the analog output.  This was brought to my attention here. The example uses three tasks.

  1. An analog output task.  This task outputs voltages from an array.  The values need to be updated at specific times but in a non-periodic manner.
  2. A digital output task.  This task contains a waveform that tells the analog output task to update.  This allows you to create a random update pattern.
  3. A counter task.  M-series cards cannot do hardware timed DIO using an internal timebase, so we can use a counter to provide an "external" timebase.

You will need to physically connect the digital output line to the analog output trigger line.

 

Steps to Implement or Execute Code:

  1. Open the block diagram.
  2. Configure the channel for each task.
  3. Run the VI


Requirements
Software
LabVIEW 2012 or compatible
NI-DAQmx 9.0 or compatible

Hardware
PXI-6733 or compatible

 

2017-05-10_11-20-45.jpg

 

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

Applications Engineer
National Instruments

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