Accessing Model Reference block InstanceParameters dialog data during load workspace

2 views (last 30 days)
I am using Model Reference blocks to include several instances of Model_B within Model_A. Model_B has one parameter and each Model Reference block is configured with a unique InstanceParameter.Value string, so each instance of Model_B gets unique parameter data.
My top level Model_A has its Model Workspace source set to "MATLAB Code" and I use a script to perform a number of setup tasks. Up through MATLAB/Simulink R2017a I could fetch the parameter argument string with the following code during load workspace:
s = get_param('ModelA/MdlRefBlkName','ParameterArgumentValuesAsString')
My issues is that on recent versions (now R2020b) I cannot access this dialog parameter value from my Model_A load workspace script.
All of the following return empty results
s = get_param('ModelA/MdlRefBlkName','ParameterArgumentValuesAsString')
x = get_param('ModelA/MdlRefBlkName','ParameterArgumentValues')
y = get_param('ModelA/MdlRefBlkName','InstanceParameters')
After the model is loaded, I can excute the three commands shown above in the command window without issue. I can also still fetch dialog parameters from the ModelRegerence block and other blocks as well from my script. E.g. both of the following work fine in the load workspace script as well as from the comand window.
s = get_param('ModelA/MdlRefBlkName','ModelName'))
s = get_param('ModelA/Gain','Gain')
Why is the parameters string (the string entered in the Model Reference dalog box) not accessable via the commands above during Model_A load workspace? Is there any other method to access this data during load workspace, or is this functionality lost in recent versions of Matlab/Simulink?

Answers (0)

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!