UI Interest Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Control/indicator creation at run time (dynamic control creation)

@joshe:

CLFN: Call Library Function Node.

I have a set of VIs with me for some of the functions I mentioned. I will try to post them tommorow, which might save time for you for implementing the DLL calls.This way would be more performance efficient, as LabVIEW doesn't have the need to calculate the positions of each and every control (Windows handles that stuff), and this way, you can have multiple controls created during runtime, of different datatypes.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 11 of 16
(3,811 Views)

FraggerFox,

Can you post the VI you mentiioned.  I am getting ramped up to take a look at this stuff.  Thanks

0 Kudos
Message 12 of 16
(3,811 Views)

joshe wrote:

FraggerFox,

Can you post the VI you mentiioned.  I am getting ramped up to take a look at this stuff.  Thanks

I quickly made a set of VIs for you, the code is not cleaned up.

Follow the instructions on the front panel of the Main vi and you would understand the concept I was talking about.

You could also resize the dynamic controls if you want, for that you would need another Winapi call.

This is the most efficient method of dynamic control creation as it directly interacts with Win Layer.

Also, you can make vits for opening multiple instances of the same control.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
Message 13 of 16
(3,811 Views)

Cool, I have done similar to bring 3rd party software into my LabVIEW application...

I had similar request in the past, and I created cluster with common controls and let user edit on-the-fly name, description, tipstrips, size position (best part was -> I could change boolean behavior -> on-the-fly...) and such while displaying only the requested type. Also I limited number of controls to just 10 (no reason just preference and you can run more instances of the same app. or stitch them together with WinAPI ). More advanced options (like custom image for true/false, cursor icons...) were striped later -> too many options...

-Arturcontrols.png

Message 14 of 16
(3,811 Views)

Can you post your code.  I would be interested in seeing how this was implemented.

Thanks!

0 Kudos
Message 15 of 16
(3,811 Views)

Not exactly clean extraction, but good to get the concept going...

Originally this program was built relatively quick to control digital or analog output, to provide simple tool to work with systems under construction/development.

Control Event for analog/digital output was generated in "New Value" event case, left blank here.

Known problems:

  • resizing for controls where height is font dependent need to be optimized for cursor dragging, it is not efficient and with larger fonts falling behind. Can be optimized but in real application that feature was barely used, default size or size dialog was sufficient, as well as reloading from file. (In final application I disabled that feature (by placing disable diagram over "Draw resize Box.vi") and use only INI file with size dialog.)

Developing Notes:

  • Use "Develop Tools - ScratchPad.vi" to create cluster with controls you wish to use. 3 clusters looks the same but differ by "boolean mech. action type". You can probably omit action types or mix them, I decided to separate.
  • Use "Develop Tools - ScratchPopulate.vi" to clone them. I.e. to create 10 user controls with 3 types of mech. action you need 10x3 configuration.
  • Use "Develop Tools - ScratchRename.vi" to rename controls to match naming convention used in "Main.vi"

-Artur

Message was edited by: GriffinRU

Message 16 of 16
(3,814 Views)