LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring Control Vs. Enumeration Control

Hi,
Can someone tell me what is the difference between a ring control and an enumeration control, other than the fact that I can assign any integer value to a ring label?
 
Thanks,
Phil
Message 1 of 6
(32,109 Views)
The value of a ring control is a number, as you already know.  The value of the enum is a string.  If you wire each to a case structure, you will see the difference.  The case heading will be a number for the ring control.  The case heading will be a string for the enum control, even though the enum wire is blue (numeric).  In other words, the case will try to match a number for the ring, and will try to match a string for the enum.
- tbob

Inventor of the WORM Global
Message 2 of 6
(32,101 Views)

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.

Message 3 of 6
(32,098 Views)
Actually, to be precise. Enum strings can only be modified when the enum is not in run mode. This is omportant because it is possible to write a program (using vi server calls) to populate the strings of an enum typedef programmatically and then resave the typedef with the new values.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 6
(32,085 Views)

Thanks for your responses.  This cleared things up for me.

Phil

0 Kudos
Message 5 of 6
(32,079 Views)


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

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 6 of 6
(32,050 Views)