Reactive Systems logo
September 19, 2020
Reactis API
 
Spacer

API - Reactis: MATLAB Bindings - Reactis Info File (Validator Objectives)


rsRsiAddAssertionDiagramAdd a diagram assertion to an .rsi file.
rsRsiAddAssertionExpressionAdd an expression assertion.
rsRsiAddAssertionTimerAdd a timer assertion.
rsRsiAddUserTargetDiagramAdd a diagram-based user-defined target.
rsRsiAddUserTargetExpressionAdd an expression-based user-defined target.
rsRsiAddUserTargetTimerAdd a timer-based user-defined target.
rsRsiAddStateflowAssertionExpressionAdd an expression assertion.
rsRsiAddStateflowAssertionTimerAdd a timer assertion.
rsRsiAddStateflowUserTargetExpressionAdd an expression-based user-defined target.
rsRsiAddStateflowUserTargetTimerAdd a timer-based user-defined target.
rsRsiAddVirtualSourceDiagramAdd a diagram-based virtual source.
rsRsiAddVirtualSourceExpressionAdd an expression-based virtual source.
rsRsiGetObjectiveParameterValueGet the value of a Validator objective parameter.
rsRsiQueryObjectivesGet Validator objectives in an .rsi file.
rsRsiRemoveObjectiveRemove a Validator objective from an .rsi file.


rsRsiAddAssertionDiagram

Add a diagram assertion to an .rsi file.

Syntax

rsRsiAddAssertionDiagram(rsiId, systemName, assertionName, enabled,
                         objSystemPath, objParameters, inputWiring)

Description

rsRsiAddAssertionDiagram(rsiId, systemName, assertionName, enabled, objSystemPath, objParameters, inputWiring) adds the Simulink subsystem specified by objSystemPath as an assertion to an .rsi file. The parameters to this function act as follows:

  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • systemName identifies the subsystem within the model (that was given as an argument to rsRsiOpen to create rsiId) where the new assertion will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2.
  • assertionName is the name to be used for the assertion. An error is raised if a Simulink block or Reactis assertion or user-defined target with the same name already exists in systemName.
  • enabled sets the enabled/disabled status of the assertion (1 for enabled, 0 for disabled).
  • objSystemPath is a Simulink system path specifying the location of the subsystem that is to be used as the assertion. It is given in Simulink notation, e.g. libname/subsys1/subsys2.
  • objParameters is a cell array of string pairs specifying values for parameters for the assertion:
      {{'PARAM1', 'VALUE1'}, {'PARAM2','VALUE2'}, ...}  
    
    where the PARAM names correspond to prompts of the inserted system's mask (if any) and the VALUE elements specify their respective values.
  • inputWiring is a cell array of string pairs specifying connections for the assertion's input ports:
      {{'INPUT1', 'BLOCK1:PORT'},{'INPUT2', 'BLOCK1:PORT'}, ...}  
    
    where the INPUT names specify names of the inserted system's input ports, and the BLOCK:PORT elements specify block name and port numbers to which those input ports will be connected.

Examples

  rsRsiAddAssertionDiagram(rsiId, 'cruise/CruiseMain/CruiseMDL', 'SpdCheck', 1, ...
                           'cruise_validator/Assertion:  SpeedMaintenance', {}, ...
                           {{'speed','speed:1'}, {'dSpeed','DesiredSpeed:1'}, ...
                           {'active', 'Relational Operator1:1'}})
Takes subsystem cruise_validator/Assertion: SpeedMaintenance from the cruise_validator.slx library and inserts it into system cruise/CruiseMain/CruiseMDL within model cruise.slx as an assertion. There are no parameters. The inputs to the assertion are wired as follows:
  • assertion input port speed will be connected to the first output port of model block speed.
  • assertion input port dSpeed will be connected to the first output port of model block DesiredSpeed.
  • The assertion's input port named active will be connected to the first output port of model block Relational Operator1.

See Also

rsRsiOpen, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiAddAssertionExpression

Add an expression assertion.

Syntax

rsRsiAddAssertionExpression(rsiId, systemName, assertionName, enabled,
                            hold, expression, inputWiring)

Description

