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

Finding Numbers Within a User Defined Range of an Array 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

Overview

Filter array elements between a specified minimum and maximum value.


Description
This example will search through an array of randomly generated values and pull out the values that are within a user-defined range.  A new array is created with the values that are within the specified range and displays them on the front panel.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Additional Information or References
VI Snippet

3-384.png

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

National Instruments
Precision DC Hardware Engineer

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

Comments
1984
Active Participant
Active Participant
on

You can get rid of the boolean logic by using the "in range and coerce" function. Also I dont think initalizing the array, is efficient in this case.

Range.gif