04-23-2014 07:39 AM
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
04-23-2014 07:52 AM
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…
04-23-2014 07:56 AM
thanks a lot!!
04-23-2014 08:02 AM
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.
04-23-2014 10:11 AM
@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.