I have created a masked subsystem which has three fields:
- Edit field to choose data dictionary name. Based on this selection, the masked block reads the dictionary and finds out all the enumerations present in the dictionary.
- First Popup to list all Enumerations found in data dictionary [Populates Based on callback added in Edit field] and make selection as per User Click. (Variable name --> enum_datatype)
- Second Popup to create list of values based on Enum Selection made in First Popup [Populates Based on callback added in First Popup]. (Variable name --> enum_params)
First Popup is then used to write Output Datatype of a Constant block and its Value (of constant block) is written from Second Popup.
This is working fine and masked subsystem is able to update underlying Constant block as per selections done. I have made it a custom library for my model and using it at many places then.
However while saving custom library, First Popup variable (enum_datatype) still holds its values but Second Popup variable (enum_params) resets itself. Due to this in model, wherever this block is used, second variable (enum_params) in all of them gets reset. This happens also while compiling the model.
I have tried debugging the Mask initialization code and variable is resetted even before Mask Initialization has been called. I have also tried checking all attributes and they all are set to "Evaluate, Tunable, Enable and Visible". Remaining attributes like "Read Only, Hidden and Never Save" are not ticked.
Please help me on getting solution for this! I am not sure what is resetting it.
Thanks in advance.