MATLAB: Do I receive an error stating the BusObject is not in scope when I specify it a parameter to a masked Inport

busbusobjectininportmaskobjectscopesimulink

In the model maskedinport.mdl below, I specify the "Bus object for validating input bus" parameter for the Inport to be a BusObject in the MATLAB workspace and then mask the Inport. After opening the model, I receive the following error when I update the diagram using Ctrl+D:
Simulink.Datatype object 'myBus' is not in scope from 'maskedinport/In1'.
However, if I look under the mask and reenter the value myBus into this field, I no longer receive this error.

Best Answer

This bug has been fixed in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
We have verified that there is a bug in Simulink 6.0 (R14) in the way that the "Bus object for validating input bus" parameter is resolved for Inport blocks that are inside a mask.
To work around this issue, place a call to SET_PARAM that sets this parameter inside the LoadFcn callback. For example, in maskedinport.mdl, you would add the following line to the LoadFcn callback of the Inport block:
set_param(gcb,'BusObject',get_param(gcb,'BusObject'));