Configure Scope Sampling with Simulink Real-Time Explorer

You can customize sampling for Simulink® Real-Time™ scopes to facilitate data access to the running model. You can configure sampling whether you added a Scope block to the model or added the scope at run time.

This procedure uses the model xpcosc. You must have already completed the procedure in Create Target Scopes with Simulink Real-Time Explorer. Target execution and scopes must be stopped.

  1. Select Scope 1 and open the Properties pane ( on the Scopes toolbar).

  2. In the Scope 1 properties pane, click Sampling.

  3. In the Number of Samples box, enter the number of values to be acquired in a data package, here 250.

    If you select a Display mode of Graphical redraw, the display redraws the graph every Number of Samples.

    If you select a Display mode of Numerical, the block updates the output every Number of Samples.

    If you select a Trigger Mode other than FreeRun, this parameter can specify the number of samples to be acquired before the next trigger event.

  4. In the Decimation box, enter 10 to indicate that data must be collected at every 10th sample time. The default is 1, to collect data at every sample time.

  5. In the Number of pre/post samples box, enter the number of samples to save or skip. To save N samples before a trigger event, specify the value −N. To skip N samples after a trigger event, specify the value N. The default is 0.

    The dialog box looks like this figure.

  6. Start execution ( on the Applications toolbar).

  7. Start Scope 1 ( on the toolbar).

    Output for signals Signal Generator and Integrator1 appears on the target computer monitor.

  8. Stop Scope 1 ( on the toolbar).

  9. Stop execution ( on the Applications toolbar).

Related Topics