Example Code

Hold the Peak Value Using Shift Registers

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

When taking in measurements from a device it's sometimes worth keeping note of the highest value or peak that was input.

Description

By using shift registers you can keep hold of the values that have been input. By processing these values with the "Min & Max" function you can keep hold of the largest value. This program uses a numeric control as an input source, this could quite easily be changed to a DAQmx Analogue Input channel instead. It also has a Reset button that will directly wire a value of "0" into the shift register. This will wipe the data that it is currently holding onto.

1.png

Steps to implement or execute code

- Download the attached "Peak Value.vi"

- Open the vi and click run

- Notice that as the value on the dial increases so does the value on the "Peak Value" indictor

- Now lower the value of the dial and see that the "Peak Value" indicator keeps it's value

Requirements to Run

Software

LabVIEW 8.6 or newer

Additional Images

1.png

Daniel Harryman MEng
CLA, CPI

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

Contributors