Real-Time Workshop    

Signal Viewing Subsystems

A Signal Viewing Subsystem is an atomic subsystem that encapsulates processing and viewing of signals received from the target system. A Signal Viewing Subsystem runs only on the host, generating no code in the target system. Signal Viewing Subsystems run in all simulation modes -- normal, accelerated, and external.

Signal Viewing Subsystems are useful in situations where you want to process or condition signals before viewing or logging them, but you do not want to perform these tasks on the target system. By using a Signal Viewing Subsystem, you can generate smaller and more efficient code on the target system.

Like other external mode compatible blocks, Signal Viewing Subsystems are displayed in the External Signal and Triggering dialog box.

To declare a subsystem to be a Signal Viewing Subsystem:

  1. Select the Treat as atomic unit option in the Block Parameters dialog box.
  1. Use the following set_param command to turn the SimViewingDevice property on.
  1. where 'blockname' is the name of the subsystem.

  1. Make sure the subsystem meets the following requirements:

The model shown below, sink_examp, contains an atomic subsystem, theSink.

The subsystem theSink, shown below, applies a gain and an offset to its input signal, and displays it on a Scope block.

If theSink is declared as a Signal Viewing Subsystem, the generated target program includes only the code for the Sine Wave block. If theSink is selected and armed in the External Signal and Triggering dialog box (as shown in Figure 6-10), the target program uploads the sine wave signal to theSink during simulation.You can then modify the parameters of the blocks within theSink and observe their effect upon the uploaded signal.

Figure 6-10: Signal Viewing Subsystem Selected in External
Signals & Triggering Dialog Box

Note that if theSink were not declared as a Signal Viewing Subsystem, its Gain, Constant, and Sum blocks would run as subsystem code on the target system. The Sine Wave signal would be uploaded to Simulink after being processed by these blocks, and viewed on sink_examp/theSink/Scope2. Processing demands on the target system would be increased by the additional signal processing, and by the downloading of block parameter changes from the host.


  External Mode Compatible Blocks and Subsystems External Mode Communications Overview