LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add control or indicator at runtime?

Hello everybody,

 

Do you know how to add control or indicator at run-time? I'm using LV 8.2.

 

Thank you.

0 Kudos
Message 1 of 11
(4,063 Views)

Hi yoppy,

 

you cannot add controls at runtime. Point.

 

But you can:

- make predefined controls visible (by property node)

- move predefined controls to visible pane (by property node)

- use arrays of controls

- use a fixed amount of controls, but assign their values to different "storages" aka "variables"

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(4,053 Views)

You can check for the example at this link.

You can dynamically create controls (which you pre-defined) and assign them to the parameters you are interested in.

 

I will attach the sample code.....check it out.

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

@Fragger Fox: Thanks for your code. But unfortunately, it's in LV ver 9.1. Mine is 8.2. Would you please convert it?

 

Thanks in advance.

0 Kudos
Message 4 of 11
(4,040 Views)

Here you go...

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

The interesting part is to get values from the newly created controls.

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 6 of 11
(4,023 Views)

@Fragger Fox wrote:

You can check for the example at this link.

You can dynamically create controls (which you pre-defined) and assign them to the parameters you are interested in.

 

I will attach the sample code.....check it out.


That's not really dynamically creating controls. It's simply opening VIs and moving them so the window relationship is set through the Windows API. For one thing, it's not portable, as it's Windows-only. Also, the control has no relationship to the "parent" VI.

0 Kudos
Message 7 of 11
(4,003 Views)

I did this with a picture control.  It's in LV 8.2.

 

original.png

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 8 of 11
(3,995 Views)

Thank you Fragger Fox abundantly.. I wonder how I can set and get values from the created controls.For example, I type on String control, and I want to catch the value on the string control.

 

 

Also, can I create more than one same controls, for example 3 controls of string.

 

Thank you.

0 Kudos
Message 9 of 11
(3,974 Views)

@yoppy wrote:

 

Also, can I create more than one same controls, for example 3 controls of string.

 


Yes, you can create multiple controls. You can make the control VIs re-entrant and launch multiple controls


 

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