To download NI software, including the products shown below, visit ni.com/downloads.
Overview
LabVIEW now features an option to conditionally send data out of a loop tunnel. Auto indexing an array each side of a for loop will allow you to perform custom array operations such as only taking out odd or even data
Description
This example uses the "Quotient & Remainder" function to make sure that only even or odd numbers are added to the output array. Instead of this function you could use any of the control structures, logic or math functions in LabVIEW to build a specific array function. The one I've built quite simply allows for all of the data, none of the data, or odd and even sets of the data to be extracted.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Awesome. I did not know about this Function! This alone makes it almost worth to switch to LV 2012!
You can do this in older versions of LabVIEW as well just with case structures inside the Loop. I'll upload an image of the old functionality.
Thank you for adding a solution for older versions. In my experience this solution comes with a big performance penalty compared to the auto-index solution.
I'll try to run some benchmarks to test it.
No problem, I think you might be right about the performance of the older version. If you do benchmark it please post your findings on here.
Ok, I've made a test VI and wrote a little document Benchmark "build array" vs. "auto indexing" in a loop (since it seems I can't add uploaded files to comments).
Conclusion: There is a huge speed penalty on "build array" against "auto index".
I don't notice this function until now ! This makes my life a lot easier. Thanks a lot.