Processor-in-the-Loop Execution from Command Line
Use processor-in-the-loop (PIL) execution to verify code that you intend to deploy in production.
To set up and start a PIL execution from the command line:
Create, register, and verify your target connectivity configuration. You can set up target connectivity by using the
targetnamespace or anrtw.connectivity.Configsubclass with thertiostreamAPI—see Set Up PIL Connectivity by Using Target Framework or PIL Execution of Code Generated for a Kalman Estimator.Create a
coder.EmbeddedCodeConfigobject.Configure the object for PIL.
Use the
codegenfunction to generate library code for your MATLAB® function and the PIL interface.Use the
coder.runTestfunction to run the test file for your original MATLAB function.
To terminate the PIL execution, use the clear or function_pilclear
mex command.
The following example shows how you can use line commands to set up and run a PIL execution on your development computer.
Tutorial Files: Kalman Filter
Open this example to obtain the files for this tutorial:
kalman01.m— MATLAB function for the Kalman estimatortest01_ui.m— MATLAB file to testkalman01.mplot_trajectory.m— File that plots actual target trajectory and Kalman estimator outputposition.mat— Input data
