Real-Time Workshop User's Guide | ![]() ![]() |
Tracing Generated Code Back to Your
Simulink Model
The Real-Time Workshop writes system/block identification tags in the generated code. The tags are designed to help you identify the block, in your source model, that generated a given line of code. Tags are located in comment lines above each line of generated code.
The tag format is <system>/block_name
, where:
system
is either:'root'
, orblock_name
is the name of the block.The following code fragment illustrates a tag comment adjacent to a line of code generated by a Gain block at the root level of the source model.
/* Gain Block: <Root>/Gain */ rtb_temp3 *= (rtP.root_Gain_Gain);
The following code fragment illustrates a tag comment adjacent to a line of code generated by a Gain block within a subsystem one level below the root level of the source model.
/* Gain Block: <S1>/Gain */ rtB.temp0 *= (rtP.s1_Gain_Gain);
In addition to the tags, the Real-Time Workshop documents the tags for each model in comments in the generated header file model
.h
. The following illustrates such a comment, generated from a source model, foo
. foo
has a subsystem Outer
with a nested subsystem Inner
.
/* Here is the system hierarchy for this model. * * <Root> : foo * <S1> : foo/Outer * <S2> : foo/Outer/Inner */
To trace a tag back to the generating block:
hilite_system
command to view the desired system and block.
As an example, consider the model foo
mentioned above. If foo
is open,
hilite_system
('<S1>')
hilite_system
('<S2>/Gain1')
opens the subsystem Outer
and selects and highlights the Gain block Gain1
within that subsystem.
![]() | Advanced Options Page | Other Interactions Between Simulink and the Real-Time Workshop | ![]() |