Main Content

sltest.xil.testbench.createMAPortConfigFile

Create configuration file for XIL model access port

Since R2024b

Description

sltest.xil.testbench.createMAPortConfigFile(xmlFile,modelFile) generates an XML file that configures the model access port for the Simulink® model, modelFile.

example

sltest.xil.testbench.createMAPortConfigFile(___,Name=Value) specifies options using one or more name-value arguments in addition to the input arguments in previous syntaxes.

example

Examples

collapse all

This example shows how to generate an XML file named config that configures a model access port for the Simulink model myModel.

sltest.xil.testbench.createMAPortConfigFile("config.xml", ...
                "myModel")

This examples shows how to create a Framework object, generate a configuration file with model access port state checking disabled, and initialize the framework.

import sltest.xil.framework.*;
portConfigFileName = fullfile(pwd,'ConfigurationFileExample.xml');
sltest.xil.testbench.createMAPortConfigFile(portConfigFileName, ...
                "myModel",CheckMAPortState=false)
frm = Framework;

frm.Configuration.addModelAccessPort(...
'aPort', ...
'asamxil.v2_1', ...
'VendorName','MathWorks',...
'ProductName','Simulation Server XIL API',...
'ProductVersion','1.0.0.0',...
'PortConfigFile',portConfigFileName);

Input Arguments

collapse all

Name of the XML configuration file, specified as a string scalar or character vector.

Data Types: string | char

Name of the model file, specified as a string scalar or character vector.

Data Types: string | char

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: CheckMAPortStates=true

Path of the model file, specified as a string scalar or character vector.

Data Types: string | char

Whether to enable model access port state checking, specified as a logical true or false.

Example: CheckMAPortStates=true

Data Types: logical

Maximum number of logged data points, specified as a positive integer.

Example: MaxLoggedDataPoints='1000'

Data Types: string | char

Option to slow simulation, specified as "off" or "on". For more information, see Enable pacing to slow down simulation.

Example: EnablePacing="on"

Data Types: string | char

Ratio of simulation time to wall clock time, specified as a positive scalar number. For more information, see Simulation time per wall clock second.

Example: PacingRate='2'

Data Types: string | char

Version History

Introduced in R2024b