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

Search xD Array (Malleable VI)

Code and Documents

Attachment

Overview

This vi allows to search the indices of an element in an Array having any number of dimensions (array 1D to array xD)

It's a polymorphic vi (vim). The element can be of any type (obviously, "element" must match with those of the array xD)

 

Description

The code is polymorphic itself, associated with a type "vim", this vi gives us an very interesting function. Input parameters: 1) an array of any dimension (from 1D to xD) ... 2) an "element", of course of the same type as those contained in the input array xD ... 3) a flag allows to find either "the first element" or "all elements". The output is an array that gives you the sought indices. Being able to search for anything in an array with any number of dimensions ... I think it's an interesting tool.

 

Software Requirements

 LabVIEW 2017 (malleable VIs)

 

Steps to Execute Code

 above : required inputs and the output. The use seems to me trivial.

 

Additional Information or References

none

 

panel.jpg

ouadji

 

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

Contributors