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
Add-On Required
This class requires that you Install and Set Up the Simulink Test Support Package for ASAM XIL Standard.
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:
sltest.xil.framework.FrameworkConfiguration
— Configure test bench ports and test variable mapping.sltest.xil.framework.TestVariable
— Read and write variables mapped to test bench.sltest.xil.framework.Acquisition
— Control signal data logging on test bench and retrieve logged data.sltest.xil.framework.Stimulation
— Control external input to test bench.
The sltest.xil.framework.Framework
class is a handle
class.
Creation
Description
frm = sltest.xil.framework.Framework
creates a
Framework
object.
Properties
Configuration
— Framework configuration
FrameworkConfiguration
object
Framework configuration, specified as a sltest.xil.framework.FrameworkConfiguration
object.
Attributes:
GetAccess | public |
SetAccess | protected |
Acquisition
— Control and retrieve logged data
Acquisition
object
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 |
Stimulation
— Control external input
Stimulation
object
Control external input to the test bench, specified as a sltest.xil.framework.Stimulation
object.
Attributes:
GetAccess | public |
SetAccess | protected |
Methods
Public Methods
|
Creates and connects to the
configured test benches. You must use |
|
Start the simulation and other testing processes. Calling
|
|
Stop the simulation and other testing processes. To control when the
ports stop, specify the order when adding and configuring the ports (see the
|
|
Shuts down simulations and releases all resources allocated by the framework. |
|
Creates a Input
Output
|
|
Loads an ASAM XIL Framework configuration file into the configuration for the framework. Input
|
|
Waits for the
simulation to complete. Optionally, specify the Output
|
|
Pushes the logged test case data to the Test Manager as a
Inputs
|
|
Displays the available ASAM XIL test benches. Use this method before or after creating ports or configurations. |
|
Displays all the test bench
variables for all ports. Before you can use the
|
|
Displays the test bench
task names for all ports. A task is the rate at
which data logging occurs for a test variable. Before you can use the
|
getAvailableTestbenches |
Returns the available ASAM XIL test benches of the specified type. You can use this method before creating ports or configurations. Input
Output
|
|
Returns the test bench
variable names for the specified port. Before you can display the variable names,
configure your test bench by adding ports, and then call the Input
Output
|
|
Returns
the test bench task names for the specified port. A task is the rate at which data
logging occurs for a test variable. Before you can use the
Input
Output
|
|
Returns
information about the tasks for a given port. A task is the rate at which data
logging occurs for a test variable. Before you can use the
Input
Output
|
Examples
Display All Test Bench Variables and Tasks
This example shows how to:
Create a
Framework
objectConfigure 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 Create and Run Tests Using the 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;
Retrieve and Plot Logged Simulation Data
This example shows how to:
Create a
Framework
objectConfigure a model access port
Map the
Signal
test variable to theModel/Integ1/Output1
test bench variableInitialize the framework
Create an instance of the
Signal
variableSet 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 Create and Run Tests Using the 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
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)