8. Reactis Info File - Inports#
8.1. rsRsiGetInputs#
Get input ports in the .rsi file.
8.1.1. Syntax#
names = rsRsiGetInputs(rsiId)
8.1.2. Description#
- names = rsRsiGetInputs(rsiId)
returns a cell array containing a list of input port names. rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
8.1.3. Examples#
>> rsRsiGetInputs(rsiId)
ans =
'onOff'
'accelResume'
'cancel'
'decelSet'
'brake'
'gas'
'inactiveThrottleDelta'
'drag'
8.1.4. See Also#
8.2. rsRsiGetInputType#
Get the type of an input in the .rsi file.
8.2.1. Syntax#
rsRsiGetInputType(rsiId, inputName)
rsRsiGetInputType(rsiId, inputName, element)
8.2.2. Description#
- rsRsiGetInputType(rsiId, inputName)
returns the type of the input named inputName.
- rsRsiGetInputType(rsiId, inputName, element)
returns the type of element within the input named inputName. See rsRsiSetInputType for more information on how to select a specific element.
rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
Raises an error if inputName is not an inport in in the .rsi file.
8.2.3. See Also#
8.3. rsRsiSetInputType#
Set the type of an input in the .rsi file.
8.3.1. Syntax#
rsRsiSetInputType(rsiId,inputName,inputType)
rsRsiSetInputType(rsiId,inputName,element,inputType)
8.3.2. Description#
- rsRsiSetInputType(rsiId,inputName,inputType)
sets the type of input named inputName to inputType.
- rsRsiSetInputType(rsiId,inputName,element,inputType)
sets the type of element within the input named inputName to *inputType.
If either the port specified by inputName is a scalar or the element specification selects a scalar out of the input then the rsRsiRange, rsRsiSet and rsRsiDelta functions can be used to construct a type. Otherwise, inputType must be a full type specification string including the base type of the inport or element to be set. For a description of the type string syntax see section Type Constraint Syntax in Chapter 5 of the Reactis User’s Guide.
Raises an error if inputType is not valid for the given port.
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.
8.3.3. Examples#
rsRsiSetInputType(rsiId, 'In1', rsRsiRange(0,100))
If input port In1 is a scalar then its range will be set to 0…100, otherwise an error will be raised.
rsRsiSetInputType(rsiId, 'In2', '(2)', rsRsiRange(0, 10))
If input port In2 is a vector, its second element will be set to have a range of 0…10, otherwise an error will be raised
rsRsiSetInputType(rsiId, 'In3', 'cancel', rsRsiSet([0, 1]))
If input port In3 is a bus with an element cancel
, possible values for
that element will be 0 or 1.
rsRsiSetInputType(rsiId, 'In4', 'b.b1.arrayval(5,3)', rsRsiSet([0]))
Sets element (5,3) of a 2-d array element arrayval
which is an element of
sub-bus b1
which is an element of bus b
.
rsRsiSetInputType(rsiId, 'In5', '<|double{1,2,3} * double[1,10]|>')
Sets both elements of a 2-element vector (must use full types in this case).
8.3.4. See Also#
rsRsiOpen, rsRsiSave, rsRsiGetInputs, rsRsiGetInputType, rsRsiRange, rsRsiSet, rsRsiDelta
8.4. rsRsiDelta#
Create a string (suitable for input to rsRsiSetInputType) representing a delta constraint.
8.4.1. Syntax#
rsRsiDelta(min, max)
8.4.2. Description#
- rsRsiDelta(min, max)
between steps, the value can not change by less than min or more than max.
8.4.3. See Also#
8.5. rsRsiIfThenElse#
Create a string (suitable for input to rsRsiSetInputType) representing a conditional type.
8.5.1. Syntax#
rsRsiIfThenElse(ifExpr, thenType, elseType)
rsRsiIfThenElse(ifExpr, type, elseIfExpr1, type1, elseIfExpr2, type2, ..., elseType)
8.5.2. Description#
- rsRsiIfThenElse(ifExpr, thenType, elseType)
constructs a type specification string with meaning
If ifExpr is true, use thenType otherwise use elseType.
- rsRsiIfThenElse(ifExpr, thenType, elseIfExpr1, type1, elseIfExpr2, type2, …, elseType)
constructs a type specification string with meaning
If ifExpr is true, use thenType, otherwise if elseIfExpr1 is true, use type1 otherwise if elseIfExpr2 is true, use type2 … otherwise use elseType.
The only variable currently supported in the control expressions is the
simulation time denoted t
.
8.6. rsRsiRange#
Create a string (suitable for input to rsRsiSetInputType) representing a value range.
8.6.1. Syntax#
rsRsiRange(min, max)
rsRsiRange(min, increment, max)
rsRsiRange(min, max, deltaMin, deltaMax)
rsRsiRange(min, increment, max, deltaMin, deltaMax)
8.6.2. Description#
- rsRsiRange(min, max)
range is min…max
- rsRsiRange(min, increment, max)
range is min…max with an increment size of increment. For example,
rsRsiRange(0,2,8)
specifies 0,2,4,6,8.- rsRsiRange(min, max, deltaMin, deltaMax)
range is min…max. Between simulation steps the value can not change by less than deltaMin or more than deltaMax.
- rsRsiRange(min, increment, max, deltaMin, deltaMax)
range is min…max with an increment size of increment. Between simulation steps the value can not change by less than deltaMin or more than deltaMax.
8.6.3. See Also#
8.7. rsRsiSet#
Create a string (suitable for input to rsRsiSetInputType) representing a value set.
8.7.1. Syntax#
rsRsiSet(a)
8.7.2. Description#
- rsRsiSet(a)
where a is either an array or a cell array of numeric, string or enumerated values. The array’s elements specify the values of the set.
8.7.3. See Also#
8.8. rsRsiDefaultInputs#
Reset input types in .rsi file to their defaults.
8.8.1. Syntax#
rsRsiDefaultInputs(rsiId)
8.8.2. Description#
- rsRsiDefaultInputs(rsiId)
removes all input constraints recorded in the .rsi file. In effect, this sets the type for each input to its base type. The changes made by rsRsiDefaultInputs will be saved to disk during the next call to rsRsiSave.
rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
8.8.3. See Also#
8.9. rsRsiDefaultAll#
Combines effects of rsRsiDefaultInputs and rsRsiDefaultOutputs.
8.9.1. Syntax#
rsRsiDefaultAll(rsiId)
8.9.2. Description#
- rsRsiDefaultAll(rsiId)
combines the effects of rsRsiDefaultInputs and rsRsiDefaultOutputs. The changes made by rsRsiDefaultAll will be saved to disk during the next call to rsRsiSave.
rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
8.9.3. See Also#
rsRsiOpen, rsRsiSave, rsRsiDefaultInputs, rsRsiDefaultOutputs
8.10. rsRsiSyncInputs#
Synchronize input types between .rsi file and associated model.
8.10.1. Syntax#
rsRsiSyncInputs(rsiId)
8.10.2. Description#
- rsRsiSyncInputs(rsiId)
reads inport names and types from the associated model (given in the rsRsiOpen call) and updates the .rsi file accordingly:
If a port exists in the model but not the .rsi file, it is added to the .rsi file.
If a port exists in the .rsi file but not the model, it is removed from the .rsi file.
If a port exists in both the .rsi file and the model and the types given in both match, no changes are made
If a port exists in both the .rsi file and the model and their types differ, the input type in the .rsi file is set to match the model’s type. If type restrictions were set for that input in the .rsi file, the restrictions are removed.
Any changes made by rsRsiSyncInputs will be saved to disk during the next call to rsRsiSave.
rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
8.10.3. See Also#
8.11. rsRsiSyncAll#
Combines effects of rsRsiSyncInputs and rsRsiSyncOutputs.
8.11.1. Syntax#
rsRsiSyncAll(rsiId)
8.11.2. Description#
- rsRsiSyncAll(rsiId)
combines the effects of rsRsiSyncInputs and rsRsiSyncOutputs. Any changes made by rsRsiSyncAll will be saved to disk during the next call to rsRsiSave.
rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
8.11.3. See Also#
8.12. rsRsiTlSyncInputRanges#
Synchronize input ranges between .rsi file and TargetLink.
8.12.1. Syntax#
rsRsiTlSyncInputRanges(rsiId)
8.12.2. Description#
- rsRsiTlSyncInputRanges(rsiId)
updates the types of the inputs in the .rsi file specified by rsiId so that each input is constrained to the match the min/max values for that input in the currently open TargetLink data dictionary.
Any changes made by rsRsiTlSyncInputRanges will be saved to disk during the next call to rsRsiSave.