08-20-2010 03:53 AM - edited 08-20-2010 03:56 AM
Hi, I have created an enum control initially with values "First" and "Second". In the block diagram, I have created a property node from this enum control and it is wired to a case structure. The case structure enables me to handle the condition "First" or "Second" correctly.
I have then edited the items in my enum so there now exists a "Third". My problem is that the case structure conditions are still only showing "First" and "Second"; ie I cannot handle the condition "Third". My question is how do I synchronize my case structure to show the updated enum values?
Sample VI attached, created with LabVIEW 2009 version 9.0f3 (32 bit) running on Windows 7.
Thanks all for your help in advance.
Michael O'Shea
Solved! Go to Solution.
08-20-2010 04:07 AM
First tip: Remove the 'default' value from the first case
If you have done that your VI will break when you alter your enum, which is a good thing.
Now to synchronize, right click on the border of the case structure and select 'add case for every value', this is the option you are looking for.
Ton
08-20-2010 04:26 AM
Simple!
Thanks.
Mike
08-20-2010 08:48 AM
Mike,
Also consider making the enum a typedef. If you are going to change it after it is originally created (which happens a lot), a typedef will change all constants made from it. This can prevent many errors from chasing down all instances of the control or constant. This is especially useful in state machines.
Why did you not wire the control directly to the case selector rather than using the property node?
Lynn