Main Content

piltest

Verify custom target connectivity configuration for MATLAB PIL execution

Description

example

piltest(config) runs tests that verify your custom processor-in-the-loop (PIL) target connectivity configuration. In the tests, the function runs the MATLAB® function and performs PIL executions. The function compares results and produces errors if it detects differences. For PIL executions, the function extracts the TargetHWDeviceType and Toolchain settings from config.

In the current working folder, the function creates the piltest folder, which contains subfolders with test results.

piltest(config,'ConfigParams',additionalParameterList) extracts additional settings from config for the PIL execution.

piltest(config,'TestPoint',testName) runs the specified test.

Examples

collapse all

This example shows how you can use piltest to verify a target connectivity configuration for PIL execution.

Create a code generation configuration object for C/C++ static library generation.

cfg = coder.config('lib');

Create hardware configuration object, specify manufacturer and test hardware type, and assign handle to code generation object.

hwImpl = coder.HardwareImplementation;
hwImpl.TargetHWDeviceType = 'Atmel->AVR';
cfg.HardwareImplementation = hwImpl;

Specify the toolchain for code generation.

cfg.Toolchain = 'AVR tools for Arduino';   

Run the function.

piltest(cfg)

Input Arguments

collapse all

A configuration object that specifies code generation parameters.

Extract additional parameters from config for PIL execution.

  • 'verifyPILConfig' — For a given set of input values, the function:

    • Runs a MATLAB function on your development computer.

    • Performs PIL executions of generated MATLAB code on your target hardware with config.TargetLang set to 'C' and 'C++'.

    The function compares MATLAB function and PIL results. If the function detects differences, it produces an error.

  • 'all' — Run all tests.

Version History

Introduced in R2016b