9. Reactis Info File - Configuration Variables#

9.1. rsRsiGetConfigVars#

Return configuration variables in the .rsi file.

9.1.1. Syntax#

names = rsRsiGetConfigVars(rsiId)

9.1.2. Description#

names = rsRsiGetConfigVars(rsiId)

returns a cell array containing a list of configuration variable names specified in the .rsi file.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.1.3. Examples#

>> names = rsRsiGetConfigVars(rsi)
names = 
    'InitialSpeed'

9.1.4. See Also#

rsRsiOpen

9.2. rsRsiGetConfigVarType#

Return the type of a configuration variable.

9.2.1. Syntax#

rsRsiGetConfigVarType(rsiId, varName)
rsRsiGetConfigVarType(rsiId, varName, configSetName)

9.2.2. Description#

rsRsiGetConfigVarType(rsiId, varName)

returns the type of configuration variable named varName in the currently active configuration variable set.

rsRsiGetConfigVarType(rsiId, varName, configSetName)

returns the type of configuration variable named varName in configuration variable set configSetName.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.2.3. Examples#

>> cvt = rsRsiGetConfigVarType(rsiId,'InitialSpeed')
cvt =
  double{10.0, 30.0, 40.0}

9.2.4. See Also#

rsRsiOpen, rsRsiGetConfigVars, rsRsiSetConfigVarType, rsRsiSetActiveConfigVarSet

9.3. rsRsiSetConfigVarType#

Set the type of a configuration variable.

9.3.1. Syntax#

rsRsiSetConfigVarType(rsiId, varName, varType)
rsRsiSetConfigVarType(rsiId, varName, varType, configSetName)

9.3.2. Description#

rsRsiSetConfigVarType(rsiId, varName, varType)

sets the type of configuration variable varName to varType in the currently active configuration variable set.

rsRsiSetConfigVarType(rsiId, varName, varType, configSetName)

sets the type of configuration variable varName to varType in the configuration variable set configSetName.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen. rsRsiSave must be called to save modifications to .rsi file in order for them to be used by subsequent calls to rsSimOpen or rsTester. Updates to .rsi file are not propagated to any running Simulator or Tester sessions.

varName must be a configuration variable in the .rsi file.

varType must have the same base type (e.g. double, int32, etc…) as workspace variable varName. See Section Type Constraint Syntax of the Reactis User’s Guide for a description of the syntax of Reactis type constraints.

Raises an error if varType is not valid for the variable.

9.3.3. See Also#

rsRsiOpen, rsRsiSave, rsRsiGetConfigVars, rsRsiGetConfigVarType

9.4. rsRsiAddConfigVar#

Add a configuration variable to the .rsi file.

9.4.1. Syntax#

rsRsiAddConfigVar(rsiId, varName)
rsRsiAddConfigVar(rsiId, varName, varType)

9.4.2. Description#

rsRsiAddConfigVar(rsiId, varName)

adds configuration variable varName to the .rsi file. Its type will consist of a base type equal to the type of the corresponding workspace variable and a constraint that limits it to a set of values containing only the value the workspace variable has after model initialization. The new configuration variable will be added to all existing configuration sets.

rsRsiAddConfigVar(rsiId, varName, varType)

adds configuration variable varName to the .rsi file and sets its type to varType.

varName must be a workspace variable in the associated model’s base workspace. To query a list of valid names use rsRsiGetPotentialConfigVars.

varType must have the same base type (e.g. double, int32, etc…) as workspace variable varName. See Section Type Constraint Syntax of the Reactis User’s Guide for a description of the syntax of Reactis type constraints.

Raises an error if varType is not valid for the variable.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.4.3. See Also#

rsRsiOpen, rsRsiRemoveConfigVar, rsRsiGetPotentialConfigVars

9.5. rsRsiRemoveConfigVar#

Remove configuration variable from .rsi file.

9.5.1. Syntax#

rsRsiRemoveConfigVar(rsiId, varName)

9.5.2. Description#

rsRsiRemoveConfigVar(rsiId, varName)

