LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a better way to name cluster elements than making an initially named cluster?

I feel your pain.  Your predecessor probably wrote C code with parameters like "a" and "aa" and "ab".

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 11 of 15
(917 Views)

@billko wrote:

I feel your pain.  Your predecessor probably wrote C code with parameters like "a" and "aa" and "ab".


Just be glad it wasn't "a", "A" and "@" (I know the last isn't a valid identifier, but I don't have any better A characters 😕 )


GCentral
0 Kudos
Message 12 of 15
(902 Views)

Create a type def'd cluster with names, then convert the unnamed one with Variant to data. The element types must match, ofcourse.

Unnamed to named cluster.png

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 13 of 15
(882 Views)

Even with a small (not named) bundle cluster you can bundle it without lot of (never wasted) space to something meaningfull 🙂

Just double click the cluster to make it small.

 

naming clusters.png

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 14 of 15
(875 Views)

Following up on Henrik and other posts (including those that say "Make a TypeDef of your Cluster), here is a TypeDef of a Data Cluster I created by the following steps:

  1. Make the Cluster on your Block Diagram.  Give it a "sensible" name, e.g. "Data".
  2. Right-click it and say "Make TypeDef".
  3. Edit TypeDef so that it "looks nice" (I like to use AutoSizing).
  4. Make a Simple Icon for the TypeDef, then save it with a "sensible name".  I've adopted the (perhaps silly) convention of calling my TypeDefs "TYPE <whatever>".

Here's a picture of TYPE data.ctl:

TYPE Data.png

 

Now that you have your TypeDef, you can delete the Control or Indicator you used to create it, as you'll be using the TypeDef from here.  Here is my version of Henrik's example:

TypeDef-ing Clusters.png

In the top Cluster, the Cluster Constant was placed by right-clicking, doing "Select a VI", and browsing to TYPE Data.ctl.  Note if I were working in a Project and using QuickDrop, I could type Ctrl-Space, start typing TYPE Data, and before I got it all typed, it would pop up on the top of the list, so typing "Enter" would place it on the Block Diagram.  The lower cluster was made by simply copying the upper one -- the only difference is I double-clicked the border of the Cluster Constant and it became an Icon, which (since I'd defined the Icon in my TypeDef) had the name of the Cluster, even more self-documenting.

 

One more note -- notice the top Cluster Constant has the label "Data" showing, but the bottom one does not.  I right-clicked the lower Icon and turned off the Visible Label.

 

Bob Schor

Message 15 of 15
(859 Views)