From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster won't reinitialise to default

Solved!
Go to solution

Hi,

 

I want to make a duplicate of a cluster and then write to it. These clusters are in an array which i build up throughout my program.  I take the first element and then write to it before appending to the end of the array but I want to set all variable to default before i start writing. To do this i'm using invoke nodes but for some reason this won't work and the values arent set back to default. Do I have to use an invoke node for every variable in the cluster or is there a way to do it all at once?

 

I have added the VI but also a picture in case this handy too. 

 

Thank you 

 

Stephen

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 1 of 5
(3,500 Views)

The only place where I see you do a reinitialize to default, you don't even use that cluster in your subVI.  Nothing is wired to it and that indicator is not connected in the connector pane for you to do anything with it after the subVI.

 

You have a lot of controls saved in that zip, but only the one subVI.  It is unclear on how you are trying to use this.

0 Kudos
Message 2 of 5
(3,498 Views)

The controll come from thhe cluster structure I'm using which is relatively complex with quite a few type defs etc. I can't help them being daved in the duplicate.

 

Also the indicator is there so I can use the reference from it. The indicator was made from the cluster coming out of the index array which is being opened up. Maybe this is completely the wrong way.

 

What I want to do is to initialse the cluster I take from the index array before I open it in the unbundle array. 

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 3 of 5
(3,484 Views)
Solution
Accepted by topic author Stephen1995

You have a reference to the indicator called "Data Set Information".  That indicator just sits down to the lower right.  Nothing goes into it.  It doesn't connect to anything else.  You are just initializing a front panel indicator that never changes.  You say "it was made from the cluster coming out of the index array".  I don't know exactly what you mean be that.  But if that is just a copy of another part of your code, you just made a new independent indicator that has nothing to do with where it came from.

 

If you want to put a new element at the end of your array where some elements are default values and some are updated,  Just wire a constant with default values into the top of the Bundle by Name node, and use the controls like you are doing to update those values that you don't want to have as default.  Right now you are taking index 0, whatever values they are at the moment, and updating the 5 named elements in the cluster.

Message 4 of 5
(3,472 Views)

Cool, that should work. 

 

Thanks

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 5 of 5
(3,467 Views)