Main Content

extractASAP2

Extract generated A2L file from real-time application file

Since R2020b

Description

extractASAP2(app_object) retrieves an A2L file from a real-time application file and save the file in the working folder. The A2L file can only be extracted if it was previously packaged into the real-time application MLDATX file using updateASAP2 method.

example

extractASAP2(app_object,Name,Value) specifies additional options to retrieve an A2L file by using one or more Name, Value pair arguments. For example, you can specify a location for saving the A2L file. You can provide the target IP address to update it in A2L file before saving it.

example

Examples

collapse all

Retrieve the A2L file from real-time application.

% build mymodel, generate the a2l file, and copy it into the current folder
slbuild('mymodel');
coder.asap2.export('mymodel','MapFile','mymodel_slrealtime_rtw/mymodel','Comments',false);
copyfile(fullfile(pwd,'/mymodel_slrealtime_rtw/mymodel.a2l'));

% replace the a2l file in the application
app_obj = slrealtime.Application('mymodel.mldatx')
updateASAP2(app_obj,'mymodel.a2l')

% extract a2l file from mymodel application file
extractASAP2(app_obj)

Retrieve the A2L file from real-time application and then save the A2L file with the custom name specified.

% save extracted a2l file with custom name
app_obj = slrealtime.Application('mymodel.mldatx')
extractASAP2(app_obj,'FileName','MyApp')

Retrieve the A2L file from real-time application and then save the A2L file in the specified location.

% save extracted a2l file in custom location
app_obj = slrealtime.Application('mymodel.mldatx')
myFolder = fullfile(userpath,'temp')
extractASAP2(app_obj,'Folder',myFolder)

Retrieve the A2L file from real-time application and update the target IP Address.

% save extracted a2l file by updating IP Address
app_obj = slrealtime.Application('mymodel.mldatx')
extractASAP2(app_obj,'TargetIPAddress','192.168.1.1')

Input Arguments

collapse all

Provides access to methods that manipulate the real-time application files.

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'FileName', 'CustomName', 'Folder', myFolder

Save the A2L file retrieved from the real-time application with custom name specified.

Example: 'FileName', 'MyModel'

Full path of the folder in which to save the A2L file.

Example: 'Folder', myFolder

Extract the A2L file from the real-time application by updating the target IP address.

Example: 'TargetIPAddress', '192.168.1.1'

Version History

Introduced in R2020b