VI Analyzer Enthusiasts Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Test - Enum Constant Value Changes

This test helps detect situations where a LabVIEW bug causes enum constant values to change after a typedef has been modified. This is a scenario that used to happen quite frequently in LabVIEW many years ago. The introduction of the Manually Updating Type Definition Instances feature dramatically decreased the number of times this problem happens, but unfortunately, it does still occur on rare occasion. Ideally these rare situations will be reported as bugs to NI so LabVIEW R&D can fix the issue.

 

If you have an application that suffers from this problem, you can use the attached VI Analyzer test to help you inventory the enum constants in your codebase, and then detect when those values change after a typedef update. Follow these instructions to do so:

 

  1. Follow the instructions here to install and use this test. The attachment is saved in LabVIEW 2014.
  2. Ensure that all enum constants in your codebase are currently set to their proper values.
  3. Run the VI Analyzer test in 'Inventory' mode. It will save a data file that includes information about all enum constants and their values. 
    inventory.png
  4. At some point you will make a change to an enum typedef that requires you to check the code to see if any enum constants changed as a result. When this happens, run the VI Analyzer test again, but this time in 'Inspect' mode, pointing to the data file you created in step 3:
    inspect.png
  5. View the failures returned by the VI Analyzer (if any) to see if any of the enum values were erroneously changed and need to be changed back to their original values.

Note: At this time, the test supports value change detection of enum constants that are owned by diagrams and cluster constants. It does not detect value changes of enum constants that are owned by array constants.

Contributors