08-29-2025 01:04 PM
I have been unable to get all enum values to appear in a case structure.
This is the enum:
This is a test setup:
The full enum is visible for Obtain Queue and Enqueue Element.
The value for Enqueue Element was created using Create Constant.
However, the case structure only displays the first 2 of the 3 enum values.
After creating this test setup, the nonzero enum names were changed to "A" and "B".
Enum names updated everywhere, including the case structure, but the case structure still does not include "B".
The enum is strict:
What can I try or what have I missed?
Solved! Go to Solution.
08-29-2025 01:11 PM - edited 08-29-2025 01:12 PM
08-29-2025 01:14 PM
The test structure was added to the main VI in a project where the issue made its appearance in a sub VI of that main VI.
This is to say the example was not created in a new VI.
08-30-2025 09:36 AM
When dealing with Enums and Case Statements, here's what you should do to prevent "missing enum value" errors:
Bob Schor
08-30-2025 10:06 AM
Thank you Gerd for clearing up my brain fart!
08-30-2025 10:20 AM
Thank you Bob for your suggestion. If the default is removed, the null entry can also be removed since it was added as a do nothing value since there is no default behavior. Live and learn.
08-31-2025 05:50 PM
@Bob_Schor wrote:
When dealing with Enums and Case Statements, here's what you should do to prevent "missing enum value" errors:
- Wire the Enum to the (initially empty) Case Statement.
- Right-click the Selector at the top and choose "Add Case for Every Value. In your example, it will populate with the three Cases "A", "B", and "Null", Default (the last case has two entries, "Null" and Default).
You can actually right-click anywhere on the case frame to do that. (I had actually thought that you had to right-click anywhere other than the Selector, until I just tried it).