Prepare Real-Time Application by Using MATLAB Language

You can configure your real-time application by using the MATLAB® language and build and download it to the target computer. This example uses the ex_slrt_rt_osc (open_system(docpath(fullfile(docroot, 'toolbox', 'xpc', 'examples', 'ex_slrt_rt_osc')))). It assumes that the default target computer is configured for network boot mode and that communication has been established.

  1. Make sure that the connection to the target computer is functioning.

    slrtpingtarget
  2. Load the model.

    model_name = 'ex_slrt_rt_osc';
    open_system(model_name);
  3. Set the start and stop time parameters.

    set_param(model_name,'StartTime','0');
    set_param(model_name,'StopTime','10');
  4. Build the model, assign tg to the target computer, and download the model.

    rtwbuild(model_name);
    tg = slrt('TargetPC1');
    load(tg,model_name);
    pause(30);

Related Topics