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:

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.

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.

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.

To trace a tag back to the generating block:

  1. Open the source model.
  2. Close any other model windows that are open.
  3. Use the MATLAB hilite_system command to view the desired system and block.

As an example, consider the model foo mentioned above. If foo is open,

opens the subsystem Outer and

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