MATLAB: Am I unable to set the ‘SimulinkGlobal’ flag of the ‘RTWInfo.StorageClass’ parameter manually in Real-Time Workshop 7.2 (R2008b)

simulink coder

The following sl_signalobj_tstpt_ex model yields the following error when it is run:
The selected signal originating from port 1 of 'sl_signalobj_tstpt_ex/Chirp Signal/Output' cannot be displayed due to block reduction optimization. You can:
1) disable 'Block reduction' on the Optimization page of the Configuration Parameters Dialog to access this and all other eliminated signals using floating scopes and displays,
2) configure this signal as SimulinkGlobal (Test Point) from the Signal properties dialog, or
3) create a Simulink signal object matching the signal label with its RTWInfo.StorageClass attribute set as 'SimulinkGlobal'.
I am able to use options 1 and 2 to make the error go away. However, I cannot get option 3 to work. Naming the signal in question 's', and executing the following code at the MATLAB prompt:
s = Simulink.Signal;
s.RTWInfo.StorageClass = 'SimulinkGlobal';
will still cause the error message to appear the first time the model is run.

Best Answer

There are two issues present:
1. First, the model configuration sets Signal Resolution to "Explicit only" but the "Signal name must resolve to Simulink signal object" attribute of signal s is unchecked. This means, the Simulink.Signal object s is not used at all.
2. For s to be used, it has to be defined in the MATLAB workspace, not the model workspace because Simulink.Signal object defined in a model workspace must have its RTWStorageClass set to 'Auto'.
The attached sst model has these issues corrected, and the model runs without the error message.