I couldn’t live without “Conditional Auto-Indexing Tunnel”

Posted on Monday 28 May 2007

This is the tenth article of “The OpenG VIs that I couldn’t live without“, a series of articles showing some of my favorite OpenG VIs. In this article, I’m going to show a very useful VIs called the Conditional Auto-Indexing Tunnel, which is a powerful tool for conditional filtering of 1D arrays.

Conditional Auto-Indexing Tunnel

This VI filters a 1D array, keeping only those elements were corresponding elements in a Boolean array are TRUE. This is a little bit harder to explain with words, than with code, so let’s look at an example of this VI in action. In the simple example, shown below, we are keeping only even elements of the input array. As you can see, the benefit of using Conditional Auto-Indexing Tunnel is that you do not have to do any building or deleting of arrays!

Conditional Auto-Indexing Tunnel_example1.png
Note: The example, above, may be found in your LabVIEW examples folder, here:
\examples\OpenG\array\Conditional Auto-Indexing Tunnel Example 01.vi

And, here’s an example showing how to filter out elements in an array, without even using a For Loop!

Conditional Auto-Indexing Tunnel_example2.png
If you want to give this VI a try, you can obtain it using VI Package Manager (VIPM). Simply select the OpenG Array Library (the oglib_array package from within VIPM), you will find the OpenG Array Tools palette in the Functions palette under the OpenG submenu. (See here for a quick guide on how to install OpenG on VIPM.)


No comments have been added to this post yet.

Leave a comment

(required)

(required)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post |

 

Bad Behavior has blocked 2614 access attempts in the last 7 days.