LabVIEW Idea Exchange

About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

For loop iterating on cluster

Quite frequently, I encounter a need to do something repetitive on clusters, which have identical elements. Sometimes, I use "Cluster to array" and then "Array to cluster" vi's, like in the example below:

For loop on cluster.PNG

 

Instead of doing this, I would like to use a kind of "For loop", which would be able to operate directly on clusters with identical elements. The loop would iterate already during the compilation (generating repetitive code for each cluster element).

 

Perhaps, the standard For loop connector might have something like an option "Iterate over cluster elements".

12 Comments
Active Participant

Kudoed the other idea, though it is not a complete duplicate as it doesn't include the concept of getting the cluster back from the loop's output tunnel (which is where the real value comes).

Active Participant

Also, the point of the idea is better understood when the cluster isn't "Servo1", "Servo2", "Servo3"; it's "Source Azimuth", "Source Elevation", "Camera Height", etc., a set of meaningfully-named things that you mostly unbundle by name ("Change Camera Height"), but also sometimes need to act on as a group ("Read Servo Positions").

 

Using Array-to-Cluster will currently work for this, but is very work-intensive in handling changes to the number of cluster elements.  An array also works, but loses the benefits of unbundle-by-name.