LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean inside cluster

Solved!
Go to solution

I have an array of cluster that has a boolean inside. I need to set on/off of the boolean once at the begining of the case and once after the case executes. This will signal which sequence is running. So i need to strip out that index value, change it and reinsert it back. The problem is this isn't changing the boolean value.  

 

Download All
0 Kudos
Message 1 of 9
(3,521 Views)

Could you please attach your code instead of images so we can see whats going on?

Cory K
0 Kudos
Message 2 of 9
(3,498 Views)

How can you say it does not work when you don't even have the output wired to anything?

 

Much better if you attached your code but I did reproduce your cluster array and everything works just fine.

0 Kudos
Message 3 of 9
(3,487 Views)
Solution
Accepted by topic author bassinbc

Hello,

 

Based on the png file is looks like you are using Index Array instead of Delete Array Subset.

 

Enclosed is an example, probably not the most "proper way" to do it, but a way that works for sure.

 

Give it a look over and see if that is what is going on.

 

Good Luck!

0 Kudos
Message 4 of 9
(3,477 Views)

Drewski, I knew it was something simple I was missing.

Thanks

0 Kudos
Message 5 of 9
(3,458 Views)

Hi,

 

Make sure before running the VI, you have initialized the array with some default value. suppose if you are usisng insert into array or replace array subset function, it won't work if you have empty array.Find the attached example it working fine and replacing array value.

0 Kudos
Message 6 of 9
(3,454 Views)

The solution is somewhat rube golberg code. Absolutely no reason to do a delete and insert. Just do a replace array.

 

 

0 Kudos
Message 7 of 9
(3,444 Views)

I was thinking about the index -> replace verse the delete -> insert schemes and decided that if the cluster contains a great deal of data, then the delete -> insert would use less memory.  My current understanding is that index array returns a copy of the array element, not a reference to the array element.

 

Not that memory usage is crucial in every instance, it just occured to me that there might be an instance when the delete->insert would be, perhaps, a better choice than index->replace.

 

rube-goldbergesque, hee hee, good one.

 

 

 

0 Kudos
Message 8 of 9
(3,422 Views)
0 Kudos
Message 9 of 9
(3,359 Views)