Main Content

Add Instruments to Real-Time Application from Simulink Model

As an alternative to marking a signal in your model for logging, connecting a signal to a File Log block in the model, or selecting signals in a real-time application to stream in the Simulink Real-Time explorer, you can stream signal data to the Simulation Data Inspector by using bind mode in the Simulink Editor. You can select a signal for streaming in bind mode when the signal is:

  • Available in the model and in the real-time application that is built from the model.

  • Specified (not inherited) sample time.

  • Using globally accessible memory in the real-time application.

  • Not connect to a Send or , Message Send block.

Unlike marking signals for streaming or connecting signals to File Log blocks, the bind mode workflow lets you add instruments to the model and make these available in the real-time application without rebuilding the real-time application. You can export these instruments from the model or import them into the model.

To select signals for streaming to the Simulation Data Inspector by using bind mode in the Simulink Editor:

  1. Open the model.

  2. Connect the development computer to the target computer.

  3. To generate the real-time application, build the model.

  4. To put the model in bind mode, in the Simulink Editor, select Real-Time > Review Results > Add Instrument.

    While in bind mode, a link symbol appears with the cursor, and an exit icon appears in the upper-right corner of the model. When you are ready to exit bind mode, on the model canvas, click the exit icon. Image of bind mode exit icon

  5. To add an instrument for a signal, select a block and select the check box next to the signal.

    When you run the real-time application, the signals to which you have added an instrument are streamed to the Simulation Data Inspector. After you have added an instrument to the model, the label on the Add Instrument button changes to Configure Instrument.

  6. To re-enter bind mode and add or remove signals from the instrument, select Real-Time > Review Results > Configure Instrument.

  7. To remove the instrument added by using Add Instrument, select Real-Time > Review Results > Remove Instrument.

  8. To highlight all signals in the model with instruments, select Real-Time > Review Results > Highlight Instrument.

  9. To import or export instruments in the model with instruments, select Real-Time > Review Results > Import Instrument or select Real-Time > Review Results > Export Instrument.

  10. After making changes to instruments, to stream signals from the real-time application to the Simulation Data Inspector, deploy the real-time application to the target computer and start the application. For example, select Real-Time > Run on Target.

See Also


Related Examples

More About