Reactive Systems logo
Reactis API V2021

Reactis API:
Reactis Info File (Inputs and Outputs)

rsRsiGetInputsGet input ports in the .rsi file.
rsRsiGetInputTypeGet the type of an input in the .rsi file.
rsRsiSetInputTypeSet the type of an input in the .rsi file.
rsRsiDeltaCreate a string representing a delta restriction.
rsRsiIfThenElseCreate a string representing a conditional type.
rsRsiRangeCreate a string representing a value range.
rsRsiSetCreate a string representing a value set.
rsRsiGetOutputsGet output ports in the .rsi file.
rsRsiGetOutputToleranceGet the tolerance for an output in the .rsi file.
rsRsiSetOutputToleranceSet the tolerance for an output in the .rsi file.
rsRsiGetOutputTypeGet the type of an output in the .rsi file.
rsRsiDefaultInputsReset input types in .rsi file to their defaults.
rsRsiDefaultOutputsReset output tolerances in .rsi file to defaults.
rsRsiDefaultAllCombines effects of rsRsiDefaultInputs and rsRsiDefaultOutputs.
rsRsiSyncInputsSynchronize input types between .rsi file and associated model.
rsRsiSyncOutputsSynchronize outputs between .rsi file and associated model.
rsRsiSyncAllCombines effects of rsRsiSyncInputs and rsRsiSyncOutputs.
rsRsiTlSyncInputRangesSynchronize input ranges between .rsi file and TargetLink.


rsRsiGetInputs

Get input ports in the .rsi file.

Syntax

names = rsRsiGetInputs(rsiId)

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.

Examples

>> rsRsiGetInputs(rsiId)
ans = 
    'onOff'
    'accelResume'
    'cancel'
    'decelSet'
    'brake'
    'gas'
    'inactiveThrottleDelta'
    'drag'

See Also

rsRsiOpen


rsRsiGetInputType

Get the type of an input in the .rsi file.

Syntax

rsRsiGetInputType(rsiId, inputName)
rsRsiGetInputType(rsiId, inputName, element)

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.

Raises an error if inputType is not valid for the given port.

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

See Also

rsRsiOpen, rsRsiGetInputs, rsRsiSetInputType


rsRsiSetInputType

Set the type of an input in the .rsi file.

Syntax

rsRsiSetInputType(rsiId,inputName,inputType)
rsRsiSetInputType(rsiId,inputName,element,inputType)

Description

rsRsiSetInputType(rsiId,inputName,inputType) sets the type of input named inputName.

rsRsiSetInputType(rsiId,inputName,element,inputType) sets the type of element within the input named inputName.

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 including the base type of the inport element(s) to be set. Type restrictions can be added to the type as specified in section 5.3.2 Type Constraint Syntax in 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.

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).

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

See Also

rsRsiOpen, rsRsiGetInputs, rsRsiGetInputType, rsRsiRange, rsRsiSet, rsRsiDelta


rsRsiDelta

Create a string representing a delta restriction.

Syntax

rsRsiDelta(min, max) 

Description

rsRsiDelta(min, max) between steps, the value can not change by less than deltaMin or more than deltaMax.

See Also

rsRsiSetInputType, rsRsiRange, rsRsiSet


rsRsiIfThenElse

Create a string representing a conditional type.

Syntax

rsRsiIfThenElse(ifExpr, thenType, elseType)
rsRsiIfThenElse(ifExpr, type, elseIfExpr1, type1, elseIfExpr2, type2, ..., elseType)

Description

rsRsiIfThenElse(ifExpr, thenType, elseType) If the expression is true, use thenType otherwise use elseType. The only variable currently supported in the expression is the simulation time t.

rsRsiIfThenElse(ifExpr, type, elseIfExpr1, type1, elseIfExpr2, type2, ..., elseType) If ifExpr is true, use type, otherwise if elseIfExpr1 is true, use type1 otherwise if elseIfExpr2 is true, use type2 otherwise ... use elseType.


rsRsiRange

Create a string representing a value range.

Syntax

rsRsiRange(min, max) 
rsRsiRange(min, step, max)
rsRsiRange(min, max, deltaMin, deltaMax) 
rsRsiRange(min, step, max, deltaMin, deltaMax)

Description

rsRsiRange(min, max) range is min...max

rsRsiRange(min, step, max) range is min...max with a step size of step.

rsRsiRange(min, max, deltaMin, deltaMax) range is min...max. Between steps the value can not change by less than deltaMin or more than deltaMax.

rsRsiRange(min, step, max, deltaMin, deltaMax) range is min...max with a step size of step. Between steps the value can not change by less than deltaMin or more than deltaMax.

See Also

rsRsiSetInputType, rsRsiSet, rsRsiDelta


rsRsiSet

Create a string representing a value set.

Syntax

rsRsiSet(a)

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.


