From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Match Control Properties

I want to know if there is a simple way to programmatically pass ALL of the properties of one control to another.  In other words I'd rather not pass the properties one by one, using property nodes, and simple pass them all at once.

 

Motivation:  I have a VI which continuously collects data and displays said data to the front panel in a graph (and of course this VI does many other things that aren't relevant to this discussion).  One feature I'd like to include is the ability to press a button which will cause this graph to pop up in a separate window and I want it to match all the properties of the graph on the main window (except that the graph in the separate window will scale with the window) and trying to pass every single property from the main graph to the graph on this separate front panel sounds quite tedious.  So I figured it wouldn't hurt to ask the experts before I spend a lot of time doing it.  Thanks in advance.

0 Kudos
Message 1 of 5
(2,642 Views)

Make the graph a 'strict type def' (search for this in the help if you are not knowing about this). This assumes that you know all properties before running the code.

Second option is to use VI scripting to make a copy/paste. Requires target machine to have the IDE installed.

 

But I'd try to use subpanales. So there is only one graph (vi with the graph). You display it on your main FP and/or the pop-out VI. I'm not sure if there are some tricks involved, but I'd try that first.

 

Felix

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

I should clarify:

 

I want a separate pop out display which will have all the properties of a graph which a user might change during run time (line color/style etc.).  I want a user to be able to change these things during run time, I just want the pop out graph to match when it is selected.

 

With a subpanel I don't know how to keep the graph displayed after the program has stopped, which is something I would want.

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

Short answer: No, there's no such interface. LV does have private methods for generic getting and setting of properties, but their API is undocumented and I've heard from NI that they're not actually used, so they may not even work anymore. There is an old toolkit which does copy the properties individually, which might save you some time - http://www.kshif.com/lv/index.html


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(2,610 Views)

There is no function to transfer all properties.

However you don't have to pass all of the individual properties to the sub VI, just pass a reference to the contol to the sub VI (Of course the sub VI will have to transfer the property values individually.

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