LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State Machine

Solved!
Go to solution

Hi! I also have a question about state machines: once your state machine is built and fonctionnal, how do you edit the item list of the Enum Constant Properties (like remove or rename a state) and have the Case structure reflect the changes? When I do the slightest change to the list, all the related information in the Case structure disappear leaving only case numbers? Can anyone help me? Thank you very much!

0 Kudos
Message 11 of 22
(851 Views)

Use a typedefed ENUM. Use this typedef for ALL of your ENUM constants in your state machine. That way when you edit the typedef everything derived from it will be updated 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
0 Kudos
Message 12 of 22
(844 Views)

Hello Mark,

Thanks for the quick response! I tryed to modify my Enum Constant to select the "Update from Type Def." option, and then modify a list item name. Unfortunately, the Case Structure does the same thing: all information related to the Enum item list disappear except for the item numbers. Am I doing something wrong, or haven't I understand correctly your instructions? Thanks for your help!

0 Kudos
Message 13 of 22
(841 Views)

@StephChouinard wrote:

Hello Mark,

Thanks for the quick response! I tryed to modify my Enum Constant to select the "Update from Type Def." option, and then modify a list item name. Unfortunately, the Case Structure does the same thing: all information related to the Enum item list disappear except for the item numbers. Am I doing something wrong, or haven't I understand correctly your instructions? Thanks for your help!


Yes, ALL instances of the ENUM, and I mean EVERYONE of them, but use the typedef. If even a single one does not the case structure will only show numbers if you changce the ENUM typedef.



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
0 Kudos
Message 14 of 22
(838 Views)

I did change ALL Enum Constant occurences in the Case structure to select the "Auto-Update From Type Def." option, and still, the Case Structure lost all information but the item numbers...

0 Kudos
Message 15 of 22
(835 Views)

Were they all created from the same typedef? Can you post you code? It is easier to see what is going on if one can actually see the code.



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
0 Kudos
Message 16 of 22
(829 Views)

Here is my code before modifications...

0 Kudos
Message 17 of 22
(825 Views)

You did not include your typdef. In addition, only one of your ENUMs in this code was associated with the typedef. Modifying the typedef would result in the behavior you described. It would be much more helpful for you to post the code after your modifications that you say is not working.



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
0 Kudos
Message 18 of 22
(820 Views)

Hello again Mark,

When I try to "Update from Type Def." all my ENUMs, the system saves a new Control Type Def every time instead of pointing to an existing one. I end up with as many Control Type Def files (Control x.ctl) as I have ENUMs in my code. I must be doing something wrong, but I don't know what?

0 Kudos
Message 19 of 22
(817 Views)

Replace all of your ENUMs with th etypedef. Don't create a new one for each one. For each of your ENUMs right click on it and choose replace. Then select your typedef. Lesson to be learned here is that you should always use typedefs for ENUMs. If you start there you don't waste a ton of time replacing all of your instances or modifying all of them to make a change.



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
0 Kudos
Message 20 of 22
(815 Views)