|
Reactis API V2020.2
Reactis API (C Bindings): Reactis Info File (Test Points)
rsRsiGetNumTestPoints
Return the number of test points in the .rsi file.
Syntax
int rsRsiGetNumTestPoints(RsRsiFile *hRsi);
Parameters
- hRsi
- Pointer to RsiFile structure as returned by rsRsiOpen.
Return Value
Returns the number of test points in the rsi file specified by the
hRsi parameter.
rsRsiGetTestPointId
Return an identifier for a test point in the .rsi file.
Syntax
int rsRsiGetTestPointId(RsRsiFile *hRsi, int index);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
- index
- Index of the test point. This value must be greater or equal to 0
and less than the return value of rsRsiGetNumTestPoints.
Return Value
- non-negative integer
- An identifier for the test point.
- -1
- If an error occurred. In that case, call rsGetLastError
to retrieve the error message string.
rsRsiAddTestPoint
Add a new test point to the .rsi file.
Syntax
int rsRsiAddTestPoint(RsRsiFile *hRsi, const char *location);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
- location
- Location of the test point in the model. For Simulink, test
points are specified by giving the path and name of a block and an
output port number, e.g. sys1/sys2/testblock/3 adds the third output
of block "testblock" located within sys1/sys2 as a test point.
For Stateflow, test points are specified by giving the name of a
variable within a Stateflow chart, e.g.. sys1/sys2/chart/var adds
variable named "var", located within Stateflow chart "chart" which
itself is located within "sys1/sys2". For variables defined
within Stateflow sub-states, the state path must also be given,
e.g. sys1/sys2/chart/state1/state2/var.
Return Value
Pointer to a RsRsiTestPoint structure. NULL, if an error
occurred. In that case, call rsGetLastError to retrieve the
error message string. The handle will become invalid once the .rsi
file is closed or the test point is removed via
rsRsiRemoveTestPoint.
rsRsiRemoveTestPoint
Remove a test point from the .rsi file.
Syntax
int rsRsiRemoveTestPoint(RsRsiFile *hRsi, int id);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
- id
- Test point handle returned by rsRsiGetTestPointId, or
rsRsiAddTestPoint. This handle will subsequently be invalid if
rsRsiRemoveTestPoint succeeds (i.e. returns 1).
Return Value
- 0
- If an error occurred. In this case, call rsGetLastError to
get the error string.
- 1
- If no error occurred.
rsRsiClearTestPoints
Remove all test points from the .rsi file.
Syntax
int rsRsiClearTestPoints(RsRsiFile *hRsi);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
Return Value
- 0
- If an error occurred. In this case, call rsGetLastError to get
the error string.
- 1
- If no error occurred.
rsRsiImportTestPoints
Import all Simulink test points set in the model and add them as Reactis test points.
Syntax
int rsRsiImportTestPoints(RsRsiFile *hRsi, char *params);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
- params
- Additional parameter for the import function:
- -k kinds
- Kinds of test points to be imported. This is a comma-separated
list of testpoint kinds. Possible values for the entries are:
- SL
- Simulink signals with their "Testpoint" option checked
- SF
- Stateflow variables with their "Testpoint" option checked
- SLSignal
- Simulink signals that must resolve to Simulink.Signal objects
- SFSignal
- Stateflow variables that must resolve to Simulink.Signal objects
If this parameter is not given, it defaults to: -k SL,SF
Return Value
- 0
- If an error occurred. In this case, call rsGetLastError to get
the error string.
- 1
- If no error occurred.
rsRsiSyncTestPoints
Synchronize test point data types between the .rsi file and model.
If a test point exists in the .rsi file but the corresponding block or
variable can not be found in the model, the test point is removed
from the .rsi file. If the data type of the test point has changed in
the model, the new data type's full range will be set as the constraint
for the test point.
Syntax
int rsRsiSyncTestPoints(RsRsiFile *hRsi);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
Return Value
- 0
- If an error occurred. In this case, call rsGetLastError to get the error string.
- 1
- If no error occurred.
rsRsiDefaultTestPoints
Remove constraints from all test points in the .rsi file.
If a test point exists in the .rsi file but the corresponding block or
variable can not be found in the model, the test point is removed
from the .rsi file. Otherwise the model data type's full range will be
set as the constraint for the test point.
Syntax
int rsRsiDefaultTestPoints(RsRsiFile *hRsi);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
Return Value
- 0
- If an error occurred. In this case, call rsGetLastError to get
the error string.
- 1
- If no error occurred.
rsRsiSetTestPointParameterValue
Set the value of a test point parameter.
Syntax
int rsRsiSetTestPointParameterValue(RsRsiFile *hRsi, int id, const char *paramName, const char *paramValue);
Parameters
- hRsi
- Test point handle returned by rsRsiGetTestPointId
or rsRsiAddTestPoint.
- id
- Test point handle returned by rsRsiGetTestPointId or rsRsiAddTestPoint.
- paramName
- Name of the parameter. Valid names are:
- Name
- User-defined name of the test point.
- Constraint
- Sets the data type constraint for the test point. For a
description of the syntax of type constraints in .rsi
files, see Section 5.3.2
in the Reactis User's Guide.
- Capture
- Capture the data from this test point when creating test suites
(possible values are "on" or "off").
- Constrain
- If Capture is enabled, then enabling Constrain will constrain
values captured in the test suite to the constraint given
for the test point (possible values are "on" or "off").
- Compare
- Select whether to compare the value of the test point to
the value in an existing test suite when running
the suite in Simulator (possible values are "on" or "off").
- Tolerance
- Tolerance for the test point when comparing the test point
value to test suite values (only used if Compare is "on").
- Assertion
- Create an assertion that will be violated if the value of
the test point is outside the limits given for the constraint.
(possible values are "on" or "off").
- Boundary
- Track boundary coverage according to the constraint data type
(possible values are "on" or "off").
- CheckRange
- Select whether to produce an error or warning if the value
of the test point is outside the limits given for the constraint.
(possible values are "ignore" or "warning" or "error").
paramValue
New value for the parameter.
Return Value
- 0
- If an error occurred. In this case, call rsGetLastError to get
the error string.
- 1
- If no error occurred.
rsRsiGetTestPointParameterValue
Get the value of a test point parameter.
Syntax
int rsRsiGetTestPointParameterValue(
RsRsiFile *hRsi, int id, const char *paramName, char *buffer, int bufferSize);
Parameters
- hRsi
- Test point handle returned by rsRsiGetTestPointId or rsRsiAddTestPoint.
- id
- Test point handle returned by rsRsiGetTestPointId or rsRsiAddTestPoint.
- paramName
- Name of the parameter. See function rsRsiSetTestPointParameterValue for a list of possible parameters.
- buffer
- The buffer that receives the value.
The buffer's size must correspond to the value of the
bufferSize parameter. If the buffer parameter is NULL, then the
value returned by rsSuiteGetTestName will be the buffer
size required to store the whole name.
- bufferSize
- The size of the buffer passed in as the third argument. If
the actual name is longer than this value, it will be truncated
to the length of the buffer. In that case, the return value of
rsRsiGetTestPointParameterValue will be the buffer size that would be
required to receive the whole name.
Return Value
- -1
- If an error occurred. In this case, you may call rsGetLastError
to retrieve the error message string.
- 0
- On success.
- a value greater than 0
- If either the buffer parameter is NULL or the bufferSize was not
sufficient to receive the complete name. In that case, the value
returned specifies the buffer size required to store the complete
name.
|