removes configuration variable varName from all configuration sets in the .rsi file. An error is raised if varName is not present in the .rsi file.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.5.3. See Also#

rsRsiOpen, rsRsiAddConfigVar

9.6. rsRsiGetPotentialConfigVars#

Get potential configuration variables.

9.6.1. Syntax#

rsRsiGetPotentialConfigVars(rsiId)

9.6.2. Description#

rsRsiGetPotentialConfigVars(rsiId)

inspects the MATLAB base workspace after initializing the model associated with the .rsi file and returns a cell array containing a list of workspace variable names that can be used in rsRsiAddConfigVar.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.6.3. See Also#

rsRsiOpen, rsRsiAddConfigVar

9.7. rsRsiGetConfigVarSets#

Return names of configuration variable sets in the .rsi file.

9.7.1. Syntax#

names = rsRsiGetConfigVarSets(rsiId)

9.7.2. Description#

names = rsRsiGetConfigVarSets(rsiId)

returns a cell array containing a list of configuration variable set names specified in the .rsi file.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.7.3. See Also#

rsRsiOpen

9.8. rsRsiAddConfigVarSet#

Add a new configuration variable set to the .rsi file.

9.8.1. Syntax#

rsRsiAddConfigVarSet(rsiId, configVarSetName)

9.8.2. Description#

rsRsiAddConfigVarSet(rsiId, configVarSetName)

adds configuration variable set configVarSetName to the .rsi file.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.8.3. See Also#

rsRsiOpen, rsRsiRemoveConfigVarSet, rsRsiSetActiveConfigVarSet

9.9. rsRsiRemoveConfigVarSet#

Remove a configuration variable set from .rsi file.

9.9.1. Syntax#

rsRsiRemoveConfigVarSet(rsiId, configVarSetName)

9.9.2. Description#

rsRsiRemoveConfigVarSet(rsiId, configVarSetName)

removes configuration variable set configVarSetNamefrom the .rsi file. An error is raised if configVarSetName is not present in the .rsi file.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.9.3. See Also#

rsRsiOpen, rsRsiAddConfigVarSet

9.10. rsRsiGetConfigVarSetEnabled#

Get enabled/disabled status of a configuration variable set.

9.10.1. Syntax#

enab = rsRsiGetConfigVarSetEnabled(rsiId, configVarSetName)

9.10.2. Description#

enab = rsRsiGetConfigVarSetEnabled(rsiId, configVarSetName)

returns 1 if configuration variable set configVarSetName is enabled, otherwise it returns 0.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.10.3. Examples#

rsRsiGetConfigVarSetEnabled(rsi,'ConfigVarSet1')
ans =
     1

9.10.4. See Also#

rsRsiOpen, rsRsiSetConfigVarSetEnabled

9.11. rsRsiSetConfigVarSetEnabled#

Set enabled/disabled status of a configuration variable set.

9.11.1. Syntax#

rsRsiSetConfigVarSetEnabled(rsiId, configVarSetName, enab)

9.11.2. Description#

rsRsiSetConfigVarSetEnabled(rsiId, configVarSetName, enab)

If enab is 1, then this function enables configuration variable set configVarSetName, otherwise it disables it.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen. rsRsiSave must be called to save modifications to .rsi file in order for them to be used by subsequent calls to rsSimOpen or rsTester. Updates to .rsi file are not propagated to any running Simulator or Tester sessions.

9.11.3. See Also#

rsRsiOpen, rsRsiSave, rsRsiGetConfigVarSetEnabled

9.12. rsRsiGetActiveConfigVarSet#

Return name of currently active configuration variable set.

9.12.1. Syntax#

activeConfigVarSetName = rsRsiGetActiveConfigVarSet(rsiId)

9.12.2. Description#

activeConfigVarSetName = rsRsiGetActiveConfigVarSet(rsiId)

returns the name of the currently active configuration variable set.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.

9.12.3. See Also#

rsRsiOpen, rsRsiSetActiveConfigVarSet

9.13. rsRsiSetActiveConfigVarSet#

Sets the active configuration variable set.

9.13.1. Syntax#

