Why do I receive an error when protecting a model reference block that contains an Embedded MATLAB block in its design in Simulink 7.6 (R2010b)? I am trying to create a protected model reference block using the following steps: Simulink.ModelReference.protect('model_name') %model_name is the name of the model After this step, Real-Time Workshop build procedure for model is aborted due to a CGIR assertion. I receive the following error message: CGIR assertion in b:\matlab\src\cg_ir\util_prim/Size64.hpp(93): 'fSize == (Uint64)i' ### Real-Time Workshop build procedure for model: 'PrimeMover4' aborted due to an error. ??? Error using ==> tlc_c at 160 Unexpected or internal error encountered in "in CGIR: b:\matlab\src\cg_ir\util_prim/Size64.hpp line 93: fSize == (Uint64)i ". Please report this to The MathWorks if you can cause it to recur.
Kshitij Singh answered .
2025-11-20
LINK : fatal error LNK1248: image size (8F11E000) exceeds maximum allowable size (80000000)
From the above error message it is inferred from the Microsoft Viual Studio documentation that it is not possible to have more than a total of 80MB of persistent variable assignment.
For example an assignment of type:
persistent p;
if(~isempty(p))
{
p = 0;
}
p = single(zeros(1,200000000));