rsRsiAddAssertionExpression(rsiId, systemName, assertionName, enabled, hold, expression, inputWiring) Adds an expression assertion to an .rsi file. The parameters to this function act as follows:

  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • systemName identifies the subsystem within the model (that was given as an argument to rsRsiOpen to create rsiId) where the new assertion will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2.
  • assertionName is the name to be used for the assertion. An error is raised if a Simulink block or Reactis assertion or user-defined target with the same name already exists in systemName.
  • enabled sets the enabled/disabled status of the assertion (1 for enabled, 0 for disabled)
  • hold specifies the number of (sequential) steps the expression must evaluate to false before the assertion is violated.
  • expression is a c-like expression that evaluates to zero when the assertion is violated. See Section 9.3.1 in the Reactis User's Guide for a description of the expression syntax.
  • inputWiring is a cell array of string pairs specifying connections for the assertion's variables:
      {{'VAR1', 'BLOCK1:PORT'},{'VAR2', 'BLOCK1:PORT'}, ...}  
    
    where the VAR names specify variables used in the expression and the BLOCK:PORT elements specify block name and port numbers to which those variables will be connected.

Examples

  rsRsiAddAssertionExpression(rsiId, 'cruise', 'Brake', 1, 0, ...
                              '!(brake && active)', ...
                              {{'active', 'CruiseMain:1'}, {'brake', 'brake:1'}})
Adds expression !(brake && active) as an assertion named Brake into the top-level system of model cruise. The assertion's variable named active will be connected to the first output port of model block CruiseMain. The assertion's variable named brake will be connected to the first output port of model block brake.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiAddAssertionTimer

Add a timer assertion.

Syntax

rsRsiAddAssertionTimer(rsiId, systemName, assertionName, enabled,
                       connection, start, step, end)

Description

rsRsiAddAssertionTimer(rsiId, systemName, assertionName, enabled, connection, start, step, end) adds a timer assertion to an .rsi file. The parameters to this function act as follows:

  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • systemName identifies the subsystem within the model (that was given as an argument to rsRsiOpen to create rsiId) where the new assertion will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2.
  • assertionName is the name to be used for the assertion. An error is raised if a Simulink block or Reactis assertion or user-defined target with the same name already exists in systemName.
  • enabled sets the enabled/disabled status of the assertion (1 for enabled, 0 for disabled).
  • connection specifies the name and output port number of the block to be monitored as a timer. This string must must be formed as 'BLOCKNAME:PORTNUMBER'.
  • start is the timer start value.
  • step is the timer step size.
  • end is the timer end value.

Examples

  rsRsiAddAssertionTimer(rsi, 'cruise/Plant', 'MyAssertionTimer', 1, 'Sum1:1', 0, 1, 100)
Adds a timer monitoring outport 1 of block Sum1 as an assertion named MyAssertionTimer into system cruise/Plant of model cruise.slx. The target expects the output of Sum1 to range from 0-100 in step increments of size 1.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiAddUserTargetDiagram

Add a diagram-based user-defined target.

Syntax

rsRsiAddUserTargetDiagram(rsiId, systemName, targetName, enabled,
                          objSystemPath, objParameters, inputWiring)

Description

rsRsiAddUserTargetDiagram(rsiId, systemName, targetName, enabled, objSystemPath, objParameters, inputWiring) adds the Simulink subsystem specified by objSystemPath as a user-defined target to a .rsi file. The parameters to this function act as follows:

  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • systemName identifies the subsystem within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the new assertion will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2.
  • targetName is the name to be used for the user-defined target. An error is raised if a Simulink block or Reactis assertion or user-defined target with the same name already exists in systemName.
  • enabled sets the enabled/disabled status of the user-defined target (1 for enabled, 0 for disabled)
  • objSystemPath is a Simulink system path specifying the location of the subsystem that is to be used as the target. It is given in Simulink notation: libname/subsys1/subsys2
  • objParameters is a cell array of string pairs specifying values for parameters for the target:
      {{'PARAM1', 'VALUE1'}, {'PARAM2', 'VALUE2'}, ...}
    
    where the PARAM names correspond to prompts of the inserted system's mask (if any) and the VALUE elements specify their respective values.
  • inputWiring is a cell array of string pairs specifying connections for the target's input ports:
      {{'INPUT1', 'BLOCK1:PORT'}, {'INPUT2', 'BLOCK1:PORT'}, ...}
    
    where the INPUT names specify names of the inserted system's input ports, and the BLOCK:PORT elements specify block name and port numbers to which the target input ports will be connected.

