12-14-2016 01:29 PM
@Ben wrote:
@spastichawk wrote:
@ML927 wrote:
Hi Ravik,
You just need to make your state enum a type definition.
http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/creating_type_defs/
Any time you need to add or delete a state, modify your type definition, apply the modifications and it will update all your enums at once 😉
While this works for adding states it seems to break the case structure when deleting or renaming a state. I have tried combinations of just deleating the state in the typedef or typedef and case structure but each time I get a coersion dot and all the state names are blank in the case structure. Is there a prober way of deleating a state without polluting with 'dummy' unused states?
I can only speculate but I think ...
1) at least one of the cosntants in your diagram is not an instance o the type-def
OR
2) You did not apply changes and do a "save All" after editing the type def.
Ben
BEm,
1) I have checked all constants and they are all an instance of the typedef
2) I did a save all and updated what I can (deleting a case does not present a "add case for every instance" option when right clicking the case structure).
12-14-2016 01:31 PM
@crossrulz wrote:
@spastichawk wrote:
While this works for adding states it seems to break the case structure when deleting or renaming a state. I have tried combinations of just deleating the state in the typedef or typedef and case structure but each time I get a coersion dot and all the state names are blank in the case structure. Is there a prober way of deleating a state without polluting with 'dummy' unused states?
If the enum is wired directly to the case structure, then the case selector should show the enum names. So if you have a case for A and you delete A from the enum, you should have a broken VI because you have to fix something. Likewise, if you add values to the enum, your VI should be broken because you need to add more cases to handle the new values. I have never seen a coersion dot on a case structure do to changing enum values. Could you post an example of this?
Unfortunately I cannot upload data (company policy). Adding values is not a problem, it only becomes a problem when renaming or removing.
12-14-2016 02:04 PM
Posting a stripped down version of the case structure plus enum would cut-out a lot of guessing.
Another thing that you can try is to find a plce where you get the corecion dot AND where there is no corecion dot. Switch on the hlep window and select the wiring tool and the float over the wires coming from the constants (both with and witoug coecion dots). Carefully compare what the help windows saya about the data in the wire.
Another check is show to VI hiearchy and make sure the type defs are shown in the display. doulbe check that there is only one type def.
Ben
12-14-2016 02:15 PM - edited 12-14-2016 02:24 PM
@Ben wrote:
Another check is show to VI hiearchy and make sure the type defs are shown in the display. doulbe check that there is only one type def.
Ben
Thats what the 8-ball said when I asked it
Of Course the easy way is to open the type def, View>>Browse Relationships>>Unopened Type Defs. There's your culprit!