MATLAB: Are block callbacks not executed in protected models

blockcallbacksmodelprotectedsimulink

I have a protected model reference containing blocks with initialization callback functions.
I noticed that the callbacks of my blocks are not called when I run my model.
However, if I use a model reference(unprotected) in place of the protected model reference, the initialization callback runs fine.
How do I use block callbacks in protected model references?

Best Answer

I understand that your block initialization callback function is not being called when it is inside a protected model.
The way you register callbacks for a protected model is documented as follows:
If you want the protected model to execute any m-code during model initialization, you will need to specify that m-code in the protected model's PreAccess SIM callback.