Example Code

Remove Duplicate Entries in Sorted 1D 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

This VI removes duplicate adjacent entries in a 1D array. If entries are not adjacent, they will not be removed

 

Description

Some sorted 1D arrays, contains duplicate adjacent entries. Use this VI to remove them. If entries are not adjacent, they will not be removed, which makes it the best way working with sorted lists. The VI also contains Context help description, which can be displayed either hoovering on the VI icon, or using it as a subVI

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Manually Initialize the Input Array
  2. Run the VI
  3. To display Help for this VI, Select Help»Show Context Help and move the cursor over the VI icon to display help for this VI

 

Additional Information or References

VI Block DiagramRemove Duplicate Entries in Sorted 1D Array LV2012 NI Verified BD.jpg

VI Context Help Window

Remove Duplicate Entries in Sorted 1D Array LV2012 NI Verified  context help.jpg

 

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

 

 

Regards,
Dan King

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

Comments
Mike_Powers
Member
Member
on

Nice, very helpful.  I was surprised LabVIEW didn't natively have a block like this.

Eleftherios
Member
Member
on

Thank you!

Just to mention I found out there is a buffer effect, even when it does not get anything as an input it remembers the previous outcome, that you can remove by initializing the first shift register.