From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Table Scaling Function for Non-Linear Scales Using LabVIEW

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.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

The provided example VI shows how you can perform scaling on data using a table of real vs raw values. This is available in LabVIEW with the DAQmx palette but this is usable on an RT target.

 

Description

Using this VI you should be able to scale your values using a table which allows for non-linear scaling relationships with data.

 

Requirements

  • LabVIEW 2012 (or compatible) 

Steps to Implement or Execute Code

  1. Download the VI
  2. Insert the VI into your code
  3. Wire the scale table (defining the scaling), input sign and accuracy into the VI.
  4. The output signal will be scaled as per your table.

Note: The accuracy defines how much the input signal/scale table needs to be interpolated to allow for array manipulation. The higher the more accurate however there is an exponential increase in CPU requirements.

 

Additional Information or References

VI Block Diagram

 Scaling.png

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

 

 


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

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