crossReleaseImport - Import generated model code from a previous release as
SIL or PIL blocks - MATLAB (original) (raw)
Import generated model code from a previous release as SIL or PIL blocks
Syntax
Description
[blockHandle](#bvd62vi-blockHandle) = crossReleaseImport([buildFolder](#bvd62vi-artifactsFolder),[configSetOrModel](#bvd62vi-configSet),'SimulationMode',[mode](#bvd62vi-mode))
imports previously generated model component code into the current release. The function imports the code as a cross-release block and returns the numeric handle of the block. The function displays the block in a new model window.
In an existing model, you can replace the model component with the cross-release block.
If you set 'SimulationMode'
to, for example,'SIL'
or 'PIL'
, the function imports the code as a software-in-the-loop (SIL) or processor-in-the-loop (PIL) block. When you run a simulation or build the model, the model component uses generated code from the previous release.
To build a SIL or PIL block, the function by default uses the following parameters of the Simulink® model specified by configSetOrModel
:
SystemTargetFile
Toolchain
orTemplateMakefile
ExistingSharedCode
PortableWordSizes
TargetLang
TargetLangStandard
TargetLibSuffix
ModelReferenceNumInstancesAllowed
- Hardware Implementation pane parameters
If you set 'SimulationMode'
to 'none'
, the function creates a Cross-Release Code Integration block, which:
- Supports generation of code that calls the imported code.
- Does not support normal, accelerator, or rapid accelerator mode simulations.
- Does not compile the imported code.
You can use the Cross-Release Code Integration block, for example, in workflows where compilation occurs on a different computer.
[blockHandle](#bvd62vi-blockHandle) = crossReleaseImport([buildFolder](#bvd62vi-artifactsFolder),[configSetOrModel](#bvd62vi-configSet),'SimulationMode',[mode](#bvd62vi-mode),'ConfigParams',[additionalParameterList](#bvd62vi-additionalParameterList))
uses additional configuration parameters for building the SIL or PIL block.
[blockHandle](#bvd62vi-blockHandle) = crossReleaseImport([buildFolder](#bvd62vi-artifactsFolder),[configSetOrModel](#bvd62vi-configSet),'SimulationMode',[mode](#bvd62vi-mode),'DataDictionary',[dictionaryFile](#bvd62vi-dictionaryFile))
imports generated code that uses data types specified by a data dictionary. IfconfigSetOrModel
is a model associated with a data dictionary, you do not have to specify the name-value pair. By default, the function identifies and uses the data dictionary when it imports the generated code. If you specify a name-value pair, the data dictionary that you specify takes precedence over the default data dictionary.
[blockHandle](#bvd62vi-blockHandle) = crossReleaseImport([buildFolder](#bvd62vi-artifactsFolder),[configSetOrModel](#bvd62vi-configSet),'SimulationMode',[mode](#bvd62vi-mode),'OriginalPaths',[originalPaths](#d126e22791),'ReplacementPaths',[replacementPaths](#d126e22815))
imports generated model code with relocated custom code or modified include paths. The paths specified by replacementPaths
override the original custom code or include paths specified by originalPaths
in a one-to-one manner. You cannot use replacementPaths
to specify additional custom code or include paths.
[blockHandle](#bvd62vi-blockHandle) = crossReleaseImport([buildFolder](#bvd62vi-artifactsFolder),[configSetOrModel](#bvd62vi-configSet),'SimulationMode',[mode](#bvd62vi-mode),'SFunctionName',[sFunctionName](#d126e22839))
names the generated SIL or PIL blocksFunctionName
_sil
orsFunctionName
_pil
. Use thesFunctionName
argument if the default block name produces associated MATLAB® identifiers that are longer than 63 characters.
Examples
This example shows how to import generated model code from a previous release.
Specify the location of the build folder.
buildFolder = fullfile(pwd,'R2015bWork', 'folderPathForP1_ert_rtw');
Import code for the integration model Controller
.
crossReleaseImport(buildFolder,'Controller','SimulationMode','SIL');
The function displays a SIL block in a new Simulink editor window.
Input Arguments
A configuration set or Simulink model on the MATLAB path.
Simulation mode for block with imported code:
'SIL'
— Create SIL block.'PIL'
— Create PIL block.{'SIL','PIL'}
— Create SIL and PIL blocks.'none'
— Create Cross-Release Code Integration block.
Additional parameters for building the SIL or PIL block.
Data dictionary that specifies data types used by the generated code.
Folder or include paths for original custom code. Must have a one-to-one correspondence with replacementPaths.
Folder or include paths for relocated custom code. Must have a one-to-one correspondence with originalPaths.
Specify name for SIL or PIL block that contains generated code from previous release. If the default block name produces associated MATLAB identifiers that are longer than 63 characters, use this argument to specify a shorter block name.
Output Arguments
Numeric handle of a block. Returned as a double if mode is 'SIL'
or 'PIL'
. Returned as an array of doubles if mode
is {'SIL','PIL'}
.
Version History
Introduced in R2016b
The crossReleaseImport
function supports the import of generated code from only the previous eight releases. If you use the function to import generated code from earlier releases, the function produces an error.
The function issues a warning that it will, in future releases, support the import of generated code from only the previous eight releases. You can use thecrossReleaseImport
function to import generated code from R2010a and later releases.