Main Content

sltest.xil.framework.Framework Class

Namespace: sltest.xil.framework

Initialize test bench, start and stop simulation, and display test bench, variable, and task

Since R2022a

Description

sltest.xil.framework.Framework is the class that enables using other objects of the Simulink® Test™ Support Package for ASAM® XIL Standard. You must create a Framework object to access other sltest.xil functionality:

The sltest.xil.framework.Framework class is a handle class.

Creation

Description

example

frm = sltest.xil.framework.Framework creates a Framework object.

Properties

expand all

Framework configuration, specified as a sltest.xil.framework.FrameworkConfiguration object.

Attributes:

GetAccess
public
SetAccess
protected

Control signal data logging on the test bench and retrieve logged data, specified as a sltest.xil.framework.Acquisition object.

Attributes:

GetAccess
public
SetAccess
protected

Control external input to the test bench, specified as a sltest.xil.framework.Stimulation object.

Attributes:

GetAccess
public
SetAccess
protected

Methods

expand all

Examples

collapse all

This example shows how to:

  • Create a Framework object

  • Configure a model access port

  • Initialize the framework

  • Display the test bench variables and their logging rate (Task) information.

Note

The configuration values in this example are placeholders. To set up the values for your test bench, see Real-Time Testing with the Simulink Test Support Package for ASAM XIL Standard.

import sltest.xil.framework.*;
frm = Framework;

frm.Configuration.addModelAccessPort(...
   'MAPort1', ...
   'asamxil.v2_1', ...
   'VendorName','ABC Co.', ...
   'ProductName','ABC Test Bench', ...
   'ProductVersion','2020_1', ...
   'PortConfigFile',fullfile(pwd,'myABC_MAPPortConfig.xml'));

frm.init;

frm.displayAllTestbenchVariables;
frm.displayAllTaskInfo;

This example shows how to:

  • Create a Framework object

  • Configure a model access port

  • Map the Signal test variable to the Model/Integ1/Output1 test bench variable

  • Initialize the framework

  • Create an instance of the Signal variable

  • Set up and start the acquisition, and start and stop the simulation

  • Fetch the result data and plot the results

Note

The configuration and variable mapping values in this example are placeholders. To set up the values for your test bench, see Real-Time Testing with the Simulink Test Support Package for ASAM XIL Standard.

import sltest.xil.framework.*;
frm = Framework;

frm.Configuration.addModelAccessPort(...
   'MAPort1', ...
   'asamxil.v2_1', ...
   'vendorName','ABC Co.', ...
   'productName','ABC Test Bench', ...
   'productVersion','2020_1', ...
   'portConfigFile',fullfile(pwd,'myABC_MAPPortConfig.xml'));

frm.Configuration.addTestVariableMapping(...
   'Signal','MAPort1','Model/Integ1/Output1');

frm.init;

signal = frm.createVariable('Signal');
frm.Acquisition.setupWithVariables(signal);
frm.Acquisition.start;
frm.start;
pause(2);
frm.stop;

result = frm.Acquisition.fetch;
hold on;
for i = 1:result.numElements
    plot(result{i}.Values.Time,result{i}.Values.Data);
end
hold off;

Version History

Introduced in R2022a