Contenido principal

sltest.xil.framework.Acquisition Class

Namespace: sltest.xil.framework

Control signal data logging on test bench and retrieve logged data

Since R2022a

Description

Add-On Required: This feature requires the Simulink Test Support Package for ASAM XIL Standard add-on.

Use the sltest.xil.framework.Acquisition class to set up variables on the test bench to log data, control data acquisition, and retrieve the acquired logged data.

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

Creation

You cannot create an sltest.xil.framework.Acquisition object. An Acquisition object exists only as a member of an sltest.xil.framework.Framework object. Create a Framework object first, and then use the Acquisition methods from within that Framework object.

Methods

expand all

Examples

collapse all

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

frm.Configuration.addModelAccessPort(...
    'MAPort1','asamxil.v2_1',...
    VendorName='ABC Co.',...
    ProductName='ABC Test Bench',...
    ProductVersion='1.7',...
    PortConfigFile=fullfile(pwd,'myConfigFile.xml'));

frm.Configuration.addTestVariableMapping(...
    'RPM','MAPort1','simpleXIL/Gain:1'...
    'TaskName','SubRate1');
frm.Configuration.addTestVariableMapping(...
    'Throttle','MAPort1','simpleXIL/Gain/Gain');

frm.init;

rpm = frm.createVariable('RPM');
throttle = frm.createVariable('Throttle');

frm.Acquisition.setupWithVariables([throttle,rpm]);
frm.Acquisition.start;

frm.start;

To change the above example to use triggering, change the setupWithVariables method to specify the trigger variable, the start and stop trigger types, and start and stop trigger values.

frm.Acquisition.setupWithVariables([throttle,rpm],...
   TriggerVariables=rpm,...
   StartTriggerType='condition',StartTriggerVal='rpm > 500',...
   StopTriggerType='duration',StopTriggerVal=3);

Version History

Introduced in R2022a