LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enum not updating case name

I have a case structure along with an event structure.

when I create a type def enum for the states and try to edit the enum the case names do not change to the new name, they change to the enum number and I get a coercion dot.

 

LV2010

Windows 7 Ultimate

 

enum.pngEnum change.png

Download All
0 Kudos
Message 1 of 18
(7,123 Views)

If you created the constants from the enum before you made it a typedef, the constants will not update.  You will need to make new constants from the typedef and replace the original ones.  After that they will update.

 

To check to see if this is the problem, pop up on one of the constants and look for "Update from Typedef?" in the list.  If that item is not in the list, then the constant is not linked to the typedef.

 

After you have had to go through and change all the constants to new typedef constants once, you learn to make the typedef first!!

 

Lynn

0 Kudos
Message 2 of 18
(7,112 Views)

they are all linked to the type def..

0 Kudos
Message 3 of 18
(7,109 Views)

Do you have more cases than items in the typedef?

 

I just looked closely at the images you posted.  The lower one shows coercion dots on the case selector and output tunnels.  That means that at least one constant is not the same as the typedef control.  Go through and remove the wire between the constant (or control) and the tunnel in each case.  If the coercion dot goes away then you have disconnected the "different" one.  If it does not, just Undo to restore the wire.  If two or more are different from  the others, you may not get rid of the coercion dot so easily.  Until all the coercion dots go away, you will continue to have this problem.

 

Lynn

Message 4 of 18
(7,106 Views)

When you look closely, you'll see that the coersion dot is shown at the border of the event structure and not at the case structure.

 

coersion.png

 

This seems more like a bug to me:

When the typedef'd enum is updated the event structure's "stored enum" is not updated. Only after deleting and re-connecting the wire from the Enum labeled Event Data Node, the coersion disappers and the wire has the correct information again.

 

regards

_________________________
CLA
0 Kudos
Message 5 of 18
(7,101 Views)

Good catch.  Edit the event to point to the typedefed enum.  The event structure considers the original enum and the typedefed enum to be two different controls.

 

Lynn

0 Kudos
Message 6 of 18
(7,096 Views)

The event is pointed to the type def...

0 Kudos
Message 7 of 18
(7,092 Views)

Still.  at least one constant on your BD is not connected to the same type def.  This can be a real pain to find.  from the hierarchy view search for instances of the type def and compare the count in this vi to what you manually count.  If only there were a better way to see if a constant was linked to a type def- sigh


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 18
(7,088 Views)

A sample program is attached, download and try it.

 

All enums are linked to the type def..

 

Open the enum type def

edit it

apply changes

save it

you will see coercion dots

 

check the enums, you will see they are all linked to the type def.

 

 

0 Kudos
Message 9 of 18
(7,081 Views)

Hi,

i don't see this behavior. If i change the type def, then everything is fine and works as expected.

 

Mike

0 Kudos
Message 10 of 18
(7,074 Views)