7. Reactis Info File - Harness#

7.1. rsRsiAddHarness#

Add a harness to an .rsi file.

7.1.1. Syntax#

rsRsiAddHarness(rsiId,harnessName,system)

7.1.2. Description#

rsRsiAddHarness(rsiId,harnessName,system)

Creates a new harness named harnessName and adds it to the .rsi file identified by rsiId.

The system parameter specifies the system under test for the new harness. The path is given as a list of systems separated by the “/” character. For example, sys1/sys2/sys3 specifies that system “sys3” (located within sys1/sys2) is the system under test.

The currently active harness is not changed when rsRsiAddHarness is called. To use the new harness, call rsRsiSetCurrentHarness(rsiId, harnessName).

7.1.3. Examples#

>> rsRsiRAddHarness(rsiId, 'CruiseMain', 'cruise/CruiseMain');

7.1.4. See Also#

rsRsiRemoveHarness, rsRsiSetCurrentHarness, rsRsiGetCurrentHarness, rsRsiGetHarnesses, rsRsiGetHarnessParameterValue, rsRsiSetHarnessParameterValue

7.2. rsRsiRemoveHarness#

Remove a harness from an .rsi file.

7.2.1. Syntax#

rsRsiRemoveHarness(rsiId,harnessName)

7.2.2. Description#

rsRsiRemoveHarness(rsiId,harnessName)

removes the harness named harnessName from the file identified by rsiId.

The currently active harness and the (default) harness for the model’s top-level system can not be removed.

7.2.3. Examples#

>> rsRsiRemoveHarness(rsiId, 'CruiseMain');

7.2.4. See Also#

rsRsiAddHarness, rsRsiSetCurrentHarness, rsRsiGetCurrentHarness, rsRsiGetHarnesses, rsRsiGetHarnessParameterValue, rsRsiSetHarnessParameterValue

7.3. rsRsiSetCurrentHarness#

Set the currently active harness in the .rsi file

7.3.1. Syntax#

rsRsiSetCurrentHarness(rsiId,harnessName)

7.3.2. Description#

rsRsiSetCurrentHarness(rsiId,harnessName)

sets the harness named harnessName as the currently active harness in the file identified by rsiId.

The currently active harness setting affects all calls to API functions that read or modify information about inputs or outputs, such as rsRsiSetInputType, rsRsiGetInputType, rsRsiSetOutputTolerance and similar. Those functions will operate on inputs/outputs of the system specified for the harness.

To activate the (default) harness for the model’s top-level system, use “TopLevel” as the harness name.

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.

7.3.3. Examples#

>> harnesses = rsRsiSetCurrentHarnesss(rsiId, 'CruiseMain');

7.3.4. See Also#

rsRsiAddHarness, rsRsiRemoveHarness, rsRsiGetCurrentHarness, rsRsiGetHarnesses, rsRsiGetHarnessParameterValue, rsRsiSetHarnessParameterValue, rsRsiSave

7.4. rsRsiGetCurrentHarness#

Get the name of the currently active harness.

7.4.1. Syntax#

rsRsiGetCurrentHarness(rsiId)

7.4.2. Description#

rsRsiGetCurrentHarness(rsiId)

returns the name of the currently active harness in the file identified by rsiId. If the (default) harness for the model’s top-level system is active, the name “TopLevel” will be returned.

The currently active harness setting affects all calls to API functions that read or modify information about input or output types, such as rsRsiSetInputType, rsRsiGetInputType, rsRsiSetOutputTolerance and similar. Those functions will operate on inputs/outputs of the system specified for the harness.

7.4.3. Examples#

>> rsRsiGetCurrentHarnesss(rsiId)
ans = 
    'TopLevel'

7.4.4. See Also#

rsRsiAddHarness, rsRsiRemoveHarness, rsRsiSetCurrentHarness, rsRsiGetHarnesses, rsRsiGetHarnessParameterValue, rsRsiSetHarnessParameterValue

7.5. rsRsiGetHarnesses#

Get the a list of all harnesses defined in an .rsi file.

7.5.1. Syntax#

rsRsiGetHarnesses(rsiId)

7.5.2. Description#

rsRsiGetHarnesses(rsiId)

returns a cell array of strings listing all harnesses defined in the file identified by rsiId. The list will include the entry “TopLevel”, which is the name of the (default) harness for the model’s top-level system.

7.5.3. Examples#

>> harnesses = rsRsiGetHarnessses(rsiId);
>> harnesses(1) 
ans = 
    'TopLevel'

7.5.4. See Also#

rsRsiAddHarness, rsRsiRemoveHarness, rsRsiSetCurrentHarness, rsRsiGetCurrentHarness, rsRsiGetHarnessParameterValue

7.6. rsRsiGetHarnessParameterValue#

Get the value of a harness parameter

7.6.1. Syntax#

rsRsiGetHarnessParameterValue(rsiId, harnessName, parameterName)

7.6.2. Description#

rsRsiGetHarnesssParameterValue(rsiId, harnessName, parameterName)

returns the value of harness parameter parameterName in harness harnessName in the file identified by rsiId.

Currently valid harness parameters are:

Name

Description

System

The system under test that was specified when the harness was created.

SampleRate

A string containing the sample rate (in seconds) of the harness. A negative value means the harness uses the same sample rate as the model.

7.6.3. Examples#

>> rsRsiGetHarnesssParameterValue(rsiId, 'TopLevel', 'SampleRate') 
ans = 
    1.0
>> rsRsiGetHarnesssParameterValue(rsiId, 'CruiseMain', 'System') 
ans = 
    'cruise/CruiseMain'

7.6.4. See Also#

rsRsiAddHarness, rsRsiRemoveHarness, rsRsiSetCurrentHarness, rsRsiGetCurrentHarness, rsRsiGetHarnesses, rsRsiSetHarnessParameterValue

7.7. rsRsiSetHarnessParameterValue#

Set the value of a harness parameter.

7.7.1. Syntax#

rsRsiSetHarnessParameterValue(rsiId, harnessName, parameterName, parameterValue)

7.7.2. Description#

rsRsiSetHarnesssParameterValue(rsiId, harnessName, parameterName, parameterValue)

sets the value of harness parameter parameterName in harness harnessName in the file identified by rsiId to parameterValue.

Currently valid harness parameters for modification are:

Name

Description

SampleRate

A string containing the sample rate (in seconds) for the harness. A negative value means the harness will use the same sample rate as the model. A value of zero is not allowed.

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.

7.7.3. Examples#

>> rsRsiSetHarnessParameterValue(rsiId, 'TopLevel', 'SampleRate','1.0');

7.7.4. See Also#

rsRsiAddHarness, rsRsiRemoveHarness, rsRsiSetCurrentHarness, rsRsiGetCurrentHarness, rsRsiGetHarnesses, rsRsiGetHarnessParameterValue, rsRsiSave