MATLAB: Does the xPC Target Scope not display the output of a Constant block in xPC Target 4.0 (R2008b)

Simulink Real-Time

I am sending out a constant value to an analog out (D/A) (along with other unrelated signals) and routing them to a numerical target scope so that I can monitor them as the model runs. If I connect the constant block to the scope, it will not display on the scope. However, if I run it through a gain of 1 (not changing the constant value), then it will display on the scope.

Best Answer

You are seeing this issue because of a built-in optimization in Real-Time Workshop that is eliminating the output signal of the constant block since it is redundant with the constant parameter. To work around this issue, you will need to designate the signal as a test point so that it will be displayed in the Target Scope.
To designate a signal as a test point, right click on the signal line and select "Signal Properties...", and then check the "Test point" box.