Target Language Compiler | ![]() ![]() |
Block Path and Error Reporting Functions
LibBlockReportError(block,errorstring)
This should be used when reporting errors for a block. This function is designed to be used from block target files (e.g., the TLC file for an inlined S-function).
This function can be called with or without the block record scoped. To call this function without a block record scoped, pass the block record. To call this function when the block is scoped, pass block = []
. Specifically
LibBlockReportError([],"error string")--If block is scoped LibBlockReportError(blockrecord,"error string")--If block record is available
See function in matlabroot
/rtw/c/tlc/lib/utillib.tlc
.
LibBlockReportFatalError(block,errorstring)
This should be used when reporting fatal (assert) errors for a block. Use this function for defensive programming. Refer to TLC Error Handling.
See function in matlabroot
/rtw/c/tlc/lib/utillib.tlc
.
LibBlockReportWarning(block,warnstring)
This should be used when reporting warnings for a block. This function is designed to be used from block target files (e.g., the TLC file for an inlined S-function).
This function can be called with or without the block record scoped. To call this function without a block record scoped, pass the block record. To call this function when the block is scoped, pass block = []
.
LibBlockReportWarning([],"warn string")--If block is scoped LibBlockReportWarning(blockrecord,"warn string")--If block record is available
See function in matlabroot
/rtw/c/tlc/lib/utillib.tlc
.
LibGetBlockPath(block)
LibGetBlockPath
returns the full block path name string for a block record, including carriage returns and other special characters that may be present in the name. Currently, the only other special string sequences defined are '/*'
and '*/'
.
The full block path name string is useful when accessing blocks from MATLAB. For example, you can use the full block name with hilite_system()
via FEVAL
to match the Simulink path name exactly.
Use LibGetFormattedBlockPath
to get a block path suitable for placing in a comment or error message.
See function in matlabroot
/rtw/c/tlc/lib/utillib.tlc
.
LibGetFormattedBlockPath(block)
LibGetFormattedBlockPath
returns the full path name string of a block without any special characters. The string returned from this function is suitable for placing the block name, in comments or generated code, on a single line.
Currently, the special characters are carriage returns, '/*'
, and '*/'
. A carriage return is converted to a space, '/*'
is converted to '/+'
, and '*/'
is converted to '+/'
. Note that a '/'
in the name is automatically converted to a '//'
to distinguish it from a path separator.
Use LibGetBlockPath
to get the block path needed by MATLAB functions used in reference blocks in your model.
See function in matlabroot
/rtw/c/tlc/lib/utillib.tlc
.
![]() | Block State and Work Vector Functions | Code Configuration Functions | ![]() |