LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice to access typedef clusters from GUI

Solved!
Go to solution

Scenario: I have a library with several typedef clusters (non strict). I need to give the user access to these clusters (and to arrays of some of these clusters) from the GUI. These typedef clusters were designed using the controls from the "Modern" palette submenu.

 

Question: what is a good practice if I want to customize the looking of the input fields for these clusters for the user? For example, LV does not let me to change the "design type" from "Modern" to "System" of such typdef clusters after I drop them on the FP.

 

Ideas:

  • Shell I just disconnect these clusters from their typdefs, and customize their "design" as needed? With this approach there are several problems:
    • Coercing data to the subVI since it expects the typdef
    • When I replace for example a string combo box from Modern to System inside the disconnected typedef cluster, it loses its elements, thus I need to recreate the whole list again.
  • I create another cluster(s) for the required objects only for the GUI, and I wire these values explicitly to the typdef cluster elements using "Bundle by name"... 
0 Kudos
Message 1 of 6
(4,319 Views)
Solution
Accepted by topic author Blokk

Is there a reason you don't want them to be strict? For GUI elements I do like the strict typedef so that it looks the same everywhere.

Message 2 of 6
(4,289 Views)

Hmm, yes I think this is the most straightforward for my actual case. I modify the typedef clusters as I need them in the GUI, and save them as strict typedefs.

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

When you say "save as a strict typedef", do you still only have one copy of the control? That's what I was suggesting. I just edit the actual .ctl file. I think it may update the typedefs you've already dropped when you change it to strict, but I'm not sure.

 

Do you want the cluster to have a different appearance in different places? If yes, maybe the cluster should be broken into two smaller clusters.

 

 

0 Kudos
Message 4 of 6
(4,280 Views)

Actually the case is that I have some private VIs and a "main" private typedef cluster which includes the public typdef clusters. I have a strong feeling that there is a better approach, but this work was a bit "code and fix" run. So I have some wrapper public VIs (with typdef cluster inputs, these I wanna customize) which call a common Action Engine which is private. This Action Engine stores/deletes the user inputs, and stores all typdef clusters/cluster arrays in a single typdef cluster (via an  uninitialized shift register).

 

So I think I will just modify these public clusters from typdef to strict typedef after changing their design...

 

0 Kudos
Message 5 of 6
(4,269 Views)

Yes use strict type defs if you want to force the same look everywhere the cluster is used. That could present a complication if you want to hide show parts of the cluster or change color etc.

 

There is a way to have the best of both worlds.

 

While in the control editor change it to "strict" then use the apply changes from the file drop down. That will force all of the instances in FP to be exactly the same. After doing a Save All... change it back to a normal type def. and apply changes and save.

 

That technique will let you force them all to look the same without be restricted to having them all look the same.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 6
(4,255 Views)