07-13-2005 03:10 PM
07-13-2005 04:32 PM
07-13-2005 04:39 PM
To add to Tbob's reply, the strings of the ring control can be set programatically (using the strings property node).
However, the strings of an enum can only be set during development. The "strings" property is a read only attribute.
07-13-2005 10:49 PM
07-14-2005 07:30 AM
Thanks for your responses. This cleared things up for me.
Phil
07-17-2005 11:58 PM - edited 07-17-2005 11:58 PM
tbob wrote:
...The value of the enum is a string...
Hi tbob,
Sorry, but the above statement can be easily misinterpreted, therefore I will
try to clarify the difference between the TYPE and the DATA of an Enum.
An Enum TYPE consists of a collection of strings (think of it as an array of
strings) that are indexed. The value (DATA) you pass to and from an Enum in run
time is only the index value - NOT the actual string. Test this by connecting a
simple numeric control to an Enum indicator and observe that the numeric
control will change the index, hence the selected string, of the Enum.
"Well, how come a Case Structure then shows the strings and not just the
index numbers when an Enum is connected to the Case Selector terminal?",
you might ask yourself. This is because the Case Structure is intelligent
enough to retrieve the "string list" from the Enum TYPE when they get
connected in edit mode. After that, the Enum and Case Structure will not exchange
"strings" until the Enum TYPE gets edited, and that can never happen
in run mode.
Notice that if you want to pass data between two different Enums, you will get
a broken arrow, unless you remove the TYPE information using for example a
"To Unsigned Word Integer" function:
Here is also a KnowledgeBase that describes the practical differences between Enums and Text Rings:
What is the Difference Between a Text Ring and an Enum?
PhilP, I hope that I helped making it clear to you how the Enum works, otherwise let
me know.
Have fun!
Message Edited by Philip C. on 07-18-2005 12:00 AM