LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize case structure with updated enum

Solved!
Go to solution

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

 

21966i65095AAA839A0F98

0 Kudos
Message 1 of 4
(3,572 Views)
Solution
Accepted by topic author Mike O'Shea

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

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 4
(3,564 Views)

Simple!

Thanks.

Mike

Message 3 of 4
(3,555 Views)

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

0 Kudos
Message 4 of 4
(3,537 Views)