Technical data
LibDefineRWork
4
-32
LibDefineRWork
Purpose
Call this function from inside the block’s
BlockInstanceSetup
function to
define the specified
rwork
definition in the block.
Syntax
%<LibDefineRWork(block, name, width)>
Arguments
block
Reference to the block record.
name
String that you want to call the
rwork
.
width
Integer width of this
rwork
.
Description
This call should be made from inside the block’s
BlockInstanceSetup
function,
and adds the specified
rwork
definition to the block. The function creates and
maintains an internal record for the
rwork
definition, removing the Simulink
definition if necessary.
%<LibDefineRWork(block, "PrevT", 1)>
%<LibDefineRWork(block, "PrevU", 3)>
Internally this creates a block record
NumRWorkDefines 2
RWorkDefine {
Name "PrevT"
Width 1
}
RWorkDefine {
Name "PrevU"
Width 3
}
PrevT RWorkDefine[0]
PrevU RWorkDefine[1]
Note that
PrevT
and
PrevU
are references to
RWorkDefine[0]
and
RWorkDefine[1]
, respectively, and are added by the system file, which executes
the block’s
BlockInstanceSetup
function.