LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GUI with Large number of IO/labels

Hi All!
   I'm beginning a new project, a simulator of a kind of plant, with many IO.  Until today I struggled with distributed IO, more than with GUI building (in LV).  I have to put on the Panel arrays of boolean, organized in block of 16.  I've already done something similar, but it was static, ie the number of simulated plants was 1, with fixed names upon IO arrays.  Now, I have to simulate a (possibly) variable number of plants, each on the same vi (it's something like a list of plants on a RS-485 bus....), each one in a tab.

   I already know there's almost no way of implementing dinamically add of tabs (Yes, I know I can put a fixed number and then hyde unused tabs...).  But, apart from this, I need that each tab has a variable number of 16 bool IO array, and that each bool has it's own caption, not the same caption for each element of the array!

   I've tried with string indicator, but the result is quite awful!

   Almost forgave to say that labels has to be loaded run-time from some kind of config file....

   In GTK+ with C I'd be able of doing this, but I don't know how to integrate GTK and LV...

   BTW, I use LV 7.1...

   Any advice will be very much apreciated!!!!!!!!!!

graziano
0 Kudos
Message 1 of 24
(3,994 Views)
Hi graziano,
you should use cluster instead of arrays: in a cluster you can reference and set the properties of any control individually. A single boolean array would become a cluster composed of 16 boolean controls. To implement a variable number of "arrays" you have almost no choice but create N clusters (where N is the maximum allowed) and show/hide correspondingly, unless you want to create an array of clusters (but it could be very ugly, esthetically speaking).
Finally, to show different captions you should show the control's Caption (not the Label) and set it by writing to the property Caption.Text.
Hope this helps.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 24
(3,976 Views)
You can make a transparent cluster, and in it you should put (from top to
bottom):

A numeric control (to display 1..9).
A string control (to display S3sR etc.).
A numeric control (to display 1..9 again).
A boolean control (to display the on off).

You need to consider the front to back order, since front controls will
block the controls behind them.

Disable all controls you don't what the user to edit.

You have to make the numeric controls, and the strng control transparent.
Use the brush control, and use tab to make the border completely
transparent.

Put the control inside an array, and it should look pretty much like your
jpg. Use a local to set all labels and numerics. Put a decoration behind the
array, to get the Recessed Box.

Regards,

Wiebe.


Message 3 of 24
(3,968 Views)
Hi Paolo, Hi Wiebe,
   thanks a lot for hints, but... I foresee some troubles in changing each control's name... for example, if I use a single cluster, I have to bundle 16 bool, 16 strings, and set properties (manually) of each one... if I have a chain of (say) 10 plants, with 160 IO for each plant.... what a mess!!!!!!

   Anyway, you gave helpful hints!

graziano
0 Kudos
Message 4 of 24
(3,958 Views)
   While testing, I encountered a prolem: I can change the caption of a boolean control, while I am unable to change the caption of a boolean control inside a cluster.  I create a property node, linked to cluster --> boolean , but running application gave error.....  If I do it with a boolean outside a cluster.... all is okay, it works.

   ?

   Waiting Smiley Happy

graziano
0 Kudos
Message 5 of 24
(3,954 Views)
I have changed captions of booleans within clusters, although I am not sure I tried it in version 7.1.

Starting from the reference to the cluster, next get the array of references to controls[] within the cluster via a property node. Then get the reference to the boolean you want from that array. You may need to use the Class ID and control label properties to find the particular control you want. You may also need to cast the reference "To More Specific Class" to get at properties of the control. That may not be necessary for captions because captions are properties of most control types. You would need the "To More Specific Class for something like the boolean Strings [4] property which is the True and False texts on the button.

Lynn
Message 6 of 24
(3,941 Views)

FYI:

I don't think its possible to change captions of STRCT typedefs.

non-strict OK.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 24
(3,933 Views)

Which error number? It's working fine for me!
A further suggestion to reduce manual setting of properties is to use references: the Control[] property of the cluster outputs an array of references to all the controls into the cluster.
Using a loop you can set many properties at once. If a property is specific of some type of control (e.g. boolean), you need to cast the reference to the proper type before using it. See the picture below.

And yes, Ben is right: you can't do this with strict typedefs.


Message Edited by pincpanter on 10-08-2007 03:44 PM

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 8 of 24
(3,933 Views)
Hi All!
   Now it works also for me.  Maybe the problem was that I didn't set "caption" to be displayed, can it be this the error??!?!?  I mean, the caption of the control was hidden, and I received an error... If I make the control display the caption, it works, and if I uncheck "display caption" property, it still works! Maybe LV allocates "caption" dynamically?!?!? Who knows....

  Thanks again!

graziano

PS.: right Ben, with Strict control property node it doesn't work.
0 Kudos
Message 9 of 24
(3,916 Views)

At about LV 7.0 or there-abouts, the captions are not there by default. Attempts to acces same without first creating them (by showing the caption manually) result in an error.

Once created they work fine.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 24
(3,905 Views)