LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

best way to control a large num of controls and indicators

Solved!
Go to solution

Im building a front panel with 46 controls and indicators, all boolean type.

the logic is control > send serial command > receive > set indicator. i attach part of my front panel (with 2 sets of control and indicator) and my block diagram. 

 

i need to be able to control programmatically and from the front panel the control status and the indicators, individually or all by once (e.g. to reset them at once). this should be achieved from the tab they are in, and from another one.

 

thought of property nodes but still i would have 46+46 of them. same for local variables.

is there i way to refer to a control/indicator by its label(string) and change its value?

would it be easier to create two boolean arrays that hold their boolean value?

 

please advise me about the options i have. i'm new to labview.

thanks in advance.

 

Download All
0 Kudos
Message 1 of 12
(3,898 Views)

The idea of interacting with 46 Boolean Controls or Indicators is a little frightening!  Can you possibly think about the design (from the standpoint of User Interaction) and make it simpler?

 

Multiple Boolean Indicators can often be represented by a Boolean Array.  There's an issue of labelling them, but you can do that with decorations.  For example, here is a TypeDef of a Cluster showing the outputs of a set of Digital I/O registers, a 16-bit register on top, and selected bits of 4 8-bit registers below.  As you can see, the Cluster is made up of 5 Arrays of Boolean, sized appropriately with Cluster names and (in the case of the top one) a Decoration serving as identifiers.

DIO Lights.png

Bob Schor

0 Kudos
Message 2 of 12
(3,880 Views)

@afetsis wrote:

is there i way to refer to a control/indicator by its label(string) and change its value?

 


Yes, there are 2 methods:

 

1) Use the Ctrl Val.Set method

2) Put the control references into a variant attribute lookup table (do this once at the start) or use the get/set control value by index functions

 

The second method I believe is more efficient, but the first method is much easier:

setbyname.png

 

I would also agree that you might want to look at ways to reduce the 'duplication' in your VI. You might want to take a look at using X-Controls (custom controls you can give additional functionality to) or perhaps find a different way of displaying the data (I have used a table control with background colours to highlight error fault codes in the past).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 12
(3,876 Views)

unfortunately those 46 control indicator sets must be on my front panel. the user must be able to see whats on or off. 

the Ctrl Val.Set method seems to be doing the job. will implement and then ill accept it as a solution just if anything else comes up. 

0 Kudos
Message 4 of 12
(3,861 Views)

How about using cluster of elements?

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 12
(3,849 Views)

@Bob_Schor wrote:

The idea of interacting with 46 Boolean Controls or Indicators is a little frightening!  Can you possibly think about the design (from the standpoint of User Interaction) and make it simpler?

 

Multiple Boolean Indicators can often be represented by a Boolean Array.  There's an issue of labelling them, but you can do that with decorations.  For example, here is a TypeDef of a Cluster showing the outputs of a set of Digital I/O registers, a 16-bit register on top, and selected bits of 4 8-bit registers below.  As you can see, the Cluster is made up of 5 Arrays of Boolean, sized appropriately with Cluster names and (in the case of the top one) a Decoration serving as identifiers.

DIO Lights.png

Bob Schor


Sometimes I like to label the individual elements of an array explicitly for clarity's sake.  In that case, I convert it into a cluster.  This usually when I have word that is a bunch of flags.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 12
(3,826 Views)

changed things a little bit. this seems to work. but i need to be able to control them from another tab. i need some sort of "global variable" that contains all my 46 controls and 46 indicators so i can use it wherever i want in my iv. any ideas? Smiley Indifferent

 

just to be a little more clear. 

i've got two tabs. manual and auto. in manual tab i can turn on and off my 46 controls manually. in auto tab i set a schedule for those controls to turn on and of automatically. 

 

so. i need sth so that i can change the value of the indicators when im in auto mode and disable/gray out all my controls in manual tab.

0 Kudos
Message 7 of 12
(3,823 Views)

Your problem is not only that you need to deal with lots of controls/indicators, but you try to program in a way as you would program in a text based language. Flat sequence structures are always a good indicator of "design went bad"... http://www.ni.com/newsletter/51735/en/

 

Do not use a Global variable, use a PROPER State Machine design (any subcategory might be good, depending on your taste). The idea is that, you create a type definied cluster for your lots of controls. This can be also used as the indicator (you can create multiple typdef clusters or sub-clusters too). If you use a proper State Machine, you would have a SINGLE event case where you capture any user interaction with the Typedef "super" cluster. You can have the typdef indicator outside of your Event structure, but inside the main While loop. Use a Shift REgister to maintain the typedef values over the steps of your State Machine.

In this way you can easily read out (Unbundle by name) or modify (Bundle by name) any element of your typdef cluster in any state! No need for performance killer property nodes and other tricks!

Message 8 of 12
(3,798 Views)

Will something like that help?

I do not like idea of making 42 identical bundle cases, and / or registering 42 events for the same controls

One event handles array value change. To avoid synchronizing scrolls, check where did user scroll indicator array. This gives you index of channel to work with.

To close VI, close FP - this event is monitored and discarded 

 

0 Kudos
Message 9 of 12
(3,773 Views)

eh. as i said im new and this is my first attempt to build something that actually works. 

is there any example with clusters i could take some ideas?

thank you

0 Kudos
Message 10 of 12
(3,749 Views)