Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
23 ratings:
 3.56 out of 5     Rate this Document

Obtaining the String Selected from a Text Ring or Menu Ring



Primary Software:
Primary Software Version: 8.5.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I have a text ring or a menu ring on my front panel. These give me the number associated with the item the user selected; however, I want an easy way to find the string.

Solution:
There are two methods for doing this.

Method A
A simple solution is to use a property node to retrieve the text property.
  1. Right click on your text ring or menu ring and select Create»Property Node.
  2. Locate the property node you just created on the block diagram. Right click on the property node and select Properties»Ring Text»Text.  The output of the property node is now the text selected in the ring control.
Method B
A second solution is useful when trying to limit the number of property nodes used.  A property node can retrieve the Strings[] property. Then use the index array function to find the particular string the user selected. For more information on the performance of property nodes please see the Related Links section.
  1. Right click on your text ring or menu ring and select Create»Property Node.
  2. Locate the property node you just created on the block diagram. Right click on the property node and select Properties»Strings[].
  3. Place the index array function (located on the Array palette) on your block diagram.
  4. Wire the output of the text ring or menu ring to the Index input of the index array.
  5. Wire the output of the property node to the Array input of the index array.
  6. The output of the index array is now the string the user selected in the text ring or menu ring.


Related Links:
KnowledgeBase 2T9ICKTL: How Can I Optimize the Memory Use in My LabVIEW VI?
KnowledgeBase 2WD8GR00: Programmatically Edit Items in a Menu, Text, or Enum Ring List
KnowledgeBase 32JFF559: Programmatically Index Through an Enum, Text, or Menu Ring
KnowledgeBase 275EA8XQ: Changing the Item List Color of a Menu Ring In LabVIEW
KnowledgeBase 2MOF9IO9: What is the Difference Between a Local Variable and a Value Property Node?

Attachments:





Report Date: 02/13/2004
Last Updated: 06/25/2008
Document ID: 36C8G0E6

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit