LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing A Single Element Within A Cluster/Array/Cluster

Got a question that I think for once is easily answerable (unfortunately just not by me)!
 
I'm trying to replace a single element in a 2D array (there is only one row and one column) but this value is buried within a few clusters and an array. I think I ALMOST have it working but I'm missing one or two steps. If somebody would please look at the attached VI and tell me what I am missing I would be eternally grateful! I searched for other examples but this one is unique enough I just can't get it solved. Thanks!
 
-- Jason

Message Edited by jmpugh on 03-15-2007 08:40 AM

0 Kudos
Message 1 of 5
(3,280 Views)
Your problem is in not understanding the proper use of the "Cluster to Array" and "Array to Cluster" functions. In this case you don't want to use them. Also, you don't have a 2D array anywhere. What you need is the unbundle function coupled with the Replace Array Subset function as shown below:


In this case you need to specify which program (element of the array) to replace, which is what the "index to replace" constant is for. This will probably be a control for you. 

Message Edited by smercurio_fc on 03-15-2007 08:52 AM

Message 2 of 5
(3,267 Views)

First off I would like to correct my initial post...I was more than a step or two off. 😉 And secondly, and more importantly, thank you so much! I was using them the wrong way. Once I saw your code I slapped my head and went "Doh!" Thanks again!

-- Jason

0 Kudos
Message 3 of 5
(3,259 Views)
I have exactly the same changes as smercurio.. In addition I recommend use of Bundle/Unbundle by name as a documentation assist. My version is attached. Note: I did not attach the custom controls again. They are in the original post download.

Lynn
Message 4 of 5
(3,253 Views)
I wish I could do more than give you both 5 stars! It's working like a charm now, which is great because St. Patty's Day is coming up and charms are nice!
 
-- Jason
0 Kudos
Message 5 of 5
(3,246 Views)