rsRsiSetActiveConfigVarSet(rsiId, activeConfigVarSetName)

9.13.2. Description#

rsRsiSetActiveConfigVarSet(rsiId, activeConfigVarSetName)

changes the currently active configuration variable set to activeConfigVarSetName.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen. rsRsiSave must be called to save modifications to .rsi file in order for them to be used by subsequent calls to rsSimOpen or rsTester. Updates to .rsi file are not propagated to any running Simulator or Tester sessions.

9.13.3. See Also#

rsRsiOpen, rsRsiSave, rsRsiGetActiveConfigVarSet

9.14. rsRsiCreateVariantConfigurationSets#

9.14.1. Syntax#

rsRsiCreateVariantConfigurationSets(rsiId)
rsRsiCreateVariantConfigurationSets(rsiId, variantConfigDataObject)
rsRsiCreateVariantConfigurationSets(rsiFileName, modelFileName)

9.14.2. Description#

rsRsiCreateVariantConfigurationSets(rsiId)

Loads the model associated with .rsi file rsiId and adds all configurations from Simulink.VariantConfigurationData objects attached to the model and all of its referenced models to the .rsi file rsiId. An error is raised if the .rsi file already contains multiple configuration variable sets. An error is raised if no attached Simulink.VariantConfigurationData are found.

rsRsiCreateVariantConfigurationSets(rsiId, variantConfigDataObjectName)

Adds all configurations from Simulink.VariantConfigurationData objects to to the .rsi file rsiId. The variantConfigDataObjectName parameter may be:

  • A string referring to a Simulink.VariantConfigurationData located in the base workspace

  • A string of form “ddname.vcname” referring to a Simulink.VariantConfigurationData object named “vcname” located in data dictionary “ddname”

  • A cell array of strings, where each element refers to a Simulink.VariantConfigurationData object as described above.

An error is raised if the .rsi file already contains multiple configuration variable sets.

rsRsiCreateVariantConfigurationSets(rsiFileName, modelFileName)

Adds all configurations from Simulink.VariantConfigurationData objects attached to model modelFileName to the .rsi file specified by rsiFileName. If rsiFileName does not yet exist then it will be created. An error is raised if the .rsi file already contains multiple configuration variable sets. An error is raised if no attached Simulink.VariantConfigurationData are found.

rsiId is the identifier of an .rsi file previously opened by rsRsiOpen. rsRsiSave must be called to save modifications to .rsi file in order for them to be used by subsequent calls to rsSimOpen or rsTester. Updates to .rsi file are not propagated to any running Simulator or Tester sessions.

The rsRsiCreateVariantConfigurationSets function performs the following functions for each configuration in each of the given Simulink.VariantConfigurationData objects:

  • Identify all the control variables used by the Simulink configuration (controlVars)

  • Add all controlVars as Reactis Configuration Variables in the .rsi file.

  • Add a new Configuration Variable Set (configSet) to the .rsi file, with the same name as the Simulink configuration. If multiple Simulink.VariantConfigurationData objects are imported then the configuration name will be prefixed with the name of the object.

  • Set the constraints of all controlVars within configSet such that only the control variable’s value specified in the Simulink configuration is allowed. If a control variable is not used within this Simulink configuration then it will be left unconstrained within configSet.

  • If multiple Simulink.VariantConfigurationData objects are imported then for each of the other objects select a random configuration and set the corresponding Configuration Variable constraints accordingly.

This results in a number of Configuration Variables Sets in Reactis, where each Configuration Variable Set corresponds to one configuration defined in a Simulink.VariantConfigurationData object. Therefore, activating a Configuration Variable Set in Reactis is equivalent to activating a configuration in Simulink.

Note that a Configuration Variable is added for each control variable used in each of the imported Simulink configurations. Therefore the set of configuration variables in Reactis contains all control variables used by the model(s).

When generating a test suite, Reactis Tester will automatically select each Configuration Variable Set at least once, ensuring that all configurations in the Simulink model have been exercised.

9.14.3. See Also#

rsRsiOpen, rsRsiSave, rsRsiSetActiveConfigVarSet