Example Code

Detect largest incoming value or 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.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example demonstrates a method of displaying the largest incoming value into a control on your front panel.

Description:
This VI takes the incoming data, compares it to previous information and if the value is larger it displays the data on the front panel control. In addition to displaying it on the front panel it also stores the value in a shift register.  If the value is not larger than the previous value, then the previous value is still displayed on a front panel and the value in a shift register is still the previous value.

Instructions:
To implement this example:

  1. Download the VI
  2. Run the VI as is or use it as SubVI
  3. Observe the Current Value and Largest Value on the front panel
  4. Stop the VI when finished

To execute this example:

  1. Install the required software.
  2. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible

Hardware
-

bd.pngfp.PNG

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

Mahdieh G
Applications Engineer
National Instruments UK&Ireland

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

Comments
jordankuehn
Member
Member
on

There is no need for a local variable here.  See the attached VI Snippet with minimal changes to the example.

largest value.png

The Colex Group
Lead Software Engineer
Certified LabVIEW Developer
MahdiehG
NI Employee (retired)
on

Thanks for the suggestion. That was a classic mistake there, oops.

Mahdieh G
Applications Engineer
National Instruments UK&Ireland
ThanhDong
Member
Member
on

Hi MahdiehG,

There is also a various method using Max&Min VI to find the  largest value

It is shown below

Max and Min VI.PNG

 

Dong