LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a composite control?

Solved!
Go to solution

I think I haven't well understood how to accomplish this.

 

What I want to do is to make a "user control" (aka "custom control", or "composite contro", I don't know which terminology NI uses), that is made of MORE THAN ONE control.

 

For example: I want to define a control made of a enum and a boolean check box (take the system ones, that's fine).

Appearence is fine.

Then I want to save this composite as a single "unit", a file .ctl maybe.

Its "type" under the hood would be a cluster of enum + bool.

Finally, whenever I need it, I could simply drop it on the front panel, having the cluster data type on the wire diagram.

 

My questions are:

1) How to do this with LV 2013

2) How can I "instantiate" this. I mean: is it possible to define a generic "enum + bool" (or ring text + bool) like in any programming language? When I define an enum in labview, I am forced to define and instantiate the element of an otherways empty enum/ringText.

How can Labview separate the concept of "data type" from the concept of "instantiation of a datatype". To me, LV collapses the 2 concepts.

 

Thanks.

0 Kudos
Message 1 of 5
(2,723 Views)
Solution

Cluster

 

File, New ... custom control.  Drop a cluster, add the enum and boolean to it, define the items in the enum and save it.

 

Control.jpg 

 

"Instantiate" it similar to the way you add any other control to the Front Panel, except you need to get it from where you previously saved it:

Control.jpg

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 5
(2,717 Views)

Thanks, how can I make the cluster border transparent? Which kind of cluster should I use? modern? are they all the same?

 

I don't want the user to see bezel, and the cluster 3D border effect uses some pixels

0 Kudos
Message 3 of 5
(2,696 Views)

You can edit a Classic Cluster by clicking this button:

 

Control.jpg   It'll look like this: Control.jpg

 

Use the Paint tool: Control 1.jpg to color the cluster's border transparent (right-click on the border): Control.jpg.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 4 of 5
(2,687 Views)

You can use the same trick to make a Modern cluster completely transparent.

Using the Paint tool, you will color the border and the background separately.

The trick is that when painting the border, you must right click and then use the Spacebar to toggle through the "active" areas (FG, BG, and Both). As you press space, pay attention to the two large squares in the lower-left corner of the Colors palette. Once both say "T", your bezel will be invisible.

 

You can do this from the control editor, or in the VI where you are using the custom control.

Message 5 of 5
(2,675 Views)