Main Content

Prepare Real-Time Application by Using MATLAB Language

You can configure your real-time application by using the MATLAB® language, and then build and download it to the target computer. This example uses model slrt_ex_osc_rt. To open the example model, in the MATLAB Command Window, type:

openExample('slrealtime/SlrtCreateAndRunRealTimeAppFromSimulinkModelExample', ...
  1. Create a Target object that represents the target computer and connect Simulink Real-Time Explorer to the target computer:

    tg = slrealtime('TargetPC1');
  2. Open the model:

    model_name = 'slrt_ex_osc_rt';
  3. Set the start and stop time parameters:

  4. Build the model:

  5. (Optional) Generate the ASAP2 file with required version using the Generate Calibration Files tool and customize the ASAP2 file as needed. For more information about generating and customizing the ASAP2 file, see Generate ASAP2 and CDF Calibration Files.

  6. (Optional) Use updateASAP2 function to pack the ASAP2 file to the application object (.mldatx):


  7. Load the real-time application onto the target computer:


See Also


Related Topics