LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a Top Level Boolean Array from a Sub VI Action

Hi All,

 

I have a front panel top level VI boolean array that I use as a control to determine how many units I test in my program. I have a select all button that when pressed sends a True to a sub VI which then outputs the array as an array of True's. The functionality of this button is working great for me as it passes however many True's I want through to the next VI and so on.

 

What I'd like to do is update the top level Boolean array control with the full array of True's when this button is pressed. At present I the top level VI stays in its default value even when the Select All is pressed.

 

I've been playing around with the refnums and property nodes and read the guides on the NI website but can't get it to work for an array of values. All of the guides seems to reference only single values or single Booleans. I have attached a broad version of the code if anyone could give me a hand. The cluster indicator I have in place now wouldn't typically be there but I'm using it to see my results at the minute. Thanks in advance.

 

 

0 Kudos
Message 1 of 6
(3,173 Views)

You did not include the sub-VI so...

 

I will default to linking a Nugget I wrote about control references about 10 years ago about using control references. It starts out simple and then goes ....

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(3,143 Views)

Apologies, here are both VI's. I will take a read of that also. Thanks.

Download All
0 Kudos
Message 3 of 6
(3,126 Views)

1. Your "Select All" buttons should be a normal button that latches (resets itself after being read).

2. Your use of a single iteration while loop just to act as a sequencer is unnecessary.  First of all, you should be using wires instead of the local variables.  Secondly, the comparisons can act in parallel.

 

So with those two, I reduced your subVI to this.

 

Now for updating the front panel...Since the values are already being passed out, just unbundle the values you want and use a local variable to update your control.


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
Message 4 of 6
(3,112 Views)

Thanks for that. I tried it out and it works well to select and deselect all elements of the array. One thing I would like to do in addition to this is the following:

 

I would like to be able to manually select each individual element also. At the minute it seems that I can only select or deselect all because when the Select All control is false, it outputs False to all elements in the array. How would I go about being able to manually select elements and also do the select all button if the need arose? I have played around with it a bit trying to combine Or expressions with the initial value of the DUT Select array but I'm having difficulty.

0 Kudos
Message 5 of 6
(3,088 Views)

Use a second button for the Deselect All.  Again, it should be a latching type button.


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 6 of 6
(3,084 Views)