LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating custom control

Hi everyone,
 
Is there a way to create a custom control with multiple controls and include the programming code together?  I've done a search and looked a creating a new control.  However, you can't create a custom control with multiple elements together (e.g., I need three combo boxes together) without using a cluster.  Once I put them on a cluster, the control can be included in my projects but I can't access the code normally (i.e., ctrl-E).   It would be really convenient to create custom controls with the internal logic in a drag-and-drag piece. 
 
BTW, how would you interface with this type of control since Vi's only have one set of inputs and outputs.  Would I have to control it (i.e., call multiple functions/methods using a flag)?  Thanks for your help since Labview is still new to me.
 
Thank
 
Will
0 Kudos
Message 1 of 8
(3,358 Views)

Search the LabVIEW help for "XControl". It is really not intended for use be noob's but if you pound at it hard enough, and don't give up, you'll learn a lot along the way.

Otherwise you may want to look for the radio buttons. Smiley Wink

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 8
(3,357 Views)

A co-worker showed me a very simple method of simulating a control using a Sub Panel connected to a VI.  This allows the VI to be used

The most significant drawback is the fact that each VI can only be used once, unlike XControls it would appear.  However, since we only need one control and this method simplifies the code, we'll probably use this method.  I'm still investigating the XControl -- which is exactly what I was originally looking for -- for future applications.

Thanks everyone.

Will

0 Kudos
Message 3 of 8
(3,321 Views)
Hi,

Additionally, please take a look at this DeveloperZone article, it is pretty comprehensive and it should be very helpful.

Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 4 of 8
(3,304 Views)
Hi Will,

it is possible to make your code reusable if you put all your manipulating code (property nodes, event handling) into a SubVi and wire a control reference for each control of that kind to this SubVi. If I find some time, I'll try to code and post an simple example of that.

Felix
0 Kudos
Message 5 of 8
(3,289 Views)
I started working on a simple example for a XControl.  What is method of controlling the output of an XControl?  I've created a simple XControl with a slider and string.  The code syncs the two contents together (slider numeric is converted into a string).  I've tried connect the slider output to both data out and display state out (a cluster with one numeric) but the output always remains zero. 
 
Thanks
 
Will
 
0 Kudos
Message 6 of 8
(3,261 Views)
Can you post the code you have so I can take a look at it?
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 7 of 8
(3,237 Views)

Sorry for the delay.  It's a busy time right now.

Here is an example code.  I've set up a string and a slider to be syncronized.  I would also like to be able to read the value of the slider, and in the future a specified cluster from the control.

Thanks for your help

Will

 

 

 

0 Kudos
Message 8 of 8
(3,182 Views)