Example Code

Set Constant Digital Value with HW Buffered Digital 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
The example demonstrates how to set a constant digital value using the DAQ pin of the Digital Output

Description:
This VI performs a buffered digital output that will write a digital output line high for a user specified period. It is designed for situations where repeatability is crucial, requiring a hardware-timed period.
The user specified time is multiplied by the clock rate, and an array of word integers is generated and written to the digital output device. The clock is generated by a dummy counter output task. There is also a correlated digital input that can be used to read the physical output from the device.

Steps to implement or execute code
To implement this example:
  1. Set the timing for how many seconds would the high states stay
  2. Run the VI
  3. (Optional) Turn on the Highlight Execution to see the flow of the VI


To execute this example:

  1. Install the required software.
  2. Connect the DAQ hardware that supports the DIO and Counter features
  3. Confirm the connection with the MAX with TestPanel
  4. Open the VI and refer the Implement Steps


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

Hardware
cDAQ with C series Digital IO and Counter Module

 

fp.JPG

 

bd.JPG

 

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

National Instruments | Mechanical Engineer | http://www.ni.com/support

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