Example Code

Detect Slope Change of a Linear Signal in 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

Overview

Demonstrates how to locate the point(s) where a signal's slope changes.

 

Description

This example generates a simulated signal by creating a slope of 1 for first 50 and slope of 10 for the remainder. It then iterates through the Y data in 2's detecting slope and compares current slope to previous, if they are different, outputs the slope reading and location point(s) where the slope increases. In this example simulated signal data is generated and used, however, you could replace the simulated data with any other source, like from a spreadsheet, or from a driver like NI-DAQmx.

 

Requirements

LabVIEW 2013 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the program
  2. The simulated signal will be displayed on a graph
  3. The slope change point(s) and slope(s) will be indicated

 

Additional Information or Resources

VI Block Diagram

 

BD.png

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

Applications Engineer

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