Examples

  rsRsiAddUserTargetDiagram(rsi, 'cruise', 'LowSpeedOn', 1, ...
                            'cruise_validator/User-defined target:  LowSpeedOn', {}, ...
                            {{'onOff', 'onOff:1'}, {'speed', 'Plant:1'}})
Takes subsystem cruise_validator/User-defined target: LowSpeedOn from the cruise_validator.slx library and inserts it into the top-level system within model cruise.slx as a user-defined target. There are no parameters. The target's input port named onOff will be connected to the first output port of model block onOff. The target's input port named speed will be connected to the first output port of model block Plant.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiAddUserTargetExpression

Add an expression-based user-defined target.

Syntax

rsRsiAddUserTargetExpression(rsiId, systemName, targetName, enabled,
                             hold, expression, inputWiring)

Description

rsRsiAddUserTargetExpression(rsiId, systemName, targetName, enabled, hold, expression, inputWiring) adds the user-defined target specified by expression to an .rsi file. The parameters to this function act as follows:

  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • systemName identifies the subsystem within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the new assertion will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2.
  • targetName is the name to be used for the user-defined target. An error is raised if a Simulink block or Reactis assertion or user-defined target with the same name already exists in systemName.
  • enabled sets the enabled/disabled status of the user-defined target (1 for enabled, 0 for disabled).
  • hold specifies the number of (sequential) steps the expression must evaluate to true before the target is covered.
  • expression is a c-like expression that evaluates to a non-zero value when the target is covered. See Section 9.3.1 in the Reactis User's Guide for a description of the expression syntax.
  • inputWiring is a cell array of string pairs specifying connections for the target's variables:
      {{'VAR1', 'BLOCK1:PORT'}, {'VAR2', 'BLOCK1:PORT'}, ...}
    
    where the VAR names specify variables used in the expression and the BLOCK:PORT elements specify block name and port numbers to which the target variables will be connected.

Examples

rsRsiAddUserTargetExpression(rsi, 'cruise', 'Active_30', 1, 30, ...
                                    'x1 == 1', {{'x1', 'CruiseMain:1'}})
Adds expression 'x1 == 1' as a user-defined target named 'Active_30' into the top-level system of model cruise.slx. The condition 'x1==1' must hold for at least 30 steps before the Active_30 is counted as covered. The assertion's variable named x1 will be connected to the first output port of model block CruiseMain.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiAddUserTargetTimer

Add a timer-based user-defined target.

Syntax

rsRsiAddUserTargetTimer(rsiId, systemName, targetName, enabled,
                        connection, start, step, end)

Description

rsRsiAddUserTargetTimer(rsiId, systemName, targetName, enabled, connection, start, step, end) adds a timer target to an .rsi file. The parameters to this function act as follows:

  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • systemName identifies the subsystem within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the new target will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2.
  • targetName is the name to be used for the user-defined target. An error is raised if a Simulink block or Reactis assertion or user-defined target with the same name already exists in systemName.
  • enabled sets the enabled/disabled status of the user-defined target (1 for enabled, 0 for disabled).
  • connection specifies the name and output port number of the block to be monitored as a timer. This string must must be formed as 'BLOCKNAME:PORTNUMBER'.
  • start is the timer start value.
  • step is the timer step size.
  • end is the timer end value.

Examples

rsRsiAddUserTargetTimer(rsi, 'cruise/Plant', 'MyTimer', 1, 'Sum1:1', 0, 1, 100)
Adds a timer monitoring outport 1 of block Sum1 as a timer target named MyTimer into system cruise/Plant of model cruise.slx. The target expects the output of Sum1 to increase from 0 to 100 in step increments of one.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiAddStateflowAssertionExpression

Add an expression assertion.

Syntax

rsRsiAddStateflowAssertionExpression(rsiId, stateName, assertionName, enabled,
                                     hold, expression, actionType)

Description

rsRsiAddStateflowAssertionExpression(rsiId, state, assertionName, enabled, hold, expression, actionType) adds the expression specified by expression as an Stateflow assertion in an .rsi file identified. The parameters to this function act as follows:

  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • stateName identifies the Stateflow state within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the new target will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2/.../stateA/stateB....
  • assertionName is the name to be used for the assertion. An error is raised if a Reactis assertion or user-defined target with the same name already exists in stateName.
  • enabled sets the enabled/disabled status of the assertion (1 for enabled, 0 for disabled).
  • hold specifies the number of (sequential) steps the expression must evaluate to false before the assertion is violated.
  • expression is a c-like expression that evaluates to zero when the assertion is violated. See Section 9.3.1 in the Reactis User's Guide for a description of the expression syntax.
  • actionType is a string that specifies the point of execution at which assertion is tested. The possible values for the argument are:
    actionType valuePoint of execution
    entry when entering the state in which the assertion is located.
    during if the state in which the assertion is located is active at the start and end of a simulation step.
    exit when exiting the state in which the assertion is located.
    chartentry when execution moves to the chart in which the assertion is located.
    chartexit when execution moves away from the chart in which the assertion is located.

