1. General Reactis Functions#

1.1. rsOpen#

Start a Reactis API session.

1.1.1. Syntax#

rsOpen()

1.1.2. Description#

rsOpen loads and initializes the Reactis API.

1.1.3. See Also#

rsClose

1.2. rsClose#

End a Reactis API session.

1.2.1. Syntax#

rsClose()

1.2.2. Description#

rsClose()

removes the Reactis API library and all associated files from MATLAB memory. All currently open .rsi files, Tester or Simulator sessions will be closed without saving.

1.2.3. See Also#

rsOpen

1.3. rsGUI#

Starts the Reactis GUI.

1.3.1. Syntax#

rsGUI(mdlFile)
rsGUI(mdlFile, rsiFile)
rsGUI(mdlFile, rsiFile, wait)

1.3.2. Description#

rsGUI(mdlFile)

starts the Reactis GUI and loads the model given by mdlFile.

rsGUI(mdlFile, rsiFile)

starts the Reactis GUI and loads the model given by mdlFile and the rsi file given by rsiFile.

rsGUI(mdlFile, rsiFile, wait)

starts the Reactis GUI and loads the model given by mdlFile and the rsi file given by rsiFile. If wait is 1 then wait for the Reactis GUI to exit before continuing.

1.4. rsExtractSubsystem#

Extract a subsystem from a model and save in a new .slx file. Syntax

rsExtractSubsystem(subsys) 
rsExtractSubsystem(subsys, destinationModelFile)
rsExtractSubsystem(subsys, destinationModelFile, flagsStr)
rsExtractSubsystem(srcModelFile, srcRsiFile, srcSystem, destinationModelFile)
rsExtractSubsystem(srcModelFile, srcRsiFile, srcSystem, destinationModelFile,flagsStr)

1.4.1. Description#

rsExtractSubsystem(subsys)

extracts subsystem subsys and saves it as a new model. subsys is a string containing a full block path, e.g. ‘cruise/Plant’ specifies subsystem Plant in a model cruise.slx. The first part of the path specifies the source model from which to extract and the final part of the path specifies the name of the new extracted model. If a .rsi file exists in the same directory as the source model and with the same base name as the source model then the .rsi file will be used to determine model-specific information during the extraction process.

rsExtractSubsystem(subsys, destinationModelFile)

does the same as above but saves the new model to the file name specified in destinationModelFile.

rsExtractSubsystem(subsys, destinationModelFile, flagsStr)

does the same as above but lets you specify additional options in the flagsStr argument. flagsStr must be a cell array of strings with each cell being one of the following:

setInportTypes

Set types of inputs in extracted model to match the types of the corresponding inputs in the parent model.

setInportSample

Set sample rates of inputs in extracted model to match the rates of the corresponding inputs in the parent model.

setOutportTypes

Set types of outputs in extracted model to match the types of the corresponding outputs in the parent model.

setOutportSample

Set sample rates of outputs in extracted model to match the rates of the corresponding outputs in the parent model.

extractTrigger

If the extracted subsystem is triggered then also extract the part of the source model that creates the trigger signal. Otherwise a top-level input port will be created for the trigger signal.

If the flags parameter is omitted then it defaults to: {‘setInportTypes’, ‘setOutportTypes’}

rsExtractSubsystem(srcModelFile, srcRsiFile, srcSystem, destinationModelFile)

extracts subsystem srcSystem from source model srcModelFile using srcRsiFile for model-specific information and saves the new model to the file name specified in destinationModelFile. If srcRsiFile is an empty matrix then no .rsi file will be used.

rsExtractSubsystem(srcModelFile, srcRsiFile, srcSystem, destinationModelFile,flagsStr)

does the same as above but allows you specify additional extraction flags. flagsStr must be a cell array of strings as specified above.

1.4.2. Examples#

rsExtractSubsystem('cruise/Plant')

Extract subsystem Plant from the source model cruise.slx and store the new model in Plant.slx.

rsExtractSubsystem('cruise/Plant','myPlant.slx')

Extract subsystem Plant from the source model cruise.slx and store the new model in myPlant.slx.

