Simulink.ProtectedModel.getCallbackInfo
Get Simulink.ProtectedModel.CallbackInfo object
for use by callbacks
Description
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. 
Examples
Use Protected Model Information in Code Generation Callback
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.
openExample('sldemo_mdlref_basic'); 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.
slbuild('sldemo_mdlref_basic')Input Arguments
Output Arguments
Version History
Introduced in R2016a