LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D array into single values

Hi,
is there a kind of reverse "build array" function available? I'm looking for a function, which gives me all elements of a 1D array. At the moment I convert it into a cluster and then unbundle this. This works, but a direct access would be smarter.
Ciao
Olli
0 Kudos
Message 1 of 11
(11,757 Views)
Yes,
there is, it's called 'Index Array'

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!
Message 2 of 11
(11,758 Views)
Hi TonP,
thanks for your replay! Yes I know the "index array"  function. With this I would need n numbers of "index array" functions for n numbers of elements, but I'm looking for a single function which extracts all values from the 1D Array like the unbundle cluster function.
Ciao,
Olli
0 Kudos
Message 3 of 11
(11,753 Views)
You can resize the Index Array function to output as many elements as you like.
In any case, the difference between a cluster and an array is that a cluster has a fixed number of named elements and the array has a variable number of elements, so you can't automatically know at design time how many elements you will have.

If you do know, you can use the array to cluster primitive and right click it to select the number of elements in the cluster.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
Message 4 of 11
(11,744 Views)
Hi Olli,

you can resize the 'index array' to give you more than one output! Each output gets its own index input...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 11
(11,746 Views)
Hi again
thank you all...yes I must now say that I did not know this "newer" feature that I can extend the index array function to output elements. That is exactly what I'm looking for! I thought resizing this function is only array dimension related but not array element related.
Ciao
Olli
0 Kudos
Message 6 of 11
(11,736 Views)
It's hardly new. I don't remember when this was first available. The oldest version I have installed is 6.1 and the feature is there.
0 Kudos
Message 7 of 11
(11,727 Views)


@Olli wrote:
That is exactly what I'm looking for!

And don't forgret that if you want the elements in order, you don't even need to wire the indices. 🙂

Similarly, if you only wire the first index, it will be incremented automatically for the successive elements.

The image shows two possibilities, there are many others.

Message Edited by altenbach on 04-20-2007 09:16 AM

Message 8 of 11
(11,706 Views)
Hi altenbach,
thanks for the info! I tried it already after the first hints 😉 I really should explore more and more the possibilities of often-used functions...and read the LV help more carefully before putting questions in the forum.
Again thank you all!
Olli
0 Kudos
Message 9 of 11
(11,669 Views)

Hello,

I have a similar but different problem. I want to get all the elements of a subarray one by one in each loop. I have 271 elements in the subarray. Is there any way I can do it? I attached the image of my VI for better visiualization. 

 

0 Kudos
Message 10 of 11
(10,255 Views)