LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array to elements

Hello to all,
I am creating a program and, at this point, I need to extract an indefinite number of items from an array. If I knew the exact number of elements to extract there is no problem but how do I do not know this number?
thanks

I attach the image of my Block Diagram

0 Kudos
Message 1 of 17
(3,899 Views)

The only way to manage an indefinite number of elements in an array is using a loop.

Please explain what you need to do with those elements.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 17
(3,884 Views)

I need to have every single element of the array so that they can bind (as appropriate) to a case structure.

0 Kudos
Message 3 of 17
(3,881 Views)

You certainly won't be able to use Arrray to Cluster without providing a cluster size to the primitive; this needs to be known at design-time.  Answer pincpanter and someone can suggest an alternative.

 

<mta> You posted as I was writing mine.  What do you mean by "bind (as appropriate) to a case structure"?  It sounds like you want to have the array elements become individual cases in the Case structure.  Is that correct?  That's another design-time decision.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 17
(3,877 Views)

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

0 Kudos
Message 5 of 17
(3,862 Views)

Just like that ... the individual elements are the inputs of the Case Structure.
This, however, will come later ...
First I've got to find a way to pull out the elements in the array. The number of elements can not know (is variable). It is not a matter of the project.
Is there a way?

0 Kudos
Message 6 of 17
(3,857 Views)

Hi gmazza,

 

use an autoindexing FOR loop...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 17
(3,854 Views)

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.

0 Kudos
Message 8 of 17
(3,840 Views)

Hi Proven,

 

Sir i would like to make a correction to what you said, iI  think when we are not sure about the array size, It is best to use a While loop.

0 Kudos
Message 9 of 17
(3,825 Views)

Hi kaus,

 

to process all elements of an array you should use an autoindexing FOR loop:

FOR each element DO xyz

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 17
(3,810 Views)