LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Naming cases in the case structure

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

0 Kudos
Message 1 of 12
(4,244 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 12
(4,243 Views)

Are you sure you are actually using an enum and not a ring control?

0 Kudos
Message 3 of 12
(4,227 Views)

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.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 12
(4,222 Views)

@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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 5 of 12
(4,218 Views)

How do you mix enums?

0 Kudos
Message 6 of 12
(4,206 Views)

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

Message 7 of 12
(4,204 Views)

Okay, so mixing non typedef and typedef'd enums into the shift register of the loop.  ??

0 Kudos
Message 8 of 12
(4,201 Views)

@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)

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 12
(4,200 Views)

____________________

 

mixing non typedef and typedef'd enums into the shift register of the loop.  ??

____________________

 

Yes.  That will do it.

 

Lynn

0 Kudos
Message 10 of 12
(4,195 Views)