08-11-2011 03:10 PM
Hey all,
I'm currently trying to create a case structure using enum constants to tell it what state to go to, my problem is LabVIEW keeps changing the names of my cases to 0, 1, and so on.
Everytime I type in anything like "initialize" it just changes it back to whatever it was before. Is there any reason for this?
Thank you,
-Jake
08-11-2011 03:11 PM
Create a typedef of your ENUM and use that for all instances of your ENUM. THat will keep all copies of it up to date and in sync, including the case structure.
08-11-2011 04:21 PM
Are you sure you are actually using an enum and not a ring control?
08-11-2011 04:36 PM
If your case structure is showing numbers instead of text, you are definitely not using an enum. You are using a ring control. Even though you can associate text with a ring control, it isn't the same as a true enum. A ring control uses the index number for case selection. An enum uses the actual text for case selection.
08-11-2011 04:38 PM
@tbob wrote:
If your case structure is showing numbers instead of text, you are definitely not using an enum. You are using a ring control. Even though you can associate text with a ring control, it isn't the same as a true enum. A ring control uses the index number for case selection. An enum uses the actual text for case selection.
But if you mix typedefed with non-typedefed ENUM you will see number instead of labels as well.
08-11-2011 07:17 PM
How do you mix enums?
08-11-2011 07:25 PM
Easy. Create enum. Put some constants inside a few cases. Change the enum. Make more constants.
Then think, "Oh, I should have made it a typedef!"
Been there, done that. Hopefully smarter now.
Lynn
08-11-2011 07:50 PM
Okay, so mixing non typedef and typedef'd enums into the shift register of the loop. ??
08-11-2011 07:52 PM
@johnsold wrote:
Easy. Create enum. Put some constants inside a few cases. Change the enum. Make more constants.
Then think, "Oh, I should have made it a typedef!"
Been there, done that. Hopefully smarter now.
Lynn
A painfull lesson we all learn ( once)
08-11-2011 08:26 PM
____________________
mixing non typedef and typedef'd enums into the shift register of the loop. ??
____________________
Yes. That will do it.
Lynn