rsRsiGetOutputs

Get output ports in the .rsi file.

Syntax

outputNames = rsRsiGetOutputs(rsiId)

Description

outputNames = rsRsiGetOutputs(rsiId) returns a cell array containing a list of output port names.

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

Examples

>> rsRsiGetOutputs(rsiId)
ans = 
    'active'
    'throttleDelta'
    'speed'

See Also

rsRsiOpen, rsRsiGetInputs


rsRsiGetOutputTolerance

Get the tolerance for an output in the .rsi file.

Syntax

tol = rsRsiGetOutputTolerance(rsiId,outputName)

Description

tol = rsRsiGetOutputTolerance(rsiId,outputName) retrieves the port-specific relative tolerance set for output outputName to be used when comparing values computed by a model against values stored in a test suite. A tolerance of -1 means to inherit the tolerance for the port from the model tolerance. See Section Outport Tolerances in Chapter 5 of the Reactis User's Guide for a discussion of how outport tolerances are used when running Reactis test suites.

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

Examples

>> tol = rsRsiGetOutputTolerance(rsiId,'speed')
tol =
    -1

See Also

rsRsiOpen, rsRsiGetOutputs, rsRsiSetOutputTolerance


rsRsiSetOutputTolerance

Set the tolerance for an output in the .rsi file.

Syntax

rsRsiSetOutputTolerance(rsiId,outputName,tol)

Description

rsRsiSetOutputTolerance(rsiId,outputName,tol) sets the relative tolerance for output outputName to tol (a double). This tolerance is used when comparing values computed by a model against values stored in a test suite. A tolerance of -1 means to inherit the tolerance for the port from the model tolerance. See Section Outport Tolerances in Chapter 5 of the Reactis User's Guide for a discussion of how outport tolerances are used when running Reactis test suites.

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

Examples

rsRsiSetOutputTolerance(rsiId,'speed',0.0001)

See Also

rsRsiOpen, rsRsiGetOutputs, rsRsiSetOutputTolerance


rsRsiGetOutputType

Get the type of an output in the .rsi file.

Syntax

rsRsiGetOutputType(rsiId,outputName)

Description

rsRsiGetOutputType(rsiId,outputName) returns the type of output named outputName.

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

See Also

rsRsiOpen, rsRsiGetOutputs


rsRsiDefaultInputs

Reset input types in .rsi file to their defaults.

Syntax

rsRsiDefaultInputs(rsiId)

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.

See Also

rsRsiOpen, rsRsiSave, rsRsiGetInputType


rsRsiDefaultOutputs

Reset output tolerances in .rsi file to defaults.

Syntax

rsRsiDefaultOutputs(rsiId)

Description

rsRsiDefaultOutputs(rsiId) resets tolerances for all output ports in the .rsi file to -1 (i.e. inherit from model setting). The changes made by rsRsiDefaultOutputs will be saved to disk during the next call to rsRsiSave.

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

See Also

rsRsiOpen, rsRsiSave, rsRsiGetOutputTolerance


rsRsiDefaultAll

Combines effects of rsRsiDefaultInputs and rsRsiDefaultOutputs.

Syntax

rsRsiDefaultAll(rsiId)

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.

See Also

rsRsiOpen, rsRsiSave, rsRsiDefaultInputs, rsRsiDefaultOutputs


rsRsiSyncInputs

Synchronize input types between .rsi file and associated model.

Syntax

rsRsiSyncInputs(rsiId)

Description

rsRsiSyncInputs(rsiId) reads inport names and types from the associated model (given in the rsOpen 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 the types given in both 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.

See Also

rsRsiOpen, rsRsiSave, rsRsiGetInputType


rsRsiSyncOutputs

Synchronize outputs between .rsi file and associated model.

Syntax

rsRsiSyncOutputs(rsiId)

Description

rsRsiSyncOutputs(rsiId) reads outport names and types from the associated model (given in the rsOpen 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 with a default tolerance of -1.
  • 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, no changes are made

Any changes made by rsRsiSyncOutputs will be saved to disk during the next call to rsRsiSave.

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

See Also

rsRsiOpen, rsRsiSave, rsRsiGetOutputTolerance


rsRsiSyncAll

Combines effects of rsRsiSyncInputs and rsRsiSyncOutputs.

Syntax

rsRsiSyncAll(rsiId)

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.

See Also

rsRsiOpen, rsRsiSave, rsRsiSyncInputs, rsRsiSyncOutputs


rsRsiTlSyncInputRanges

Synchronize input ranges between .rsi file and TargetLink.

Syntax

rsRsiTlSyncInputRanges(rsiId)

Description

rsRsiTlSyncInputRanges(rsiId) updates the types of the inputs in the .rsi file 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.

See Also

rsRsiOpen, rsRsiSave, rsRsiGetInputType