1.5. rsGetCoverageMetrics#

Get coverage information about previous test runs.

1.5.1. Syntax#

  metrics = rsGetCoverageMetrics() 

1.5.2. Description#

metrics = rsGetCoverageMetrics()

returns coverage information resulting from the most recent call to rsSimRunSuite, rsTester, or rsTesterStart. metrics is a structure array containing one element for each coverage metric tracked by Reactis. Each structure contains the following fields:

name

Name of the coverage metric.

numTargets

Total number of coverage targets in this metric.

numCovered

Number of covered targets for this metric.

numUncovered

Number of uncovered targets for this metric.

numUnreachable

Number of unreachable targets for this metric.

percentCovered

Fraction of reachable targets in this metric that are covered.

1.5.3. See Also#

rsSimRunSuite, rsTester, rsTesterStart

1.6. rsGetParameterValue#

Get the value of a global Reactis parameter. Global parameters influence the general function of Reactis and may also be manipulated from the Reactis GUI using the dialog invoked from FileGlobal Settings....

1.6.1. Syntax#

value = rsGetParameterValue(paramName)

1.6.2. Description#

value = rsGetParameterValue(paramName)

returns the value of global Reactis parameter paramName.

Parameters of any data type may be queried by rsGetParameterValue. The return value is always a string.

Valid parameters names are listed in the Global Parameters section of the Reactis API documentation.

1.6.3. Examples#

  v = rsGetParameterValue('LibraryPath')

1.6.4. See Also#

Global Parameters, rsGetParameterValueBool, rsGetParameterValueDouble

1.7. rsGetParameterValueBool#

Get the value of a global boolean typed Reactis parameter.

1.7.1. Syntax#

value = rsGetParameterValueBool(paramName)

1.7.2. Description#

value = rsGetParameterValueBool(paramName)

returns the value of global Reactis parameter paramName.

If the parameter is not of type boolean, then an error is raised.

Valid parameters names are listed in the Global Parameters section of the Reactis API documentation.

1.7.3. Examples#

  v = rsGetParameterValueBool('UseEMLPlugin')

1.7.4. See Also#

Global Parameters, rsGetParameterValue, rsGetParameterValueDouble

1.8. rsGetParameterValueDouble#

Get the value of a global Reactis parameter of type double.

1.8.1. Syntax#

value = rsGetParameterValueDouble(paramName)

1.8.2. Description#

value = rsGetParameterValueDouble(paramName)

returns the value of global Reactis parameter paramName.

If the parameter is not of type double, then an error is raised.

Valid parameters names are listed in the Global Parameters section of the Reactis API documentation.

1.8.3. Examples#

  v = rsGetParameterValueDouble('MatlabStartupTimeout')

1.8.4. See Also#

Global Parameters, rsGetParameterValue, rsGetParameterValueBool

1.9. rsSetParameterValue#

Set the value of a global Reactis parameter.

1.9.1. Syntax#

rsSetParameterValue(paramName, value)

1.9.2. Description#

rsSetParameterValue(paramName, value)

sets global Reactis parameter paramName to value.

Parameters of any data type may be set by rsSetPareterValue, but the value argument must be given as a string.

Valid parameters names and their allowed values are listed in the Global Parameters section of the Reactis API documentation.

1.9.3. Examples#

  rsSetParameterValue('UserName','Albert Einstein')

1.10. rsSetStringEncoding#

Set string encoding.

1.10.1. Syntax#

rsSetStringEncoding(encoding)

1.10.2. Description#

rsSetStringEncoding(encoding)

sets the character encoding for strings returned by functions like rsGetLastError and rsTesterGetStatus. If not set, the strings will be UTF8 encoded.

1.10.3. Examples#

  rsSetStringEncoding('UTF8')

1.11. rsUnpackBusInputs#

Create wrapper with separate inport for each element of top-level bus inports.

1.11.1. Syntax#

rsUnpackBusInputs(modelName) 
rsUnpackBusInputs(modelName, wrapperModelName)
rsUnpackBusInputs(modelName, wrapperModelName, 'PARAMETER_NAME1', VALUE1, 
                                               'PARAMETER_NAME2', VALUE2, ...)

