Compiling Embedded C Code : Compiling Generated Code : Trace Facility

Trace Facility

If some variables (states, data items, conditions, or activities) are selected to be traced, the trace task is created automatically when generated code executes. This trace task uses the Remote Server to output the trace message data into the <profile name>.trc file, located in the target output directory. Its reporting mechanism is the same as that used for the Remote Panel feature. The basic mechanism allows the trace message data to be sent to the trace buffer, whose length is user-definable in the dialog called by the Options > Trace Settings menu item.

You can also define the format of the trace in this dialog. The format information is written into the .trc file.

If you select the User Supplied function name, every time the variable value is changed, this function is called instead of the standard trace function normally supplied by the libintrinsics library.