Reactive Systems logo
Reactis API V2020

API - Reactis for C: MATLAB Bindings - Reactis Harness Library (Harnesses)

rcRshGetHarnessesGet a list of harnesses stored in an .rsh file.
rcRshHarnessCopyCopy a test harness.
rcRshHarnessCreateCreate a test harness.
rcRshHarnessImportImport a test harness from an .rsi file.
rcRshHarnessGetEntryFunFullNameGet the full name of the entry function used by a test harness.
rcRshHarnessGetEntryFunNameGet the name of the entry function used by a test harness.
rcRshHarnessGetNameGet the name of a test harness.
rcRshHarnessGetSampleRateGet the sample rate of a test harness.
rcRshHarnessGetVarsGet the variables used by a test harness.
rcRshHarnessSetSampleRateSet the sample rate of a test harness.
rcRshHarnessSyncSynchronize types between a test harness and associated program.


rcRshGetHarnesses

Get a list of harnesses stored in an .rsh file.

Syntax

harnessIds = rcRshGetHarnesses(rshFile)

Description

harnessIds = rcRshGetHarnesses(rshFile) returns a cell array containing a list of id numbers for each harness stored in the .rsh file. Each harness id number is an integer-valued double.

See Also

rcRshOpen


rcRshHarnessCopy

Copy a test harness.

Syntax

newHarnessId = rcRshHarnessCopy(harnessId,newName)
newHarnessId = rcRshHarnessCopy(harnessId,newName,newEntry)

Description

newHarnessId = rcRshHarnessCopy(harnessId,newName) creates a new harness with the name given by newName. All other properties are copied from the harness identified by harnessId. The id of the new harness is returned.

newHarnessId = rcRshHarnessCopy(harnessId,newName,newEntry) creates a new harness with the name given by newName and entry function given by newEntry. All other properties are copied from the harness identified by harnessId. newEntry should be one of the strings returned by rcRshGetEntryFunCandidates. The id of the new harness is returned.

See Also

rcRshGetEntryFunCandidates


rcRshHarnessCreate

Create a test harness.

Syntax

harnessId = rcRshHarnessCreate(rshId,harnessName,entry)
harnessId = rcRshHarnessCreate(rshId,harnessName,entry,init)

Description

harnessId = rcRshHarnessCreate(rshId,harnessName,entry) creates a new test harness with name harnessName and entry function entry. entry should be one of the strings returned by rcRshGetEntryFunCandidates, the id of the new harness returned.

harnessId = rcRshHarnessCreate(rshId,harnessName,entry,init) creates a new test harness with name harnessName, entry function entry, and initialization function init. entry should be one of the strings returned by rcRshGetEntryFunCandidates. init should be one of the strings returned by rcRshGetInitFunCandidates, the id of the new harness returned.

See Also

rcRshOpen,rcRshGetEntryFunCandidates,rcRshGetInitFunCandidates


rcRshHarnessImport

Import a test harness from an .rsi file.

Syntax

harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName)
harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap)
harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap,initName)

Description

harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName) creates a test harness with name harnessName and entry function entryName. The input, output, and configuration variables of the new harness are imported from the .rsi file named by rsiFilename. The new harness is added to the library identified by rshId. The id number of the new harness is returned.

harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap) creates a test harness with name harnessName and entry function entryName. The input, output, and configuration variables of the new harness are imported from the .rsi file named by rsiFilename using the name mapping supplied by nameMap. The new harness is added to the library identified by rshId. The id number of the new harness is returned.

harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap,initName) creates a test harness with name harnessName, entry function entryName, and initialization function initName. The input, output, and configuration variables of the new harness are imported from the .rsi file named by rsiFilename using the name mapping supplied by nameMap. The new harness is added to the library identified by rshId. The id number of the new harness is returned.

nameMap is a structure which can contain 1 or more of the following fields:

input.code.prefix Prefix of input names in the C code
input.code.suffix Suffix of input names in the C code
input.harness.prefix Prefix of input names in the test harness
input.harness.suffix Suffix of input names in the test harness
output.code.prefix Prefix of output names in the C code
output.code.suffix Suffix of output names in the C code
output.harness.prefix Prefix of output names in the test harness
output.harness.suffix Suffix to output names in the test harness
config.code.prefix Prefix of configuration variable names in the C code
config.code.suffix Suffix of configuration variable names in the C code
config.harness.prefix Prefix of configuration variable names in the test harness
config.harness.suffix Suffix of configuration variable names in the test harness

Examples

nameMap.input.code.prefix  = 'cruise_U.';
nameMap.output.code.prefix = 'cruise_Y.';
nameMap.config.code.prefix = 'cruise_P.';

See Also

rcRshOpen


rcRshHarnessGetEntryFunFullName

Get the full name of the entry function used by a test harness.

Syntax

fullName = rcRshHarnessGetEntryFunFullName(harnessId) 

Description

fullName = rcRshHarnessGetEntryFunFullName(harnessId) returns the full name of the entry function used by the test harness identified by harnessId.

See Also

rcRshOpen, rcRshGetHarnesses


rcRshHarnessGetEntryFunName

Get the name of the entry function used by a test harness.

Syntax

name = rcRshHarnessGetEntryFunName(harnessId)

Description

name = rcRshHarnessGetEntryFunName(harnessId) returns the name of the entry function used by the test harness whose id matches harnessId.

See Also

rcRshOpen, rcRshHarnessCreate, rcRshHarnessCopy


rcRshHarnessGetName

Get the name of a test harness.

Syntax

name = rcRshHarnessGetName(harnessId)

Description

name = rcRshHarnessGetName(harnessId) returns the name of the test harness identified by harnessId.

See Also

rcRshOpen, rcRshGetHarnesses


rcRshHarnessGetSampleRate

Get the sample rate of a test harness.

Syntax

rcRshHarnessGetSampleRate(harnessId)

Description

rcRshHarnessGetSampleRate(harnessId) returns the sample rate of the test harness identified by harnessId.

See Also

rcRshOpen, rcRshGetHarnesses, rcRshHarnessSetSampleRate


rcRshHarnessGetVars

Get the variables used by a test harness.

Syntax

varIds = rcRshHarnessGetVars(harnessId,varKind)

Description

varIds = rcRshHarnessGetVars(harnessId,varKind) returns an array containing the id number of every variable whose kind matches varKind. kind should be one of the following: RcInputVar, RcOutputVar, RcConfigVar. Each variable id number is an integer-valued double.

See Also

rcRshOpen, rcRshHarnessAddVar, rcRshVarDelete


rcRshHarnessSetSampleRate

Set the sample rate of a test harness.

Syntax

rcRshHarnessSetSampleRate(harnessId,rate)

Description

rcRshHarnessSetSampleRate(harnessId,rate) sets the sample rate of the test harness identified by harnessId to rate. Rate should be a positive real number.

See Also

rcRshOpen, rcRshHarnessGetSampleRate


rcRshHarnessSync

Synchronize types between a test harness and associated program.

Syntax

 
rcRshHarnessSync(harnessId) 

Description

rcRshHarnessSync(harnessId) reads inport names and types from the associated program (given in the rcRshOpen call) and updates the .rsh file accordingly:

  • If an input or output exists in the program but not the .rsh file, it is added to the .rsh file.
  • If an input, output, or configuration variable exists in the .rsh file but not in the program, it is removed from the .rsh file.
  • If an input, output, or configuration variable exists in both the .rsh file and the program, and the types given in both match, no changes are made.
  • If an input, output, or configuration variable exists in both the .rsh file and the program, and the types given in both differ, the type in the .rsh file is set to match the type in the program. If any type restrictions were set for that input in the .rsh file, the restrictions are removed.

Any changes made by rcRshHarnessSync will be saved to disk during the next call to rcRshSave.

See Also

rcRshOpen, rcRshSave