LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array to elements

gmazza, there is no way to do what you're asking.

You still have to explain what you want to do with the individual elements. Obvioulsy they will be treated separately, but in which way?

This is not a detail that could "come later", it's an essential information to design the code.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 11 of 17
(915 Views)

Maybe I can not explain it well.
I enclose a picture that should be clearer than my explanation.
It is just an example. In fact the conditions for Case Structure are more complex, but the concept is the same!
It is more clear?

0 Kudos
Message 12 of 17
(907 Views)

Why not this way?

 

loop.png

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 13 of 17
(898 Views)

First of all, if the number is not known at compile time, you cannot use the "array to cluster...unbundle" dance. Clusters contain a fixed number of elements determined by the cluster size configuration of the array to cluster function. In fact that "dance is never needed. A simple "index array" can be resized to give any number of elements.

 

In any case (as has been mentioned by others already), all you neeed is a FOR loop. Sometimes you can even operate on the array directly. You really need to tell us what you need to do with the array elements.

Message 14 of 17
(882 Views)

@kausreloaded wrote:

When you don't have idea about the exact no. of elements of array .. going for a while loop is the best idea.....u can place the code in while loop and go for enable indexing the tunnel


NO, that's a dumb idea. If you autoindex on a FOR loop, the loop will run until the array runs out of elements. The while loop will run forever (or until stopped otherwise) and will use the default value once it runs out of array elements.

 

Message 15 of 17
(875 Views)

@ToeCutter wrote:

This is a very basic question. My best advice is to do some reading around LabVIEW and maybe complete a LabVIEW basics course (I believe they are free now?) You will be able to get individual questions answered here, but it will be much quicker and more beneficial for you in the long run to do some reading on the basics before doing so.


This was suggested in many, many of his other posts.  Because he is a beginner, I can't tell whether he either went over the suggested tutorials and did not understand them, or he simply did not look at them...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 16 of 17
(866 Views)

Thanks for the heads-up, Billko. You can lead a horse to water...

0 Kudos
Message 17 of 17
(854 Views)