vector.com|Contact
Search tips

apple banana
Find rows that contain at least one of the two words.

+apple +juice
Find rows that contain both words.

+apple macintosh
Find rows that contain the word 'apple', but rank rows higher if they also contain 'macintosh'.

+apple -macintosh
Find rows that contain the word 'apple' but not 'macintosh'.

+apple ~macintosh
Find rows that contain the word 'apple', but if the row also contains the word 'macintosh', rate it lower than if row does not. This is "softer" than a search for '+apple -macintosh', for which the presence of 'macintosh' causes the row not to be returned at all.

+apple +(>turnover >strudel)
Find rows that contain the words 'apple' and 'turnover', or 'apple' and 'strudel' (in any order), but rank 'apple turnover' higher than 'apple strudel'.

apple*
Find rows that contain words such as 'apple', 'apples', 'applesauce', or 'applet'.

"some words"
Find rows that contain the exact phrase 'some words' (for example, rows that contain 'some words of wisdom' but not "some noise words").

By continuing to use this site you agree to the use of cookies. For more information and to find out how to change this click here. Accept Cookies
Please enable cookies in your browser for this website.
Search:
Advanced search

How to Access Value Table Entries of Signals and System Variable in CAPL

Last updated: 2019-10-28
Question:
How can I access value table entries of signals and system variable in CAPL?
Answer:

Signals and system variables can have value tables which describe specific values. Those value descriptions can also be accessed in CAPL for a better readability / interpretation of the actual CAPL code. It is possible to reference a value description instead of an actual value and also to look up the value description for a specific value:
Example for referencing a value description instead of the actual value within a Switch/Case:


Switch(@SystemVariable)
{
   case (sysvar::myNamespace::myVariableName::myValueDescription):
   // do whatever you want to do…
}

Looking up a value description for a specific value:

write("Current value: %d; value description: %s", @myNamespace::myVariableName, ((enum VtSv_myNamespace_myVariableName)@myNamespace::myVariableName).name());


Both methods can be found for Signals and System Variables in this example:
 

Note:
Minimum Version for this CAPL syntax variants is CANoe 11.0.
 
Article Options
2019-10-28
Views: 141