LabVIEW is shipped with some example VIs that demonstrate how to write data using the DAQmx API.
For most LabVIEW projects, especially when you are new to LabVIEW, it is beneficial to start from a working example and modify the code to fit your needs.
See the following locations for the Digital Output shipping examples in
NI Example Finder:
- Hardware Input and Output --> Digital Output:
- Digital - Finite Output.vi - Generate a finite amount of digital data based off of a sample clock.
- Digital - Continuous Output.vi - Generate a continuous amount of digital data based off of a sample clock.
- Digital - SW-Timed Output.vi - Generate digital output data based on software timing or user inputs. (Some of this code can be seen below).
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
Additional Information
The
DAQmx Write VI is capable of handling Boolean and Numeric data, including arrays. However, the data that you write must be in the units of generation.