LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i change the item in the drop down list, and furthermore update the constant

I have a drop down list Control that is full of items. I would like to change the lables on these items at runtime, as i knew, i should use the Ring but not Enum, because we can't change values of enum at runtime.

Furthermore i want to creat a Constant from this Control (drop down list ) on the block diagram, but if i edit the item list of the Ring control, LabVIEW does not automatically update the constant to which it is linked.

how can I solve it?

Thx and Best regards

Di

Message 1 of 5
(3,407 Views)

Hi mexa,

 

- to automatically update constants on the BD when "their" control changes you need to make the control a typedef and create a typedef'd constant from it

- BUT: a ring constant will still not adapt to the changes of the control as that's not part of the typedef! To have it adapt you would need to use an Enum - which can't be changed at runtime…

 

Conclusion: you need to update the ring constant whenever you make changes to your BD…

Best regards,
GerdW


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

thanks a lot!!

 

 

0 Kudos
Message 3 of 5
(3,395 Views)

There is a trick to update "ring controls" from a type definition.

 

You have to:

- open the type def of the ring control.

- edit the items of the ring control.

- then you have to change the data type of the ring control (e.g. from U16 to U32).

- click on File -> Apply changes.

- undo the change of the data type of the ring control.

 

Done.

 

Crosspost to german LVF

Kudos are welcome...
0 Kudos
Message 4 of 5
(3,383 Views)

@jg69 wrote:

There is a trick to update "ring controls" from a type definition.


Or just make it a Strict Type Def.  But then you can't programmatically update the items in the ring.  They will be set at design time.  This is pretty much required if you are going to have a constant anyways.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(3,349 Views)