Technical data
Loop Rolling
3-45
The outputs function for the Gain block is:
%% Function: Outputs ===========================================
%% Abstract:
%% Y = U * K
%%
%function Outputs(block, system) Output
/* %<Type> Block: %<Name> */
%assign rollVars = ["U", "Y", "P"]
%roll sigIdx = RollRegions, lcv = RollThreshold, block,...
"Roller", rollVars
%assign y = LibBlockOutputSignal(0, "", lcv, sigIdx)
%assign u = LibBlockInputSignal(0, "", lcv, sigIdx)
%assign k = LibBlockParameter(Gain, "", lcv, sigIdx)
%<y> = %<u> * %<k>;
%endroll
%endfunction
The generated code will roll depending on the block’s RollRegion (specified in
the RTW file) and
RollThreshold (specified at the command line). If there are
any regions in
RollRegion that are greater than the value specified by
RollThreshold, then those regions will roll. However, any regions in
RollRegion that are less that the value specified by RollThreshold will be
expanded.