Main Content

Debug an Application for Deployment

This topic provides high-level tips on debugging the standalone applications. The following lists highlight the solutions and tips for most frequently encountered errors.

Debug Application in Simulink

Use the following tips while preparing the standalone application to be deployed:

  • To ensure that the model runs successfully in rapid accelerator mode correctly, run the rapid accelerator target in a writable directory.

  • While writing the script, ensure that the sim command uses the Simulink.SimulationInput object as the input.

  • If you see the error "Unable to resolve the name Simulink.SimulationInput", check that the model is on the path.

  • If the dependent files are located in another directory, attach them by using the flag -a. For example, mcc -m scriptName.m -a myDataFile.dat.

  • If you are using a function as string, either:

    – Add a function pragma %#function.

    set(gca, 'ButtonDownFcn', 'foo'); % function foo is a string here.
    %#function foo 
    set(gca, 'ButtonDownFcn', 'foo'); % function foo is a string here.

    – Write it as an anonymous function

    set(gca, 'ButtonDownFcn', @foo);

Debug Application

  • Callback functions in the model might include functions that are not deployable. Ensure that the functions in the callbacks of the model are deployable.

  • Callback functions are not invoked at runtime. Ensure that the deployed simulation application does not use callback functions that are required to be invoked at runtime.

Related Topics