anton.lindner Posted January 14, 2005 Report Share Posted January 14, 2005 Hi all, I use an enum at the case selector input of a case structure to build a small state machine. The enum is defined as a type def, so that I can add states easily without editing all enums by hand. If I connect a case structure to the enum, the first time, the case structure labels are generated from the enum labels. Unfortunately if I add a state to the enum, the case structure labels are set to the pre-defined labels e.g. 0 (default), 1, 2, .... Changing case structure to sequence and back didn't work, adding cases also didn't work. Has anybody an idea how to get the labels back to the case structure? Greetings, Toni Quote Link to comment
RandyR Posted January 14, 2005 Report Share Posted January 14, 2005 Hi all,I use an enum at the case selector input of a case structure to build a small state machine. The enum is defined as a type def, so that I can add states easily without editing all enums by hand. If I connect a case structure to the enum, the first time, the case structure labels are generated from the enum labels. Unfortunately if I add a state to the enum, the case structure labels are set to the pre-defined labels e.g. 0 (default), 1, 2, .... Changing case structure to sequence and back didn't work, adding cases also didn't work. Has anybody an idea how to get the labels back to the case structure? Greetings, Toni 3514[/snapback] I'm not quite sure how you made the case selector labels revert back to ints. I tried adding, deleting and I couldn't get it to do it. In fact, I don't think I've ever had this happen to me after years of using enum driven case statements. Maybe I'm lucky. Can you reproduce this at will? That said, you do realize you can just click into the label with the labeling tool to rename the labels back to match the enum... Randy Quote Link to comment
anton.lindner Posted January 14, 2005 Report Share Posted January 14, 2005 Hi Randy, thanks for your fast answer. Although the original problem still exists I couldn't reproduce this behaviour with a new vi. Seems like a one-time issue. Curious..... So I will re-programm the vi and see what happens. Toni, the surprised Quote Link to comment
Mark Balla Posted January 14, 2005 Author Report Share Posted January 14, 2005 I have seen this problem before. It happened in a state machines where one of constats to be fed back through the shift register is a control not a type def. Initially everything looks fine but when the typedef is changed the control constant does not update. The common exit tunnel in the case structure now has two separate enums wired to it and it reverts to an integer which changes the case structure display. coercion dots should show up on the exit tunnels to indicate this. If this is the case you need to find all the constants that are not linked to the typedef and replace them. Hope this helps. Quote Link to comment
RandyR Posted January 14, 2005 Report Share Posted January 14, 2005 I have seen this problem before.It happened in a state machines where one of constats to be fed back through the shift register is a control not a type def. Initially everything looks fine but when the typedef is changed the control constant does not update. The common exit tunnel in the case structure now has two separate enums wired to it and it reverts to an integer which changes the case structure display. coercion dots should show up on the exit tunnels to indicate this. If this is the case you need to find all the constants that are not linked to the typedef and replace them. Hope this helps. 3522[/snapback] Ah ha... that explains it. Quote Link to comment
anton.lindner Posted January 18, 2005 Report Share Posted January 18, 2005 mballa, thank you. In fact it was exactly as you described. I found the non-typedef enum while I was reprogramming.... Greetings, Toni Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.