Main Content

load

Deploy to target and load real-time application to target computer

Since R2020b

Description

load(target_object,app_name) deploys and loads the application app_name onto the Speedgoat® target computer represented by the target_object.

The load command checks whether Simulink® Real-Time™ software is connected to the RTOS on the target computer. If not connected, the load connects to the target computer before loading the real-time application.

You also can load the real-time application from the RTOS command line. For more information, see Execute Target Computer RTOS Commands at Target Computer Command Line and Target Computer Command-Line Interface.

If you are running the real-time application in standalone mode, instead of load, consider using the install function and the setStartupApp function. For more information about Simulink Real-Time modes, see Real-Time Application and Target Computer Modes.

example

Examples

collapse all

Load the real-time application slrt_ex_osc on the target computer TargetPC1, represented by target object tg. Start the application.

  1. Get the target object, and then build the real-time application.

    tg = slrealtime;
    mdlSTF = getSTFName(tg);
    mdlName = 'slrt_ex_osc';
    openExample(mdlName);
    set_param(mdlName,"SystemTargetFile",mdlSTF);
  2. Build the real-time application.

    slbuild(mdlName);
  3. Load the real-time application.

    load(tg,mdlName);
  4. If the real-time application MLDATX file is not located in your current folder, add path information to the load function. For example,

    appPath = fileparts(which('slrt_ex_osc.mldatx'));
    load(tg, [appPath '\' 'slrt_ex_osc']);
  5. Start the application.

    start(tg);

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

Provides name of real-time application MLDATX file that you built from the model.

Example: 'slrt_ex_osc'

Version History

Introduced in R2020b

expand all