Test Service Library: Status Report Functions
Open topic with navigation CAPL Functions » Test Service Library » Status Report Functions Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE In order to query information about a check, generic and check specific status report functions are implemented. The general status report functions are working with all types of checks. The check specific status report functions are working only with a special part of the checks. If a check specific status report function is called for a check that does not support this function, a warning will be displayed in the Write Window.Mode of Operation
The goal of the following functions is to give a value for the quality of the system, but the quality depends heavily on the runtime of the check. For statistical reasons, all values are derived in a way that an error event is supposed just before the check has been started and just after the check has been stopped. So the maximum time between events will never be greater than the time between the event and check start and the time between the event and check stop. At first, session 1 is performed. The red arrows are marking error events, the yellow triangles are marking particular times, the following description will refer. After the first session, the following statistical values could be queried at the time “query #1”:- min distance = t1
- max distance = t2
- min distance = t1
- max distance = t10a
- min distance = t12
- max distance = t10
Generic Status Report Functions
These functions return statistics on the number of events that any check generated since its creation or reset. They also include functions to convert the check status to a string, for logging. Generic status report functions are available for all check types. These query functions may not raise an error class that leads to a measurement stop.- ChkQuery_NumEvents: Returns the number of events generated by this check since its initialization.
- ChkQuery_NumEvents_AsyncResult: Returns the number of events generated by this check since its initialization.
- ChkQuery_Valid: Examines whether a check with particular Id is valid.
- ChkQuery_Valid_AsyncResult: Examines whether a check with particular Id is valid.
- StmQuery_Valid: Examines whether a stimulus with particular Id is valid.
Statistic Data Collection
The following functions return a timely distance given in the actual precision. The decimal places are cut. To get a value with more decimals (more exact value), the precision can be modified with ChkConfig_SetPrecision.- ChkQuery_Precision_AsyncResult: Returns a factor that can be multiplied with the return value of the statistical queries.
- ChkQuery_StatEventFreePeriodAvg: Returns the average timely distance between events and check starts/stops.
- ChkQuery_StatEventFreePeriodAvg_AsyncResult: Returns the average timely distance between events and check starts/stops.
- ChkQuery_StatEventFreePeriodMax: Returns the maximum timely distance between events and check starts/stops.
- ChkQuery_StatEventFreePeriodMax_AsyncResult: Returns the maximum timely distance between events and check starts/stops.
- ChkQuery_StatEventFreePeriodMed: Returns the average timely distance between events and check starts/stops.
- ChkQuery_StatEventFreePeriodMed_AsyncResult: Returns the average timely distance between events and check starts/stops.
- ChkQuery_StatEventFreePeriodMin: Returns the minimum timely distance between events and check starts/stops.
- ChkQuery_StatEventFreePeriodMin_AsyncResult: Returns the minimum timely distance between events and check starts/stops.
- ChkQuery_StatProbeIntervalAvg: Returns the average timely distance between 2 consumed message events.
- ChkQuery_StatProbeIntervalAvg_AsyncResult: Returns the average timely distance between 2 consumed message events.
- ChkQuery_StatProbeIntervalMax: Returns the maximum timely distance between 2 consumed message events.
- ChkQuery_StatProbeIntervalMax_AsyncResult: Returns the maximum timely distance between 2 consumed message events.
- ChkQuery_StatProbeIntervalMin: Returns the minimum timely distance between 2 consumed message events.
- ChkQuery_StatProbeIntervalMin_AsyncResult: Returns the minimum timely distance between 2 consumed message events.
Generic Textual Status Report Functions
- ChkQuery_EventStatus: Converts the status into a string that can be printed.
- ChkQuery_EventStatus_AsyncResult: Converts the status into a string that can be printed.
- ChkQuery_EventStatusToLog: Uses the output of ChkQuery_EventStatus and writes the result to the logging file.
- ChkQuery_EventStatusToWrite: Uses the output of ChkQuery_EventStatus and writes the result to the logging file.
- ChkQuery_StatNumProbes: Returns the number of probes (measurements) that have been considered by the check.
- ChkQuery_StatNumProbes_AsyncResult: Returns the number of samples (probes) that have been considered by the check.
Check Specific Status Report Functions
The check-specific status report functions permit querying of information that is only available for some types of checks. Which queries are possible and meaningful depend on the purposes of the individual checks. Included in the description of individual check types are definitions of which check-specific Status Report functions are supported.- ChkQuery_EventInterval: Returns the last time-interval that has led to the event.
- ChkQuery_EventInterval_AsyncResult: Returns the last time-interval that has led to the event.
- ChkQuery_EventMessageId: Returns the Id of the message that has forced the event.
- ChkQuery_EventMessageName: Stores the name of the message in a buffer.
- ChkQuery_EventSignalValue: Enables access to the signal value which was last reported by a check as invalid.
- ChkQuery_EventSignalValue_AsyncResult: Enables access to the signal value which was last reported by a check as invalid.
- ChkQuery_EventSignalValueMin: Enables access to the minimal measured values within a check.
- ChkQuery_EventSignalValueMax: Enables access to the minimal measured values within a check.
- ChkQuery_EventSignalValueMin_AsyncResult, ChkQuery_EventSignalValueMax_AsyncResult: Returns the last time-interval that has led to the event.
- ChkQuery_EventSignalValue (for signals with positive values): Enables access to the signal (only with positive) value which was last reported by a check as invalid.
- ChkQuery_EventTimeStamp: Retrieves time stamp of last fired event.
- ChkQuery_EventTimestamp_AsyncResult: Retrieves time stamp of last fired event.
- ChkQuery_EventTimeStampInt64: Retrieves time stamp of last fired event.
- ChkQuery_EventTimestamp64_AsyncResult: Retrieves time stamp of last fired event.
MOST Specific Functions
- ChkQuery_NumRequests: Returns the total number of requests that occurred during the current observation period.
- ChkQuery_NumTimedoutRequests: Returns the number of requests within the current observation period for which no corresponding response message was observed during the specified timeout.
- ChkQuery_RequestDstAdr: Returns the destination address of the request message, which last led to a protocol violation.
- ChkQuery_RequestFBlockId: Returns the FBlock of the request message, which last led to a protocol violation.
- ChkQuery_RequestFunctionId: Returns the FunctionID of the request message, which last led to a protocol violation.
- ChkQuery_RequestInstId: Returns the InstID of the request message, which last led to a protocol violation.
- ChkQuery_RequestOpType: Returns the OpType of the request message, which last led to a protocol violation.
- ChkQuery_RequestSrcAdr: Returns the source address of the request message, which last led to a protocol violation.
- ChkQuery_RequestTimestamp: Returns the reception time stamp of the request message, which last led to a protocol violation.
- ChkQuery_StatAvResponseTime: Returns the average time lag between the request and corresponding response messages.
- ChkQuery_StatMaxValidResponseTime: Returns the longest time lag between the request and corresponding response message that occurred during the current observation period.
- ChkQuery_StatMinResponseTime: Returns the shortest time lag between the request and corresponding response message that occurred during the current observation period.
LIN Specific Functions
- ChkQuery_EventFrameID: Retrieves frame id of a schedule table for which the event has been sent.
- ChkQuery_EventMessageContents: Stores the data bytes of the message into a buffer.
- ChkQuery_EventNodeName: Stores the name of the node into a buffer.
- ChkQuery_EventSchedSlotIndex: Retrieves slot index of a schedule table for which the event has been sent.
- ChkQuery_EventReason: Retrieves the exact reason of firing event in the LIN specific check.
- ChkQuery_EventTiming: Retrieves the timing value that has been violated in the LIN specific check.
Asynchronous Evaluation
Special care must be taken when the checks are evaluated asynchronously and status values are to be queried. Since the values are not available in the RT kernel they need to be requested explicitly before each use. The status values are requested with the function testWaitForCheckQuery. For every status report function (for example ChkQuery_EventStatus) there is a corresponding function with the same name and the suffix_AsyncResult (for example ChkQuery_EventStatus_AsyncResult) which retrieves the requested values from the asynchronous evaluation.
A call to testWaitForCheckQuery retrieves all possible status values from the asynchronous evaluation for the given check. Therefore, it is possible to query multiple values with a single call to testWaitForCheckQuery.
The following example code shows how status report functions can be used for checks that are evaluated asynchronously.
testWaitForCheckQuery resumed. A warning will be triggered if you use any of the TestWaitFor… functions before you actually query any of the information. The following example will give you such a warning message.
testWaitForCheckQuery together with ChkQuery_<function name>_AsyncResult can also be used when the checks are evaluated synchronously. In this case testWaitForCheckQuery returns immediately.