Examples

rsRsiAddStateflowAssertionExpression(rsi, ...
                                     'cruise/CruiseMain/CruiseMDL/Mode/On/Active', ...
                                     'activeExit', 1, 0, 'deactivate==0', 'during')
adds expression 'deactivate==0' as an assertion named activeExit into state On/Active in Stateflow chart cruise/CruiseMain/CruiseMDL/Mode of model cruise.slx. The assertion will be tested at every simulation step in which state On/Active is active at the start and end of a step.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiAddStateflowAssertionTimer

Add a timer assertion.

Syntax

rsRsiAddStatflowAssertionTimer(rsiId, stateName, timerName, enabled,
                               connection, start, step, end)

Description

rsRsiAddStatflowAssertionTimer(rsiId, stateName, timerName, enabled,
                               connection, start, step, end)
adds a timer assertion to an .rsi file. The parameters to this function act as follows:
  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • stateName identifies the Stateflow state within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the new target will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2/.../stateA/stateB....
  • timerName is the name to be used for the assertion. An error is raised if a Reactis assertion or user-defined target with the same name already exists in stateName.
  • enabled sets the enabled/disabled status of the assertion (1 for enabled, 0 for disabled)
  • connection specifies the Stateflow variable to be monitored as a timer.
  • start is the timer start value.
  • step is the timer step size.
  • end is the timer end value.

Examples

rsRsiAddStateflowAssertionTimer(rsiId, 'gasStation/main/pump/On/Enabled/waitCcCheck', ... 
                                'assertion1', 1, 'ccWait', 0, 1, 52);
adds a timer monitoring Stateflow variable ccWait as an assertion named assertion1 into state On/Enabled/waitCcCheck within Stateflow chart gasStation/main/pump in model gasStation.slx. The assertion expects the output of ccWait to increase from 0 to 52 in step increments of one.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram,rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiAddStateflowUserTargetExpression

Add an expression-based user-defined target.

Syntax

rsRsiAddStateflowUserTargetExpression(rsiId, stateName, targetName, enabled,
                                      hold, expression, actionType)

Description

rsRsiAddStateflowUserTargetExpression(rsiId, stateName, targetName, enabled,
                                      hold, expression, actionType)
adds a user-defined target specified by expression to an .rsi file. The parameters to this function act as follows:
  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • stateName identifies the Stateflow state within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the new target will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2/.../stateA/stateB....
  • targetName is the name to be used for the user-defined target. An error is raised if a Reactis assertion or user-defined target with the same name already exists in stateName.
  • enabled sets the enabled/disabled status of the user-defined target (1 for enabled, 0 for disabled).
  • hold specifies the number of (sequential) steps the expression must evaluate to true before the target is covered.
  • expression is a c-like expression that evaluates to non-zero when the target is covered. See Section 9.3.1 in the Reactis User's Guide for a description of the expression syntax.
  • actionType specifies the point of execution at which the target is tested. It is a string with one of the following values:
    entry when entering the state in which it is located
    during while the state in which it is located is active
    exit when exiting the state in which it is located
    chartentry when execution moves to the chart in which it is located
    chartexit when execution moves away from the chart in which it is located

Examples

rsRsiAddStateflowUserTargetExpression(rsiId, 'cruise/CruiseMain/CruiseMDL/Mode/On/Active', ...
                                      'deactivateExit', 1, 0, 'deactivate!=0', 'exit');
Adds expression deactivate!=0 as a user-defined target named deactivateeExit into state On/Active in Stateflow chart cruise/CruiseMain/CruiseMDL/Mode of model cruise.slx. The user-defined target will be tested at every step where state On/Active is exited.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetTimer


rsRsiAddStateflowUserTargetTimer

Add a timer-based user-defined target.

Syntax

rsRsiAddStateflowUserTargetTimer(rsiId, stateName, timerName, enabled,
                                 connection, start, step, end)

Description

