LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to initialize many controls

Solved!
Go to solution

Hi

I have a state machine and in the init state I am putting all controls in my app (many, more than 50) into a big cluster that I pass into a SR and through the states. This init state is ugly with all the controls there and takes a lot of real estate. Is there a different way to do that ?

Thanks

0 Kudos
Message 1 of 6
(3,828 Views)
  • Combine related controls into front panel cluster.
  • Use arrays of controls.

 

Hard to give more specific advice without seeing your code (or a simplified version of it). 😄

0 Kudos
Message 2 of 6
(3,823 Views)

Hi

Thanks for answering. I attach a piece of code but I don't think is relevant. For the clusters, I find them ugly and besides, I need to initialize the clusters too.

The array of controls might be a solution (if thery are of the same type), can I use different labels for elements ? Otherwise it will be a pain to remember that control(15) means "temperature', for instance..

regards

n

0 Kudos
Message 3 of 6
(3,816 Views)

@nitad54448 wrote:

For the clusters, I find them ugly and besides, I need to initialize the clusters too.

 


Cluster containers can be made transparent and the containing controls arranged the same as they are now. Overall, it will just look as pretty or ugly as it was before :D. While the FP would not look any different, the diagram would replace N terminals with a single cluster terminal for N times simpler code. Make the big cluster a cluster of arrays and clusters.

0 Kudos
Message 4 of 6
(3,812 Views)

OK, I got it..

But if I want to change a value in a cluster that itself is in the big cluster, I need to unbundle twice ?

0 Kudos
Message 5 of 6
(3,807 Views)
Solution
Accepted by topic author nitad54448

@nitad54448 wrote:

OK, I got it..

But if I want to change a value in a cluster that itself is in the big cluster, I need to unbundle twice ?


No. You can drill down in a single unbundle (or bundle) node as long as you do it "by name".

 

TripleUnbundle.png

 

 

And if all elements have nice names, it also makes very readable and self-documenting code. 😉

Message 6 of 6
(3,802 Views)