Technical data

3
Writing Target Language Files
3-26
LibBlockRWork(rworkRef, ucv, lcv, sigIdx)
LibBlockIWork(iworkRef, ucv, lcv, sigIdx)
LibBlockPWork(pworkRef, ucv, lcv, sigIdx)
The behavior of these functions is similar to LibBlockOutputSignal, except
they return the appropriate reference to the block’s
RWork, IWork, and PWork.
The additional arguments,
rworkRef, iworkRef, and pworkRef, are references
to the block internal records
RWorkDefine, IWorkDefine, and PWorkDefine,
respectively. For an example of
LibBlockRWork and LibBlockIWork, see
sin_wave.tlc. For an example of LibBlockPWork, see towks.tlc.
If the block records
RWorkDefine, IWorkDefine, and PWorkDefine are not
defined, then the reference to the work records is replaced with a reference to
the block’s vector identifier,
RWork, IWork, and PWork, respectively.
LibPrevZCState(ucv, lcv, sigIdx)
The behavior of this function is similar to LibBlockOutputSignal, except it
returns the appropriate reference to a block’s previous zero-crossing state. For
an example, see
subsystm.tlc.
LibDataStoreMemory(ucv, lcv, varIdx)
The behavior of this function is similar to LibBlockOutputSignal, except it
returns the appropriate reference to a block’s data store memory element. For
an example, see
dsread.tlc.
LibPathName(name)
Given a block or system name, this function returns the full path. For example,
LibPathName("<s5>/foo") may return root_foosystem_fooblock, meaning
that the block’s name is derived from a block named
fooblock residing in a
subsystem block named
foosystem, residing in the root model. For an example
of this function, see
mdlbody.tlc.
LibIsFinite(value)
Given a TLC variable, this function returns 0 if the value of the variable is
rtInf, rtMinusInf, or rtNaN. For an example of this function, see
mdlparam.tlc.