05-14-2019 09:04 AM
I have an array of clusters. I am trying to programmatically change a value in an array of clusters. I have a lot of applications for this but wanted to give an easy example to see why this isn't working and if maybe there is an easier way to do this. This is just a boolean value that once turned true then turns false after recording a numeric value of which index this happened on.
Solved! Go to Solution.
05-14-2019 09:42 AM
Hi,
3 simple steps to make this easier:
1. get rid of the local variables. Replace them with a shift register on your for-loop.
2. Have a look at Implace structures
3. Have a look at the difference between the count terminal (N) and the iteration terminal (i)
05-14-2019 10:02 AM
And one step that makes this easier for (some of) us: Never attach a JPEG. Rarely attach a PNG. Always attach a VI (which we can open, edit, run, change, etc.).
Bob Schor
05-14-2019 02:12 PM
A picture is worth a thousand words, but a VI is worth a thousand pictures.
05-14-2019 02:46 PM
@billko wrote:
A picture is worth a thousand words, but a VI is worth a thousand pictures.
Now THAT is a situation where the stacked sequence was overused.
Ben
05-15-2019 05:31 AM
I appreciate the suggestions and seems like I got it working. Not 100% of how the in place structure really helps when I looked at how I first did it and then trying to use in place structure. I am guessing from what I read that the replace array subset may create an entire copy of the array in memory and this way does not. Thanks for the help
05-15-2019 05:45 AM
You still can get rid of those locals AND the huge sequence structure by using wires instead. Is there a reason why you read the value of bool3? you could just set it to FALSE even if it already is..
05-15-2019 07:19 AM
@crabman -- love the signature!
Bob Schor