| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
A sim viewing device encapsulates processing and viewing of signals received from the target system in external mode. During simulation in external mode, the target system uploads the appropriate input values to the sim viewing device in the Simulink model. The sim viewing device then conditions the input signals as needed and renders the signals on the screen. A sim viewing device runs only on the host, generating no code in the target system and, therefore, allowing extra processing of displayed signals without burdening the generated code.
You can use your S-function as a sim viewing device in external mode if it satisfies the following conditions.
The S-function has no output ports.
The S-function contains no states.
The generated code does not require the conditioned signals produced by the S-function.
To specify a C MEX S-function is a sim viewing device, set the SS_OPTION_SIM_VIEWING_DEVICE option in the mdlInitializeSizes function. For example
ssSetOptions(S, SS_OPTION_SIM_VIEWING_DEVICE);
To specify a Level-2 M-file S-function is a sim viewing device, call the run-time object's SetSimViewingDevice method in the S-function's setup callback method.
External mode compatible S-functions are selected, and the trigger is armed, by using the External Signal & Triggering dialog box. For more information see Communicating With Code Executing on a Target System Using Simulink External Mode in the Real-Time Workshop documentation.
![]() | Function-Call Subsystems | Frame-Based Signals | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |