LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting elements from an array

Hi

 

We all know that if we have to buid an array of some elements, then we can use the BUILD ARRAY vi.

What if we have to separate out the individual elements from the array?  Discard the INDEX ARRAY option, as that will give only the element specified.

I did this by using ARRAY TO CLUSTER and then UNBUNDLE CLUSTER . The problem with this is that the unbundled elements are only 8 in number and it is always this number only!!!

Also, the indicators and controls have to be created by the user only. So, how can i display the individual elements from the array?

 

Somil Gautam
Think Weird
0 Kudos
Message 1 of 12
(50,965 Views)

The OpenG toolkit has a function called 'Index Array Elements':

 

Here you can get the elements in the position and order you want them.

 

To get more elements from an 'Array to Cluster', right click and select 'Number of elements'. However this is not the function you are looking for.

 


Somil wrote:

Also, the indicators and controls have to be created by the user only. So, how can i display the individual elements from the array?

 


I'm sorry I don't understand what you actually want. You can use an array display to display multiple elements (and you can resize the control to change the number of elements shown).

 

Could you specify a little bit more?

 

Ton

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 12
(50,963 Views)

Hi

 

Just see this VI. What is happening in this VI is that i am first generating a Random array, and then extracting the array elements individually.

 This is for some specific array size (7*1). I know that there are 7 elements in the array, so there are 7 indicators.

If there are are some "n" number of elements, how to extract array elements?

 

 

Somil Gautam
Think Weird
0 Kudos
Message 3 of 12
(50,949 Views)
In the run time we cant create N number of indicators . whats the problem in keeping all the elements in the array instead in seperate indicators Smiley Wink. Do you want to extract any informations from tha array?Smiley Surprised or Just want to simply display in indicators?Smiley Happy.
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
Message 4 of 12
(50,939 Views)

haha,

There is no problem in keeping the elements in the array itself.

I was just EXPERIMENTING!!!!!:mantongue:

Somil Gautam
Think Weird
Message 5 of 12
(50,929 Views)

See these examples LV 8.6.1, hope this helps.

 

 

Message 6 of 12
(50,906 Views)

hi

 

Thanks rob!!!!

The problem with my VI was that i was not knowing how to increase the size of the Unbundle function. Just i had to select the size of the  ARRAY TO CLUSTER functio. This will help.

 

Now, should i mark the solution to your answer??? Smiley HappySmiley Wink

Somil Gautam
Think Weird
0 Kudos
Message 7 of 12
(50,870 Views)

Is there any other way to extract elements from array besides converting it to cluster then unbundle?

Because I do find it unconvenient if the element of the array is too big and if we were to do some kind of operations on the extracted elements.

 

Thank you in advance 🙂

0 Kudos
Message 8 of 12
(39,919 Views)

Array to Cluster then Unbundle is completely the wrong way to get elements from an array.

Index Array is the proper method.

 

I regret that this thread even exists and the original poster's message gave you the impression to use Array to Cluster.  The fact that the original poster suggesting this was an NI employee is even worse.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 9 of 12
(39,898 Views)

Whats the reason behind converting Array to Cluster and then to individual elements?

Why not based on Index values?

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 10 of 12
(39,879 Views)