Documentation

Set External Mode Scope Parameters

Simulink® normal and accelerator modes run the simulation algorithm in Simulink and access the external hardware by using drivers running in operating system kernel mode. The Simulink block diagram is a user interface to your real-time application.

Simulink external mode connects your Simulink model to your real-time application. You can use the Simulink block diagram as a user interface as you can in normal or accelerator mode.

This procedure uses the model sldrtex_model (matlab: open_system(docpath(fullfile(docroot, 'toolbox', 'sldrt', 'examples', 'sldrtex_model')))). It assumes that you have already loaded that model.

After you have created a real-time application, you can enter scope parameters for signal tracing with Simulink external mode:

  1. In the Simulation window, from the Simulation menu, click Model Configuration Parameters.

  2. Select the Code Generation > Simulink Desktop Real-Time node.

  3. If you select the External mode check box, your changes affect the real-time application.

    Check that the MEX-file name label has an entry of sldrtext. The MEX-file sldrtext.mex* is supplied with the Simulink Desktop Real-Time™ software. This file works with Simulink external mode and supports uploading signal data and downloading parameter values.

    Click OK.

  4. In the Simulation window, click Code > External Mode Control Panel.

    Click the Signal & Triggering button.

  5. Select the Select all check box. From the Source list, select manual. From the Mode list, select normal.

    The X under Signal selection indicates that a signal is tagged for data collection. T indicates that the signal is tagged as a trigger signal.

  6. In the Duration field, enter the number of sample points in a data buffer. For example, to specify a sample rate of 1000 samples/second and a stop time of 10 seconds, enter:

    10000
    
  7. Select the Arm when connecting to target check box.

    If you do not select this check box, data is not displayed in the Scope window.

  8. Click Close.

Was this topic helpful?