LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to add control elements dynamicly?

The question is following. Can i add new control elements during VI execution?

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 1 of 9
(4,400 Views)
 

It's certainly possible to hide them until you want them to be displayed, by wiring "FALSE" to a Property Node via Properties | Visible [Change to Write], and then changing to "TRUE" when you want the thing to appear.

Similarly, you can use Property Nodes to resize and even re-position objects.

On the other hand, if you're asking about something along the lines of the W3C DOM model, where you can tell a document [specifically a document's <BODY>] to do just about anything to itself, including the creation of objects on the fly:

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dom/domoverview.asp


then I don't know, but my guess would be maybe not.

 

0 Kudos
Message 2 of 9
(4,399 Views)
The answer is Kinda... THere are a few techniques out there to allow the adding of controls and indicators. One way in LV7 is the use of subpanels. This will allow you to run another vi embedded into this subpanel. Typically a template of just 1 control. So what I am trying to say is that using this subpanel you will be able to see another vi's front panel embedded into your top level front panel. A second technique is to place tab control down and to remove the tabs. Programmatically you can control what tab is visible. If you start with a blank tab and then as a user would like to add a control you programmactically select another tab you in a way are adding controls. There is a Third technique that I have used called child windows. Using child window
can be accomplished by utilizing vi server and specifically the call by reference node. What you can do is create vi templates for each control that you would like to add. If you make them all with the same connector pane you can use the call by reference node. Typically this is done by using a run time menu. Using the runtime menu across the top of your vi you can add controls or indicators and when one of these options is selected you then open a template for that control. This is an advanced technique that was presented at NIWEEK 2003 maybe check it out and see if there is any info on this presentation. Hopefully I didn't confuse you and that this helped.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 3 of 9
(4,400 Views)
Thank u tarheel for answer. But u see, one can hide and subsequently show only finite number of controls. Sometimes it's not possible to foreseen all cases that can occur. And i need button creation method that is not bond to any time-of-vi-creation assumptions.

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 4 of 9
(4,399 Views)
Thank u for the answer. About first two methods u've proposed. They lack flexibility. I have to make every possible pattern to predict all types of data. Obviously that's impossible. As for the third method, i don't really got the point. What is the difference between this method and the first one? And what good run time menu brings? May be u have some example or link? By the way do u have link to the description of this technique at NIWEEK 2003?

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 5 of 9
(4,399 Views)

Hi Alexander,

Well now that you have seen all of the normal answers to this Q, let me bring up another.

Warning! This is not for the faint of heart!

Please see this thread for an exchange Jean-Pierre (I would have given him 5 stars if this was an answer) and I had about two years ago.

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=506500000005000000AF5E000...

In this exchange he suggests a technique that makes virtual controls a reality. This approach requires quite a bit of work to make it happen but it does work.

I have used variations on this technique ever since and my customers cannot tell the diffence between my virtual controls and LV native controls. I should say the is one big short comming with this approach, that being, the controls look so much like normal LV controls that you find yourself double-clicking on them!).

The technique is based on the fact that you can use an "invoke Node" to get the image of a control. This image can then be inserted into a picture control where ever it is needed. You then use events from the picture control to figure out which virtual device was clicked and then direct your execution as indicated.

I have also extended this idea a bit. Once a virtaul control has been clicked, the "prototype" of the control can be made visable and positioned over its image in the picture control and key focus assigned. The use then can play with the native LV control as they expect. When done changing the control, the prototype is again hidden and the new value is used to update the picture control.

Summarizing:
Yes it is possible to have an unlimited number of controls in LV,
But,
It is not a native functionality and you have to do alot of work to make it happen!

And finally let me quote someone "Be careful what you ask for, you just might get it!"

It is truly amazing what you can do with LV if you really want!

Ben


Ben Rayner
Certified LabVIEW Developer
www.DSAutomation.com

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 9
(4,399 Views)
Hello Ben. Thank u for your help. U know, i've actually seen the thread you are mentioning about. I've came to it surfing NI site, looking for the answer. Of course one can not deny the universality of this approach. More over, those virtual controls look like real. And i think that, calclulating position of controls is not as difficult as boring (spend some time recently, placing cursors on the XYgraph control using mouse). I've just thought that there can be some ohter way. The way that can lead to the creation of real new controls.
And u know, LV is really good development instrument. It can do a lot of complicated things in a few clicks. But still there are some things that i do not like, for example, why it's impossible to make a REAL stand
alone application? Why LV RTE is needed? And the installer is also quite poor. But anyway those things are not related to program development which is quite good in LV.

Alexander

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 7 of 9
(4,399 Views)
Hello Ben. Thank u for your help. U know, i've actually seen the thread you are mentioning. I've came to it surfing NI site, looking for the answer. Of course one can not deny the universality of this approach. More over, those virtual controls look like real. And i think that, calclulating position of controls is not as difficult as boring (spend some time recently, placing cursors on the XYgraph control using mouse). I've just thought that there can be some ohter way. The way that can lead to the creation of real new controls.
And u know, LV is really good development instrument. It can do a lot of complicated things in a few clicks. But still there are some things that i do not like, for example, why it's impossible to make a REAL stand alone
application? Why LV RTE is needed? And the installer is also quite poor. But anyway those things are not related to program development which is quite good in LV.

Alexander

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 8 of 9
(4,399 Views)
Hi Alexander,

If you want virtual controls NOW you will have to go with one of the methods mentioned above.

I believe NI is working toward giving native virtual controls. The method mentioned by BJD is an example of this fuctionality.

If you look at the releases of LV since 6.0 you can see the components being implemented in phases.

1) Control refs

2) Events structures

3) Dynamic events

All of the above items will be required to properly support native virtual controls and indicators.

Some of the functionality currently in the Vision Builder are also in their primitive stages.

MY guess is maybe LV 10 for the first introduction of true LV virtual controls.

Just my guess,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 9
(4,400 Views)