Example Code

Sort Two-Demensional Array by 1st Column Value

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

This VI sorts a two-column array by its first column, then sub-sorts by second column values.

 

Description

Another version of Sort 2D Array, very simple. This VI sorts a two-column array by its first column, then sub-sorts by second column values. It shows what Index & Bundle Cluster Array function can be used for.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Set values for the Unsorted Array and Priority Columns (0).
  2. Run the VI 

 

 

Additional Information or References

 

VI Snippet

1.png

 

 

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

Product Support Engineer
National Instruments

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

Comments
plapsldpla
Member
Member
on

Excellent! just what I was looking for!  You may have to transpose the 2D array if you are having a truncated output.

TimsTools
Member
Member
on

Please consider this alternative.  2D Array Multi-Column Sort Ascending / Descending POLYMORPHIC.

https://decibel.ni.com/content/docs/DOC-48871

It works for all common datatypes and allows the user to select 1 to n columns to sort on.

Tim