From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying a typedefed ENUM causes all classes to load with default ENUM value

Solved!
Go to solution

I have a project that I am working on that uses LV Classes. The class is a test structure and contains other classes and an enum (which is typedefed). When I create a test and save it using a binary write I am able to do a binary read and everything works just great.

 

However, if I modify the ENUM the class version is bumped up, and when I load a previously saved test the enum vale is set to the default. The behavior I was expecting was for the previously saved value to map to the new name.

 

Is this a bug, or is this the correct behavior.  I know that when a new control is added to a class, and an old version is read in, that LV will assign the default value to that new control when reading in the file. Does modifying a typedefed ENUM cause LV to think that I have inserted a new control into the class?

 

I was able to reproduce this behavior using a simple class containing a typedefed ENUM and a couple of numeric.  For good measure I also tried just saving the typedef to a binary file and reading it back in.  It appears to take the value that was saved and map it to the same value even if the name changed, which is what I would expect for a binary file.

 

Any help would be appreciated.

 

Thank you

 

  -Ben

0 Kudos
Message 1 of 3
(2,084 Views)

I forgot to mention that I am using LV 2010

0 Kudos
Message 2 of 3
(2,074 Views)
Solution
Accepted by topic author Bun

Hi Ben,

 

I've found another thread with community members discussing what sounds to me to be the behavior you are describing. It is located here: http://forums.ni.com/t5/LabVIEW/Mutation-History-of-Enums/td-p/1230773/highlight/true

 

Would one of the workarounds they mention work for your application, or could you post an example that demonstrates the behavior?

 

Regards,

Luke B.

Message 3 of 3
(2,043 Views)