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: 

checkbox value fix in array of cluster

Solved!
Go to solution

Hi!

   I am trying to modify a vi which contain checkboxs in cluster and bunch of cluster contain in arrays. I want to fix the value of checkbox as true or false for different set of cluster in the arrays. Is there any way to do it?

 

0 Kudos
Message 1 of 9
(3,368 Views)

Hi ssnp,

 

I have no idea why you want to use an Unbundle with an array. Unbundle will only work with clusters...

 

To set some default values you create your array of clusters with your preferred settings and then right-click the array (!) and select "data operations"->"set current as default". Or you create a constant of your array and use that one...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,364 Views)

What do you mean by "fix". What's wrong with the controls?

 

If you are trying to change the value of a specific checkbox in a specific element then you need to perform a Replace Array Element, since you have an array of clusters. You'd use Index Array to extract the specific one you want to change, then Bundle By Name to select the specific element in that cluster, set its value, and then feed the resulting cluster into the Replace Array Element function. Something like this (changes the A4 checkbox for the 15th element in the array):

 

0 Kudos
Message 3 of 9
(3,362 Views)

@smercurio_fc wrote:

If you are trying to change the value of a specific checkbox in a specific element then you need to perform a Replace Array Element, since you have an array of clusters. You'd use Index Array to extract the specific one you want to change, then Bundle By Name to select the specific element in that cluster, set its value, and then feed the resulting cluster into the Replace Array Element function. Something like this (changes the A4 checkbox for the 15th element in the array):

 


Or use the Inplace Element Structure


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 9
(3,358 Views)

ssnp wrote:

   I am trying to modify a vi which contain checkboxs in cluster and bunch of cluster contain in arrays. I want to fix the value of checkbox as true or false for different set of cluster in the arrays. Is there any way to do it?


You have not explained what you mean by "fix", but if you don't want the operator be able to change them, configure them as disabled (right-click..advanced..enabled state..disabled"). Now they will act more like indicators: You can still programmatically modify them, but the user is prevented from changing them manually.

 

Otherwise, please be more specific with your terminology. For example the word "fix" has a very different meaning to a dog. 😉

 

 

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

Thanks for reply

    The cluster contain parameters for different sub vi. I will correct my question further. When i set the check box as true and close the vi. it is going back to default value. When i set true as default value, all the checkbox in  all the cluster in the array is set to true. I want selectively true and false.

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

@ssnp wrote:

Thanks for reply

    The cluster contain parameters for different sub vi. I will correct my question further. When i set the check box as true and close the vi. it is going back to default value.


This is by design. When you change the value of a control it will not (and should not) change the default value for the control. You have to explicitly specify that the current value of the control should be used as the default value for when the VI is opened, or if the VI is used as a subVI, and the terminal is left unwired (if the control is tied to the connector pane).

 


When i set true as default value, all the checkbox in  all the cluster in the array is set to true.

This is not clear. Are you setting it by clicking on it on the front panel, or programmatically? If you're setting it by clicking on it, then there is no way all of the other elements would be "automagically" updated to the same value. If you are setting it programmatically, then you have an error in your code.

 


I want selectively true and false.

You are still using vague terms and not clearly explaining what you are trying to do. Is your VI supposed to show what you are trying to do? I don't understand what the VI is supposed to do. I can see what it does, but its purpose escapes me.

0 Kudos
Message 7 of 9
(3,342 Views)
Solution
Accepted by topic author ssnp

Your array has ~138 elements. Each element is a cluster. Different array elements currently have different values for the booleans, for example #68 is all FALSE while #69 is TRUE for A1 and B1.

 

This is in direct contradiction to your statement!

 

After setting all array elements to the desired pattern, Make sure you set the current value of the array (not the cluster element!) to the default and save the VI.

(If you change the default for the actual cluster, it will apply to new elements that you add by clicking on an (greyed) element past the current array array size).

0 Kudos
Message 8 of 9
(3,340 Views)

The cluster contain parameter for another sub vi . Indies to array will select the cluster ie the parament then it is passed to sub vi. I was trying to achive it not not able .Making the array element

default solved the problem.  Thanks! 

Smiley Happy

0 Kudos
Message 9 of 9
(3,315 Views)