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: 

CREATING NEW CONTROLS WHILE RUNNING

Hi is there any way that I can take data from user in variable number of controls. Say in one main control I take data from user that says 4, so 4 more control should get activated in which I can take different data. Or if say user enters 15 in the main control, so 15 new control should popup while the vi is running. I know there is a way to activate and deactivate a control using property node right, but that makes the number of control that should pop up limited. So if there is any way please suggest Smiley Happy

 

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

This question has been asked MANY times. You cannot add/remove controls at run-time. This is effectively the same as having an application modify itself while it's running. There are alternatives, such as having a max number of controls, and then simply making them visible/invisible. Or, having the "control" be a subVI, and you can create multiple instances of that VI by using a VI template or making the VI re-entrant and then dynamically calling it. Depending on what you're trying to do, you make be able to use an array instead of individual controls.

Message 2 of 5
(2,256 Views)

Try using a table. You can resize the table as required. If you want to use ENUM controls, you can use a single ENUM control of each type, and move it to the selected cell (column, row) on the fly.

 

You can do the same thing with a picture. The controls can be text or image on the picture until the mouse is positioned over one and then you move the control to that position, load the value in it, and make it visible. 

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

It you want to take the approach mentioned by david.

 

See this thread for links to picture related threads.

 

Ben

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

I did this.

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 5 of 5
(2,205 Views)