08-21-2011 10:50 PM
Hi Forum,
I need to measure current from 20 channels so I combined the values of the 20 shared variables (one from each channel) into an array form and then send to a network variable for transferring data from A.vi to B.vi. And then on B.vi, I use "unbundle by name" to unbundle the cluster back into the twenty individual values and indicate them one by one.
My question is, how can I figure out which value is which out of the twenty variables? I connected the 20 shared variables to the array in a particular sequence and when i use "unbundle by name" would the sequence be consistent?
I have attached a screenshot just to explain things better.
Any help is greatly appreciated!!
Batistuta002
Solved! Go to Solution.
08-21-2011 11:13 PM
Yes, it is the same as the first element of the array.
But you shouldn't be converting to a cluster than unbundling. That is a Rube Goldberg.
You should be using Index Array to get the individual elements.
08-21-2011 11:29 PM
Thanks Ravens Fan!
So if I want to use Index array, then i would need to assign index numbers to each elements when I combined the 20 values from the variables to an array right? If I don't, does LV assign 0 to 19 for the 20 elements from top to bottom automatically? Sorry that I cannot verify this by myself as I can't test it out using actual measurement because of hardware issues.
08-21-2011 11:41 PM
Yes. It will automatically assign it the indices 0 to 19 when you drag down the bottom of the Index Array function. No need to wire up all of those constants.
The first index always defaults to 0 if nothing is wired to it, and an index always defaults to the index value of the one before it +1 if nothing is wired to it.