LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[LABVIEW 2012] Get all boolean from Front Panel, sort them by label text and build an array with the status of the control

Solved!
Go to solution

Good afternoon

 

I'm building a toolbar with a variable number of boolean (because the final user will add or remove controls from the front panel). Only one button can be active at a time.

 

I need to programmatically get all Boolean Control from panel, sort them by Label Text and build an array with the status (true or false) of the sorted controls.

 

 

 

My problem is how do I get the Refnum of all boolean and receive these Refnum sorted by the Label text?

 

 

 

Please find attached my VI.

Download All
0 Kudos
Message 1 of 5
(2,197 Views)
Solution
Accepted by topic author mthheitor

You can only change the number of booleans at edit time. Is that what you are doing?

 


@mthheitor wrote:

Only one button can be active at a time.


Why not use a radiobutton control?

 

Can you explain the purpose of all this? Seems convoluted.

Message 2 of 5
(2,170 Views)

Hello @altenbach

 

I didn't know that I could put distinct custom booleans inside the "Radio Button" controller. Thanks for the tip.

 

 

Let me explain the purpose of my code:

 

I work in a research lab of a University from Brazil (Universidade Federal de Uberlândia - UFU) and we develop researchs in areas like FHPP (friction hydro pillar processing), tribology, oil platform steel, hydrogen embrittlement, etc.

We use LabVIEW in most of our data acquision. But each project has a different developer and, consequently, a distinct User Interface in each of the applications.
Example: print.png against print2.png

My job is to develop a standard layout and user interface for the softwares. This way we will have a visual identity.
This standard VI will be used in future researchs too.

My plan is to do a main.vi with five panes. Each pane will load a subvi. (see print3.png)
Some subvi will need communicate with others.

 

The radiobutton solved the problem "only one button can be active at a time". And the VI output is a U32_numeric with the selected boolean. Thanks

 

In the future the developers will add/remove controllers, like delete the 2nd button from print4.png and add another custom boolean in its place. My concern is the order of the buttons in the U32_numeric output, cause LabVIEW sort the controllers in order of creation.

Today the 1st button output is 0, 2nd button is 1, 3rd button is 2, 4th is 3. But if I delete the 2nd to add other customized boolean, the order of the output changes. (See subvi2 (2).vi)

0 Kudos
Message 3 of 5
(2,130 Views)

Here are some suggestions for some of the use cases that you need:

  • The notion of a Radio Button Control for this "One-at-a-Time" situation has many things going for it.   I just adopted this solution to replace a Cluster of 24 Booleans (where I had to manage the "one-at-a-time" switching myself) -- it is much easier to let LabVIEW handle the hard work for you.
  • With a Radio Button Control (RBC), you have individual access to each Button.  If you design an RBC with, say, 10 Buttons, and decide you only need 9, you can simply change the properties of one of the Buttons to be "not Visible", then you'll have 9.
  • Similarly, you can change the Labels of the Buttons to suit your situation.
  • I use the Buttons not only as Controls (I push it to select whatever it is that it represents), but as an Indicator by changing the Button's Color.  I use a Green (bright and dim) color to mean "OK", Yellow to mean "Caution", Red to mean "Error", and Black to mean "Off and not responding".

Bob Schor

Message 4 of 5
(2,126 Views)

@Bob_Schor thank for the suggestion. The "not visible" property will come at handy.

The boolean control colors are a good idea. But LabVIEW only offers a single ugly solid color option.. no effects 😞

These booleans are from my "Menu Bar", so transparent background will be aesthetically better.

0 Kudos
Message 5 of 5
(2,097 Views)