Example Code

IEPE - Continuous Input Example

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.


  • Data Acquisition (DAQ)


  • LabVIEW


  • NI DAQmx

Code and Documents


Demonstrates on continuously buffered acquisition of the acceleration, sound pressure, force measurements from IEPE sensors using a DAQ device.

At the beginning of this block diagram, DAQmx Create Virtual Channel (VI) - AI Force IEPE is used to create channel(s) that use an IEPE force sensor to measure force or load.
Property nodes are used to pass the ring values to set the label of the waveform graph Y-axis.
To verify the sampling rate used by the channel and whether the specified sample rate is being coerced, use the DAQmx Timing property node to read the Actual Sample Rate.
After creating a TDMS file path into which the data will be logged and setting the trigger, start the acquisition and display available data on the waveform graph.

LabVIEW 2012 or compatible.
NI-DAQmx 15.5.1 or compatible.

1.  Select the physical channel from which the signal is acquired on your device and select the measurement type needed for the analog acquisition within the Channel Settings section..
2.  Set the sample rate and clock source for your acquisition in the Timing Settings section.
This determines the number of samples reads and the number of points to be plotted on the graph each time the while loop iterates.
Note:  The rate should be at least twice as fast as the maximum frequency component of the acquired signal.
3.  If desired, define the trigger channel, trigger level (for analog), and rising/falling edge for a start trigger.
4.  If desired, turn on TDMS Logging and select a file path for the data.
5. Run the VI

Steps to Implement or Execute Code:
1.  Create channel(s) for the Analog Input task that use an IEPE force sensor to measure force or load.
2.  Set the sample rate and define a continuous acquisition.
3.  Implement DAQmx TDMS Logging for the task.
4.  Define the trigger channel, trigger level (for analog only), and rising/falling edge for a possible start trigger.
5.  Call the Start VI to start the acquisition.
6.  Read the waveform data in a loop until the user hits the stop button or an error occurs.
7.  Call the Clear Task VI to clear the Task.
8.  Use the popup dialog box to display an error if any.




**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.