LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wire broken to cluster of references

I've bundled several boolean control references and wired this cluster to several SubVI's.  When the references were originally created, the mechanical action of each control was "Switch until released".  I now need to change one button to "Latch when pressed", but when I do the wires connected to the cluster terminals on each subVI becomes broken.  The only way I have found to fix the problem is to create an indicator from the original bundle and copy this indicator to each subVI.  Then I change the indicator to a control, delete the old cluster control and make a new terminal connection.  This method is extremely time consuming as I have about 40 VI's that are affected.  There must be a better way.  Any ideas are greatly appreciated.

Brad
0 Kudos
Message 1 of 3
(2,837 Views)
Type def, Type def, TYPE DEF!

I have a simple rule, and it goes like this in haiku.

If ever you plan
To use a cluster in more
Than one place, TYPE DEF!

When you have a typedef defined, you can reference it in several (about 40 in your case) places and you can change it in only one place.

I suggest searching through the LabVIEW documentation for "Typedef".

The way to create one is to right click on the cluster or any control or indicator and select Avanced >> Customize...
You'll get the LabVIEW Control Editor window.  Look up in the toolbar where it says "Control".  You can pull that down and select either Type Def .or Strict Type Def.  Once you do that and save it, you have a file with a suffix of ".ctl".  When you close that window, LabVIEW will ask you if you want to replace the control or indicator you selected with the one you just saved.  Say Yes, and you have your first reference to the type def.

You can create more references by copying or cloning (ctrl-drag) that first one or by selecting the .ctl file in the "Select a Control" dialog.

You'll notice that you cannot edit a control or indicator that is connected to a type def when it is just sitting on you front panel.  Instead, edit the type def.  When you are finished editing the typedef, save it and close the window (or select Apply Changes from the File menu).  You'll notice that all the references are updated to match the changes you made.

As an aside... you may want to use generic control references instead of strictly typed ones.  You get a strictly typed reference when you do the right-click to create a reference manuever.  Chances are that you are not really doing anything with that reference that really needs the strict typing.  If you are just making things visible / invisible, enabled / disbled, you can do that with generic control references.  Your typedef can be made out of generic control references so you do not have to update it every time you change your boolean's mechanical action.

I hope this helps!

Dan Press
Certified LabVIEW Architect
PrimeTest Automation
Message 2 of 3
(2,829 Views)
Your Type Def. solution worked beautifully.  If only I had known weeks ago.  Thanks.

Brad
0 Kudos
Message 3 of 3
(2,809 Views)