Class: Simulink.ProtectedModel.CallbackInfo
Package: Simulink.ProtectedModel
Get build information object for specified model
bldobj = getBuildInfoForModel(model)
bldobj = getBuildInfoForModel(model)
returns
a handle to an RTW.BuildInfo
object. This object
specifies the build toolchain and arguments. The model
name
must be in the list of model names in the SubModels
property
of the Simulink.ProtectedModel.CallbackInfo
object.
You can call this method only for code generation callbacks in response
to a 'Build'
event.
On the MATLAB® path, create a callback script, pm_callback.m
,
containing:
cbinfobj = Simulink.ProtectedModel.getCallbackInfo(... 'sldemo_mdlref_counter','Build','CODEGEN'); bldinfo = cbinfobj.getBuildInfoForModel(cbinfobj.ModelName); buildargs = getBuildArgs(bldinfo)
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, the build arguments are displayed.
rtwbuild('sldemo_mdlref_basic')