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: 

Set control values by index

Solved!
Go to solution

Can you set control values by indexes in a cluster?

Or how do you get "DigNum" property node for clusters?

 

VI attached

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

Hi LabNoob,

 

It seems that you are updating the values by wiring directly into the indicator, which is the preferred way to do it. (Assuming you are talking about the clusters: Back Wall, Ceiling, Floor, Side Wall.)

Message 2 of 9
(3,678 Views)

I see a bunch of other things worth mentioning...

Since you have now created clusters, instead of having 64 individual indicators, I would get rid of all of the "ControlIndex" code.

When you get your data, you are probably getting it in the order "Numeric, Numeric 2, Numeric 3" but the order of your references will be "Numeric, Numeric 10, Numeric 11..." So I would name your numerics with 2 or 3 digits each (be consistent) so that you can sort them by name the same way your data is coming in.

Also, to initialize an array with the number of elements that you have channels for you are doing this:

Capture.PNG

That's going to give you 4 elements, because the array size you are getting is just from an array with 4 integers in it! What you actually want is to simply add the numbers together (compound arithmetic will do it with a single function).

Message 3 of 9
(3,675 Views)

When you say "get rid of all ControlIndex code" are you saying all the BG color stuff as well? Or just this stuff?

controlindexcode.PNG

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

Just the ones you circled. Delete the property nodes for Back Wall, Ceiling, Floor, Side Wall. Delete the wire coming out of the "DigNum" ControlIndex, and drag the bottom up so that you only have the Label.Text property node.

 

As a side note, I think getting the DigNum ControlIndex would give you an error anyway, since the numerics no longer have a ControlIndex associated with them. (The clusters containing the numerics do, but the individual numerics do not.)

Message 5 of 9
(3,653 Views)

It's looking a bit more cleaned up.

I went and labeled all the indicators in the clusters with numbers... That may have been a mistake?

What do I put in the "search string/char" now to update the indicators

whatsnames.PNG

0 Kudos
Message 6 of 9
(3,636 Views)
Solution
Accepted by topic author LabNoob14

Hmm... I would leave a keyword in there like "Numeric 000, Numeric 001..." so you can be sure you're only changing the color of the controls you want, and not any other digital numerics that you may add to your front panel.

Message 7 of 9
(3,633 Views)

@LabNoob14 wrote:

Can you set control values by indexes in a cluster?

Or how do you get "DigNum" property node for clusters?


Get Controls[] property from the cluster and use Index Array to get a reference to a specific element. Or for loop to loop over each of them. Use Value property to get\set the value of that specific cluster element.

Message 8 of 9
(3,616 Views)

Looks like this portion of the project is complete and working fairly smoothly!

Lot's of KUDOS to gregoryj and everyone else that educated me

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