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
target
namespace or anrtw.connectivity.Config
subclass with thertiostream
API—see Set Up PIL Connectivity by Using Target Framework or PIL Execution of Code Generated for a Kalman Estimator.Create a
coder.EmbeddedCodeConfig
object.Configure the object for PIL.
Use the
codegen
function to generate library code for your MATLAB® function and the PIL interface.Use the
coder.runTest
function 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.m
plot_trajectory.m
— File that plots actual target trajectory and Kalman estimator outputposition.mat
— Input data
PIL Execution of Code Generated for a Kalman Estimator
Related Examples
- Generate C Code by Using the MATLAB Coder App
- Processor-in-the-Loop Execution with the MATLAB Coder App
- Use rtiostream API for PIL Target Connectivity
- Generate Execution Time Profile
- Generate Stack Usage Profile