1.11.2. Description#

rsUnpackBusInputs(modelName)

creates a wrapper model for modelName named modelName_wrap.

rsUnpackBusInputs(modelName,wrapperModleName)

creates a wrapper model for modelName named wrapperModelName.

rsUnpackBusInputs(modelName,wrapperModleName,’PARAMETER_NAME1’, VALUE1, ‘PARAMETER_NAME2’, VALUE2, …)

creates a wrapper model for modelName named wrapperModelName, according to the additional settings specified by the following additional parameters:

Parameter Name

Allowed Values

Description

StubUnusedElements

‘on’, ‘off’

If an element of a bus is unused, no input port will be created for that element. Instead, the signal for that element will be connected to a Ground block. Default: ‘on’.

HideStubbedElements

‘on’, ‘off’

Create a wrapper subsystem around the Inport/Ground blocks so that the top-level system looks cleaner (since it contains only the scalar input ports and not the stubbed signals) Default: ‘on’.

1.12. rsVersion#

Return Reactis API version.

1.12.1. Syntax#

rsVersion()

1.12.2. Description#

rsVersion()

returns a string containing the version of the Reactis API.

1.12.3. See Also#

rsVersionParse

1.13. rsVersionParse#

Parse Reactis version string.

1.13.1. Syntax#

rsVersionParse(version)

1.13.2. Description#

[major,minor,patch] = rsVersionParse(version)

accepts string input version, returned by rsVersion, and returns three int32 results:

  1. major the major release number of the Reactis API

  2. minor the minor release number of the Reactis API

  3. patch the patch release number of the Reactis API

1.13.3. Examples#

  >> v = rsVersion()
  v = 
    V2016.0.2
  >> [maj,min,patch] = rsVersionParse(v)
  maj = 
    2016
  min =
    0
  patch = 
    2

1.13.4. See Also#

rsVersion

1.14. rsCheckNewMatlabVersion#

1.14.1. Syntax#

rsCheckNewMatlabVersion

1.14.2. Description#

rsCheckNewMatlabVersion :

1.14.3. Examples#


1.14.4. See Also#

1.15. rsModelStatistics#

Calculates size statistics for a model

1.15.1. Syntax#

rsModelStatistics(modelName)
stats = rsModelStatistics(modelName)

1.15.2. Description#

Calculates a variety of size statistics (number of blocks, number of Stateflow states etc.) for a model.

rsModelStatistics(modelName)

Prints size statistics for modelName on the MATLAB command line.

stats = rsModelStatistics(modelName)

Returns a structure containing size statistics for modelName

1.15.3. Examples#


>> rsModelStatistics('cruise')
Total number of blocks      : 109
Total number of systems     : 11
Average system depth        : 2.3
Maximum system depth        : 4
Total number of cond subsys : 2
Number of top-level in/out  : 8/3
Total number of ref models  : 0
Total number of signals     : 91
Average signal size         : 1.0
Maximum signal size         : 2
Total number of charts      : 1
Total number of states      : 5
Average state depth         : 1.6
Maximum state depth         : 2
Total number of transitions : 7
Number of EML functions     : 0
Number of custom code files : 0
Total number of S-Functions : 0

1.15.4. See Also#

1.16. rsDoubleToPreciseString#

Convert double-precision value to string encoding.

1.16.1. Description#

rsDoubleToPreciseString

converts the given double-precision value to a string representation that can be parsed by the Reactis type parser (e.g. in function rsRsiSetInputType) and which prevents loss of precision when parsed.

1.16.2. See Also#

rsPreciseStringToDouble

1.17. rsPreciseStringToDouble#

Convert a string created by rsDoubleToPreciseString back to double.

1.17.1. Description#

rsPreciseStringToDouble

converts the output of rsDoubleToPreciseString back to a double-precision value. The conversions do not incur any precision loss.

1.17.2. See Also#

rsDoubleToPreciseString



Reactive Systems logo, needed here to cause png to be copied for header.