dSPACE Support : Generating TRC Files

Generating TRC Files

The TRC file defines the variables that can be read to or written from the hardware by the dSPACE ControlDesk at run time. The variables that are visible to the host are those defined in the C code as global variables. (In the Rational Statemate generated code, all the model elements are actually global variables.)

The variables are arranged in the TRC file in a hierarchy (groups) according to the model charts’ hierarchy. This arrangement enables you to easily navigate in the ControlDesk variables browser.

TRC file generation is enabled when the corresponding field in the target file (.rtrg) is set to yes, as follows:

#Generate dSPACE TRC file:yes

For ease of use, the TRC file has a separate group for each chart. All the defined variables in a chart are part of the same group in the TRC file.

In the Rational Statemate generated code, some variables are named differently from the model name in order to solve a uniqueness problem. For those variables, the entry in the TRC file is the Rational Statemate model name (defined as an alias to the “code name”).