rsRsiAddStateflowUserTargetTimer(rsiId, stateName, targetName, enabled,
                                 connection, start, step, end)
adds a timer target to the .rsi file identified by rsiId. The parameters to this function act as follows:
  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • stateName identifies the Stateflow state within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the new timer target will reside. The location is specified as a path using the standard Simulink notation, e.g. modelname/subsys1/subsys2/.../stateA/stateB....
  • timerName is the name to be used for the timer target. An error is raised if a Reactis assertion or user-defined target with the same name already exists in stateName.
  • enabled sets the enabled/disabled status of the user-defined target (1 for enabled, 0 for disabled).
  • connection specifies the Stateflow variable to be monitored as a timer.
  • start is the timer start value.
  • step is the timer step size.
  • end is the timer end value.

Examples

rsRsiAddStateflowUserTargetTimer(rsi, 'gasStation/main/pump/On/Enabled/waitCcCheck', ...
                                 'timer1', 1, 'ccWait', 0, 1, 51);
Adds a timer monitoring Stateflow variable ccWait as a timer target named timer1 into state On/Enabled/waitCcCheck within Stateflow chart gasStation/main/pump in model gasStation.slx. The target expects the output of ccWait to increase from 0 to 51 in increments of 1.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram,rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression


rsRsiAddVirtualSourceDiagram

Add a diagram-based virtual source.

Syntax

rsRsiAddVirtualSourceDiagram(rsiId, systemName, virtualSourceName, enabled,
                             objectiveSystemPath, objectiveParameters,
                             inputWiring, outputWiring)

Description

rsRsiAddVirtualSourceDiagram(rsiId, systemName, virtualSourceName, enabled,
                             objectiveSystemPath, objectiveParameters,
                             inputWiring, outputWiring)
adds the Simulink subsystem specified by objectiveSystemPath as an virtual source to an .rsi file. The parameters to this function act as follows:
  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • systemName identifies the subsystem within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the virtual source will reside. Note: Virtual sources must be placed in the top-level system of the model, so this argument will simply be modelname.
  • virtualSourceName is the name to be used for the virtual source. An error is raised if a Simulink block or Reactis assertion or user-defined target with the same name already exists in systemName.
  • enabled sets the enabled/disabled status of the virtual source (1 for enabled, 0 for disabled).
  • objectiveSystemPath is a Simulink system path specifying the location of the subsystem that is to be used as the virtual source. It is given in Simulink notation: libname/subsys1/subsys2.
  • objectiveParameters is a cell array of string pairs specifying values for parameters for the virtual source: {{'PARAM1', 'VALUE1'}, {'PARAM2', 'VALUE2'}, ...} where the PARAM names correspond to prompts of the inserted system's mask (if any) and the VALUE elements specify their respective values.
  • inputWiring is a cell array of string pairs specifying connections for the virtual source's input ports: {{'INPUT1', 'BLOCK1:PORT'}, {'INPUT2', 'BLOCK2:PORT'}, ...} where the INPUT names specify names of the virtual source's input ports, and the BLOCK:PORT elements specify block name and port numbers to which those input ports will be connected.
  • outputWiring is a cell array of string pairs specifying connections for the virtual source's output ports: {{'OUTPUT1', 'INPORT1'}, {'OUTPUT2', 'INPORT2'}, ...} where the OUTPUT names specify names of the virtual source's output ports, and the INPORT elements specify block names of top-level inports of the model to which the outputs will be connected.

Examples

rsRsiAddVirtualSourceDiagram(rsiId, 'cruise', 'ActiveCheckScenario', 1, ...
                             'cruise_validator/ActiveCheckScenario', {}, {}, ...
                             {{'onOff', 'onOff'}, {'accelResume', 'accelResume'}, ...
                             {'cancel', 'cancel'}, {'decelSet', 'decelSet'}, ...
                             {'brake', 'brake'}, {'gas', 'gas'}});
Takes subsystem cruise_validator/ActiveCheckScenario from the cruise_validator.slx library and inserts at the top level of the model cruise.slx as a virtual source. There are no parameters and no inputs to the virtual source. Each of the virtual source's output ports onOff, accelResume, cancel, decelSet, brake and gas will be connected to a top-level model input port of the same name.

See Also

rsRsiOpen, rsRsiAddVirtualSourceExpression


rsRsiAddVirtualSourceExpression

Add an expression-based virtual source.

Syntax

