01-29-2010 01:00 PM
Now I have an array. Is there a way pull out a single element modify it and replace it? Multiple elements?
thanks
Solved! Go to Solution.
01-29-2010 01:05 PM
01-29-2010 01:10 PM
jvh75021 wrote:Now I have an array. Is there a way pull out a single element modify it and replace it? Multiple elements?
http://www.google.com/search?&q=arrays+in+labview
Andrey.
01-29-2010 01:13 PM
01-29-2010 01:14 PM
Hi jvh75021:
Now that you have an array, you can perform several operations on it:
1.- You can pull out a single element by using Index Array.
2.- After you pulled out the element, you can modify it without problems.
3.- You can replace it using Replay Array Subset.
If you want to pull out contiguos elements in an array, you can use Array Subset.
If the elements are not contiguos, you can use Index Array in a loop.
You can find all the Array functions in the Functions Pallete>Programming>Array.
01-29-2010 01:17 PM
jvh75021 wrote:
Thanks but Replace Array Subset does not like having the output tied back to the input array.
And you can't. If the source array is a control then you can write it back to itself using a local variable or a property node. If it's a wire (such as the output of a VI or a function, then you can't do that. You would need to create an indicator to see the new array.
01-29-2010 01:18 PM
01-29-2010 01:22 PM
Thanks, just wasn't looking for the right keywords. I was thinking read, write, etc.
01-29-2010 01:33 PM
Just for completeness don't forget about the example finder. If you type arrays on the index tab you will come up with examples such as 'Build Arrays.vi' and 'How to Replace Elements in an Array.vi' and so many more. Remember that context help and highlight execution mode will help greatly in understanding how these work.
Hope this helps.
01-29-2010 02:02 PM
I'm surprised nobody mentioned the In Place Element Structure yet...it lets you modify the array element without making any extra copies: