LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Cluster to System Cluster

Solved!
Go to solution

I have quite a big typdef, with many clusters in it, all of them in the standard "modern" style. I want to change these to "UI Control Suite: System Controls 2.0"-Elements, because they look way nicer in the frontpanel. But when I do this change by rightclick -> replace I simply get an empty cluster! I have to put all elements back in manually! Is this some sort of bug? Or am I doing something wrong?

0 Kudos
Message 1 of 9
(3,470 Views)

Hi jucasa,

 

what do you expect when you replace an existing cluster with an empty cluster?

 

Suggestion: place the new cluster next to the existing one, then drag'n drop the cluster elements from old to new cluster.

 

Suggestion 2: IMHO those "big typedef's with many clusters" most often look ugly on an UI, regardless of the control style used. Much better UX can be created with a dedicated UI handling user input and storing the data in your typedef'd cluster - without showing that part to the user…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(3,461 Views)
Solution
Accepted by topic author jusaca

I believe that is by "design".  When you create an empty Control on the Front Panel, you choose the Style of the Control, which becomes a part of the Control's definition.  According to my understanding, the only time you set the Control's style is when you create it.  So the only way to "change Styles" is to do the following steps:

  1. Create a new (blank) Control in the Style you wish to use.  It is probably a Good Idea to have the original Control available on the "defining" Front Panel.
  2. Set up your new Control's size, colors, decorations, etc., using the original Control as reference.
  3. If your Control is an Array, copy the Array Element from the Old Control to the New Control.
  4. If your Control is a Cluster, copy the Cluster Elements, in order, from the Old to the New Control.
  5. Show or Hide Control elements as desired.
  6. Save the new Control with a new, unique name (I recommend something like New <Old Control Name>.
  7. Now, exit the Project and (for safety) stop LabVIEW.
  8. Rename (or if you feel confident, Delete) the Old Control.
  9. Rename the New Control to the name of the Old Control (e.g. delete "New ").
  10. Reopen LabVIEW and the Project.  If LabVIEW complains it cannot find "New <Old Control Name>", simply choose "Remove from Project".

I know this is a lot of steps, but with a little foresight, you won't need to "change the Style of your Controls" very often.

 

Bob Schor

 

Message 3 of 9
(3,457 Views)

Ah, I see. Ok, it won't take that long, but I figured "replace" would keep the input of the cluster as it is.

 

Why do you suggest to rename the file? Can't I just create the new cluster, copy the elements over and delete the old cluster? Or could something go wrong that way?

 

@

You are right, the big cluster is never shown to the user but is only for saving parameters in the background in a shiftregister. But because I want to place parts of the big cluster here and there on the frontpanel in different tabs I want them to be already in the correct design so I won't have to bother about that anymore 😉

 

Best regards

 

0 Kudos
Message 4 of 9
(3,440 Views)

@jusaca wrote:

Why do you suggest to rename the file? Can't I just create the new cluster, copy the elements over and delete the old cluster? Or could something go wrong that way? 


Not only can something go wrong that way, but (sooner or later) something will go wrong (I know -- I've made all of these mistakes more than once!).  It is both Better (in some ways) and Worse (in others) if you are using LabVIEW Project (which I highly recommend!), as Project has its own "memory" of names and their current status.  The "catch" is you can't have two LabVIEW "Things" with the same name in memory at the same time.  You'll notice that I take care to do the Rename/Replace operation when LabVIEW is not running -- also from sad experience.

 

Bob Schor

0 Kudos
Message 5 of 9
(3,430 Views)

If you're not doing it already, it might be a good idea to make each cluster a type-def. Then it should be easy enough to Place the new empty cluster besides the old one, drag all the Controls over, delete the old (now empty) cluster and save the type-def.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 6 of 9
(3,415 Views)

@Bob_Schor wrote:

I believe that is by "design".  When you create an empty Control on the Front Panel, you choose the Style of the Control, which becomes a part of the Control's definition.  According to my understanding, the only time you set the Control's style is when you create it.  So the only way to "change Styles" is to do the following steps:

  1. Create a new (blank) Control in the Style you wish to use.  It is probably a Good Idea to have the original Control available on the "defining" Front Panel.
  2. Set up your new Control's size, colors, decorations, etc., using the original Control as reference.
  3. If your Control is an Array, copy the Array Element from the Old Control to the New Control.
  4. If your Control is a Cluster, copy the Cluster Elements, in order, from the Old to the New Control.
  5. Show or Hide Control elements as desired.
  6. Save the new Control with a new, unique name (I recommend something like New <Old Control Name>.
  7. Now, exit the Project and (for safety) stop LabVIEW.
  8. Rename (or if you feel confident, Delete) the Old Control.
  9. Rename the New Control to the name of the Old Control (e.g. delete "New ").
  10. Reopen LabVIEW and the Project.  If LabVIEW complains it cannot find "New <Old Control Name>", simply choose "Remove from Project".

I know this is a lot of steps, but with a little foresight, you won't need to "change the Style of your Controls" very often.

 

Bob Schor

 


I usually just open the original typedef'd cluster, create the equivalent cluster with equivalent controls, temporarily breaking the control, renaming all the stuff new stuff to the old stuff, then deleting the old stuff.  Apply the changes.  You're done.  If your original typedef'd cluster contains typedf'd controls, you'll have to drill all the way down the the elemental typedefs and start the process from there first.  By the time you fix all the elemental typedefs, your original typedef'd cluster will contain all the new controls.  This simplifies things at the top level because then all you need to do is create a cluster in the new style and move all the controls from the original cluster to the new one and delete the old one.

 

Does that make sense?

 

Edit:

I didn't read your response to the OPs question about doing a similar thing.  In my experience, as long as I updated the typedef, it always seemed to work.

 

Since you had a different experience, maybe I was just lucky enough for it not to bite me.

 

Edit 2:

Typedf's have become much more robust since the early days (I want to say pre-2010); maybe your experiences were with older versions of LV?

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 7 of 9
(3,408 Views)

@billko wrote:

@Bob_SchorI usually just open the original typedef'd cluster, create the equivalent cluster with equivalent controls, temporarily breaking the control, renaming all the stuff new stuff to the old stuff, then deleting the old stuff.  Apply the changes.  You're done.  .

 

Edit 2:

Typedf's have become much more robust since the early days (I want to say pre-2010); maybe your experiences were with older versions of LV?


used to use the latest version of LabVIEW, but when LabVIEW 2017 fried two of my PCs, I've stopped at LabVIEW 2016 (I now have LabVIEW 2017 and 2018 installed safely on VMs, all by themselves ...).  

 

One reason I was so careful/cautious is because of LabVIEW Project, which I always use for anything other than a simple "one-off" demo or code test routine.  Depending where/how you "rename" and/or "delete", Project can get really screwed up (as it maintains its own idea of what VIs you are using "in your Project" and where they are located, and will whine if it doesn't find them ...).

 

Bob Schor

0 Kudos
Message 8 of 9
(3,394 Views)

@Bob_Schor wrote:

@billko wrote:

@Bob_SchorI usually just open the original typedef'd cluster, create the equivalent cluster with equivalent controls, temporarily breaking the control, renaming all the stuff new stuff to the old stuff, then deleting the old stuff.  Apply the changes.  You're done.  .

 

Edit 2:

Typedf's have become much more robust since the early days (I want to say pre-2010); maybe your experiences were with older versions of LV?


used to use the latest version of LabVIEW, but when LabVIEW 2017 fried two of my PCs, I've stopped at LabVIEW 2016 (I now have LabVIEW 2017 and 2018 installed safely on VMs, all by themselves ...).  

 

One reason I was so careful/cautious is because of LabVIEW Project, which I always use for anything other than a simple "one-off" demo or code test routine.  Depending where/how you "rename" and/or "delete", Project can get really screwed up (as it maintains its own idea of what VIs you are using "in your Project" and where they are located, and will whine if it doesn't find them ...).

 

Bob Schor


Oh, man - I think I have PTSD from dealing with the issue highlighted above.  Then throw in SVN renaming if you really want to self-flagellate.

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 9 of 9
(3,374 Views)