rsRsiAddVirtualSourceExpression(rsiId, systemName, virtualSourceName, enabled,
                                expression, inputWiring, outputWiring)

Description

rsRsiAddVirtualSourceExpression(rsiId, systemName, virtualSourceName, enabled,
                                expression, inputWiring, outputWiring)
adds the virtual source specified by expression to an .rsi file. The parameters to this function act as follows:
  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • systemName identifies the subsystem within the model (the model that was given as an argument to rsRsiOpen to create rsiId) where the virtual source will reside. Note: Virtual sources must be placed in the top-level system of the model, so this argument will simply be modelname.
  • virtualSourceName is the name to be used for the virtual source. An error is raised if a Simulink block or Reactis assertion or user-defined target with the same name already exists in systemName.
  • enabled sets the enabled/disabled status of the virtual source (1 for enabled, 0 for disabled).
  • expression is a c-like expression that evaluates to the intended input value for the connected input port. See Section 9.3.1 in the Reactis User's Guide for a description of the expression syntax.
  • inputWiring is a cell array of string pairs specifying connections for the virtual source's variables: {{'VAR1', 'BLOCK1:PORT'}, {'VAR2', 'BLOCK2:PORT'}, ...} where the VAR names specify names of the variables in expression, and the BLOCK:PORT elements specify block name and port numbers to which the variables will be connected.
  • outputWiring specifies the name of the top-level input port that the virtual source will control.

Examples

rsi = rsRsiOpen('cruise.rsi','cruise.slx');
rsRsiAddVirtualSourceExpression(rsiId, 'cruise', 'dragSource', 1, ...
                                'speed/100', {{'speed', 'Plant:1'}}, 'drag');
Adds expression 'speed/100' as a virtual source named dragSource into cruise.rsi an .rsi file for model cruise.slx. The virtual source's variable named speed will be connected to the first output port of model block named Plant. The result of evaluating the expression will be fed into the model's top-level input port named drag.

See Also

rsRsiOpen, rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer


rsRsiGetObjectiveParameterValue

Get the value of a Validator objective parameter.

Syntax

rsRsiGetObjectiveParameterValue(rsiId, objId, paramName)

Description

rsRsiGetObjectiveParameterValue(rsiId, objId, paramName)
retrieves the parameter whose name matches paramName from the objective identified by objId.
  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • rsiId identifies the .rsi file containing the test point.
  • objId must be an objective id returned by rsRsiQueryObjectives.
  • The following parameters are available:
    Name Name of the Validator objective
    Location Location of the Validator objective, in Simulink notation: model/subsys1/subsys2
    Type Type of the objective (expression/diagram, target/assertion)
    InputConnections Returns an array of structures giving the input names of the objective and the block:port to which it is connected.
    OutputConnections Returns an array of structures giving the output names of the objective and the block:port to which it is connected. This only applies to virtual source objectives.

See Also

rsRsiOpen, rsRsiQueryObjectives


rsRsiQueryObjectives

Get Validator objectives in an .rsi file.

Syntax

 rsRsiQueryObjectives(rsiIds, system)

Description

objIds = rsRsiQueryObjectives(rsiId)
returns an array containing a list of integer identifiers for Validator objectives specified in the .rsi file identified by rsiId. These identifiers are used when calling the rsRsiGetObjectiveParameterValue function.

objIds = rsRsiQueryObjectives (rsiIds, system)
same as above but limits the objectives returned to those located in system, where system is given in Simulink notation: model/subsys1/subsys2.

See Also

rsRsiOpen, rsRsiGetObjectiveParameterValue


rsRsiRemoveObjective

Remove a Validator objective from an .rsi file.

Syntax

rsRsiRemoveObjective(rsiId, system, name)

Description

rsRsiRemoveObjective(rsiId, system, name)
adds a user-defined target specified by expression to an .rsi file. The parameters to this function act as follows:
  • rsiId is the identifier of an .rsi file previously opened by rsRsiOpen.
  • system is a system path within the model corresponding to the .rsi file, given in Simulink notation: modelname/subsys1/subsys2/.../stateA/stateB...
  • name is the name of the objective to be removed. An error is raised if no objective with this name exists in system.

Examples

rsRsiRemoveObjective(rsiId, 'cruise', 'Active_30');
Removes objective named 'Active_30' from system 'cruise'.

See Also

rsRsiOpen,rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowAssertionTimer, rsRsiAddStateflowUserTargetTimer



Spacer