Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
5 ratings:
 2 out of 5     Rate this Document

Programmatically Index Through an Enum, Text, or Menu Ring

Primary Software: LabVIEW Development Systems>>Full Development System
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Toolkits>>State Diagram Toolkit

Problem:
Is there a way to programmatically index an enum, text or menu ring?

Solution:
Yes, you can programmatically index an enum, text, or menu ring. An easy way to do this is to type cast the iteration terminal of a While or For Loop to the enum, text, or menu ring that you want to index. Note that the iteration terminal is an I32 and enum, text, and menu rings are of type U16 by default. You can either use the To Unsigned Word function before the typecast or change the representation of the enum, text, or menu ring to I32. Attached is a VI that shows how to index through an enum using this method.

Related Links:
Developer Zone Tutorial: Application Design Patterns: State Machines
Products and Services: NI LabVIEW State Diagram Toolkit
KnowledgeBase 2WD8GR00: Programmatically Edit Items in a Menu, Text, or Enum Ring List
KnowledgeBase 275EA8XQ: Changing the Item List Color of a Menu Ring In LabVIEW
KnowledgeBase 36C8G0E6: How do I Obtain the String Selected from a Text Ring or Menu Ring

Attachments:


Type Casting to an Enum.vi


Report Date: 10/20/2003
Last Updated: 04/24/2008
Document ID: 32JFF559

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