16. Reactis Info File - Validator Objectives#

16.1. rsRsiAddAssertionDiagram#

Add a diagram assertion to an .rsi file.

16.1.1. Syntax#

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

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

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

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

16.1.4. See Also#

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

16.2. rsRsiAddAssertionExpression#

Add an expression assertion.

16.2.1. Syntax#

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

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

  • 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 the The Simulink Expression Objective Dialog section 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.

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

16.2.4. See Also#

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

16.3. rsRsiAddAssertionTimer#

Add a timer assertion.

16.3.1. Syntax#

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

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

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

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

16.3.4. See Also#

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

16.4. rsRsiAddUserTargetDiagram#

Add a diagram-based user-defined target.

16.4.1. Syntax#

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

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

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

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

16.4.4. See Also#

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

16.5. rsRsiAddUserTargetExpression#

Add an expression-based user-defined target.

16.5.1. Syntax#

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

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

  • 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 the The Simulink Expression Objective Dialog section 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.

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

16.5.4. See Also#

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

16.6. rsRsiAddUserTargetTimer#

Add a timer-based user-defined target.

16.6.1. Syntax#

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

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

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

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

16.6.4. See Also#

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

16.7. rsRsiAddStateflowAssertionExpression#

Add an expression assertion.

16.7.1. Syntax#

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

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

  • 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 the The Simulink Expression Objective Dialog section 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 value

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

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

16.7.4. See Also#

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

16.8. rsRsiAddStateflowAssertionTimer#

Add a timer assertion.

16.8.1. Syntax#

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

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

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

16.8.3. 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, rsRsiSave, rsRsiAddAssertionDiagram, rsRsiAddAssertionExpression, rsRsiAddAssertionTimer, rsRsiAddUserTargetDiagram, rsRsiAddUserTargetExpression, rsRsiAddUserTargetTimer, rsRsiAddVirtualSourceDiagram, rsRsiAddVirtualSourceExpression, rsRsiAddStateflowAssertionExpression, rsRsiAddStateflowUserTargetExpression, rsRsiAddStateflowUserTargetTimer

16.9. rsRsiAddStateflowUserTargetExpression#

Add an expression-based user-defined target.

16.9.1. Syntax#

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

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

  • 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 the The Simulink Expression Objective Dialog section 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

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

16.9.4. See Also#

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

16.10. rsRsiAddStateflowUserTargetTimer#

Add a timer-based user-defined target.

16.10.1. Syntax#

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

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

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

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

16.10.4. See Also#

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

16.11. rsRsiAddVirtualSourceDiagram#

Add a diagram-based virtual source.

16.11.1. Syntax#

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

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

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

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

16.11.4. See Also#

rsRsiOpen, rsRsiSave, rsRsiAddVirtualSourceExpression

16.12. rsRsiAddVirtualSourceExpression#

Add an expression-based virtual source.

16.12.1. Syntax#

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

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

  • 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 the The Simulink Expression Objective Dialog section 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.

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

16.12.4. See Also#

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

16.13. rsRsiGetObjectiveParameterValue#

Get the value of a Validator objective parameter.

16.13.1. Syntax#

rsRsiGetObjectiveParameterValue(rsiId, objId, paramName)

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

16.13.3. See Also#

rsRsiOpen, rsRsiQueryObjectives

16.14. rsRsiQueryObjectives#

Get Validator objectives in an .rsi file.

16.14.1. Syntax#

 rsRsiQueryObjectives(rsiIds, system)

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

16.14.3. See Also#

rsRsiOpen, rsRsiGetObjectiveParameterValue

16.15. rsRsiRemoveObjective#

Remove a Validator objective from an .rsi file.

16.15.1. Syntax#

rsRsiRemoveObjective(rsiId, system, name)

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

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

16.15.3. Examples#

rsRsiRemoveObjective(rsiId, 'cruise', 'Active_30');

Removes objective named ‘Active_30’ from system ‘cruise’.

16.15.4. See Also#

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