01-31-2022 10:10 AM - edited 01-31-2022 10:11 AM
I am a beginner trying to understand an existing block diagram. The following symbol is a Ring constant, right? When the program runs, the user never gets to select the value. Does that mean its default value is used? When I click on Properties > Edit Items, it lists Value1, Value2, and Value3, but Value1 is checked: is that the default? If I need it to be Value2 instead, do I make sure Value2 is checked on the block diagram, then run the program?
Solved! Go to Solution.
01-31-2022 11:08 AM
This is a diagram constant that is wired to the indicator (not 100% sure, because the wire routing is pretty ugly!). The diagram constant will have whatever value you select at edit time.
A diagram constant can't be changed a runtime. For that, you need to turn it into a control.
01-31-2022 11:39 AM - edited 01-31-2022 11:41 AM
And in order to select the value at edit time, I make my selection the checked item in the list, right? So Value2 is checked but Value1 and Value3 are unchecked.
01-31-2022 11:48 AM - edited 01-31-2022 11:58 AM
@colorimeter wrote:
And in order to select the value at edit time, I make my selection the checked item in the list, right? So Value2 is checked but Value1 and Value3 are unchecked.
Yes, that is the correct way to set the value of that instance of the ring constant. The default value is different. A default value is the value a new instance of the control or constant initially holds when it is created, e.g. 0 for numerics (or 0 +0i), empty string for strings, VOID for Varients etc... You can change the default value for control instances with the property editor or by creating a type definition.