Get Simulink.ProtectedModel.CallbackInfo
object
for use by callbacks
returns
a cbinfobj
= Simulink.ProtectedModel.getCallbackInfo(modelName
,event
,functionality
)Simulink.ProtectedModel.CallbackInfo
object
that provides information for protected model callbacks. The object
contains information about the protected model, including:
Model name.
List of models and submodels in the protected model container.
Callback event.
Callback functionality.
Code interface.
Current target. This information is available only for code generation callbacks.
On the MATLAB® path, create a callback script, pm_callback.m
,
containing:
s1 = 'Code interface is: '; cbinfobj = Simulink.ProtectedModel.getCallbackInfo(... 'sldemo_mdlref_counter','Build','CODEGEN'); disp([s1 cbinfobj.CodeInterface]);
When you create a protected model with a simulation callback, use the script.
pmCallback = Simulink.ProtectedModel.Callback('Build',... 'CODEGEN', 'pm_callback.m') Simulink.ModelReference.protect('sldemo_mdlref_counter',... 'Mode', 'CodeGeneration','Callbacks',{pmCallback})
Build the protected model. Before the start of the protected model build process, the code interface is displayed.
rtwbuild('sldemo_mdlref_basic')