Example Code

Manually Scaling Data to DAQmx acquired data

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

Code and Documents

Attachment

Overview

This example showshow to manually apply a scale to DAQmx acquired data

 

Description

DAQmx has a really easy way of applying a custom scales to your channels.  But there may be a time where you want to read and record the raw voltges along with the scaled voltages.  In this case you would need to manually apply the scales in LabVIEW.

 

The attached code is an expansion of the continuos acquisition DAQmx example.  The part that is added is the auto-indexing For-loop.  The constants wired to the loop will be used in the formula node to set the slope and intercept of the linear scale being applied in the Formula Node.


Requirements
LabVIEW 2012 (or Compatible)

 

Steps to Implement or Execute Code

  1. modify acquisition parameters
  2. run VI

Main VI Snippet:

 

DAQmx manually scale data LV_2012_NI_Verified.png

 

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

Justin Parker
National Instruments
Product Support Engineer

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