User`s guide
3 Working with Real-Time Workshop
3-34
example_P.SineWave_Phase) + example_P.SineWave_Bias;
example_B.gain_out = example_B.sin_out * example_P.Gain_Gain;
example_Y.Out1 = example_B.gain_out;
}
7 In GRT targets such as this, the function example_output is called by a
wrapper function,
MdlOutputs. In example.c, find the function MdlOutputs
near the end. It looks like this:
void MdlOutputs(int_T tid) {
example_output(tid);
}
Note In previous releases, MdlOutputs was the actual output function for
code generated by all GRT-configured models. It is now implemented as a
wrapper function to provide greater compatibility among different target
configurations.
In the steps below, you turn buffer optimizations on and observe how these
optimizations improve the code.
Generating Code with Buffer Optimization
Enable signal buffer optimizations and regenerate the code as follows:
1 Click the Optimization tab of the Configuration Parameters dialog.
Select the
Signal storage reuse option.
2 Note that three controls become enabled in the Code generation section
below the check box,
Enable local block outputs, Reuse block outputs
and
Eliminate superfluous temporary variables (Expression folding).
Make sure that the first two options are selected, and
Eliminate
superfluous temporary variables (Expression folding)
is not selected,
as shown below.