8. Reactis Harness Library - Harnesses#
8.1. rcRshGetHarnesses#
Get a list of harnesses stored in an .rsh file.
8.1.1. Syntax#
harnessIds = rcRshGetHarnesses(rshFile)
8.1.2. 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.
8.1.3. See Also#
8.2. rcRshHarnessCopy#
Copy a test harness.
8.2.1. Syntax#
newHarnessId = rcRshHarnessCopy(harnessId,newName)
newHarnessId = rcRshHarnessCopy(harnessId,newName,newEntry)
8.2.2. 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.
8.2.3. See Also#
8.3. rcRshHarnessCreate#
Create a test harness.
8.3.1. Syntax#
harnessId = rcRshHarnessCreate(rshId,harnessName,entry)
harnessId = rcRshHarnessCreate(rshId,harnessName,entry,init)
8.3.2. 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.
8.3.3. See Also#
rcRshOpen, rcRshGetEntryFunCandidates, rcRshGetInitFunCandidates
8.4. rcRshHarnessImport#
Import a test harness from an .rsi file.
8.4.1. Syntax#
harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName)
harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap)
harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap,initName)
8.4.2. 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 |
8.4.3. Examples#
nameMap.input.code.prefix = ‘cruise_U.’; nameMap.output.code.prefix = ‘cruise_Y.’; nameMap.config.code.prefix = ‘cruise_P.’;
8.4.4. See Also#
8.5. rcRshHarnessGetEntryFunFullName#
Get the full name of the entry function used by a test harness.
8.5.1. Syntax#
fullName = rcRshHarnessGetEntryFunFullName(harnessId)
8.5.2. Description#
- fullName = rcRshHarnessGetEntryFunFullName(harnessId)
returns the full name of the entry function used by the test harness identified by harnessId.
8.5.3. See Also#
8.6. rcRshHarnessGetEntryFunName#
Get the name of the entry function used by a test harness.
8.6.1. Syntax#
name = rcRshHarnessGetEntryFunName(harnessId)
8.6.2. Description#
- name = rcRshHarnessGetEntryFunName(harnessId)
returns the name of the entry function used by the test harness whose id matches harnessId.
8.6.3. See Also#
8.7. rcRshHarnessGetName#
Get the name of a test harness.
8.7.1. Syntax#
name = rcRshHarnessGetName(harnessId)
8.7.2. Description#
- name = rcRshHarnessGetName(harnessId)
returns the name of the test harness identified by harnessId.
8.7.3. See Also#
8.8. rcRshHarnessGetSampleRate#
Get the sample rate of a test harness.
8.8.1. Syntax#
rcRshHarnessGetSampleRate(harnessId)
8.8.2. Description#
- rcRshHarnessGetSampleRate(harnessId)
returns the sample rate of the test harness identified by harnessId.
8.8.3. See Also#
8.9. rcRshHarnessGetVars#
Get the variables used by a test harness.
8.9.1. Syntax#
varIds = rcRshHarnessGetVars(harnessId,varKind)
8.9.2. 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.
8.9.3. See Also#
8.10. rcRshHarnessSetSampleRate#
Set the sample rate of a test harness.
8.10.1. Syntax#
rcRshHarnessSetSampleRate(harnessId,rate)
8.10.2. Description#
- rcRshHarnessSetSampleRate(harnessId,rate)
sets the sample rate of the test harness identified by harnessId to rate. Rate should be a positive real number.
8.10.3. See Also#
8.11. rcRshHarnessSync#
Synchronize types between a test harness and associated program.
8.11.1. Syntax#
rcRshHarnessSync(harnessId)
8.11.2. 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.