CAPL10

62)  swapWord

Syntax               word swapWord(word x);
Function         Swaps bytes of parameters. CAPL arithmetic follows the little-endian-format (Intel). The swap-functions serve for swapping bytes for the transition to and from the big-endian- format (Motorola).
Parameters     Value whose bytes are to be swapped.
Returns          Value with swapped bytes.
See also           swapDword, swapInt, swapLong

63) sysExit

Syntax             sysExit();
Function         Exits the system (CANalyzer or CANoe) from within a CAPL program.
Parameters     none
Returns          none
Example ...
sysExit();
...
See also           sysMinimize
Compatibility:             This function can only be used in P-Blocks in CANalyzer’s analysis branch or in CANoe’s Measurement Setup window.

64)  sysMinimize

Syntax              sysMinimize();
Function         The application window of CANalyzer or CANoe will be minimized or restored. The first all of the function minimizes the window; afterwards the window will be restored to normal size, then the next time minimized, etc.
Parameters     none
Return            none
Example ...
sysMinimize();
...
See also           sysExit
Compatibility:             This function can only be used in P-Blocks in CANalyzer’s analysis branch or in                            CANoe’s Measurement Setup window.

65)  timeDiff

Syntax             long timeDiff(message msg1, NOW);
                        long timeDiff(message msg1, message msg2);
Function         Time difference between messages or between a message and the current time in ms                                  (msg2 - msg1 or now - msg1).
Note                Starting with CANalyzer 2.0, this difference can be calculated directly using the TIME                             message selector. See the section on message selectors for more details.
Parameters     A variable of type message as the first parameter, and then another message variable or “NOW” as the second parameter.
Returns          Time difference in ms

66)  timeNow

Syntax             dword timeNow();
Function         Returns the current system time
Parameters     none
Returns          Time since the start of the current measurement in units of 10 ╬╝sec. This time is          established with the help of the PC timer with a resolution of 1 msec. Message times  determined by the CAN PC-card have greater precision and are therefore not directly omparable to timeNow().
Example
...
float x;
x = timeNow()/100000.0; //current time in seconds
...
See also           timeDiff

67) trigger

Syntax               trigger();
Function         Activates logging. This function is not allowed in all CAPL blocks. It can be used in                             program blocks and as CAPL trigger.
Parameters     none
Returns          none
Example
on message 100 {
write(“logging start”);
trigger(); // start logging
setTimer(logging,1000); // for 1000 ms
}
See also stop, setPreTrigger, setPostTrigger

68)  valOfId

Syntax            long valOfId(dword id);
                        long valOfId(message m);
Function         Returns the value of a message identifier independent of its type. Identifier as long value
Parameters     Variable of the type “message” or Id portion of a message
Returns          Identifier as long value
Example
...
id = valOfId(this); // works with ext-id as well
...
See also isExtId, isStdId, mkExtId

69)  write

Syntax                  write(string format, ...);
Function         Outputs a text message to the Write window. Write is based on the C function “printf”. The compiler cannot check the format string. Illegal format entries will lead to undefined results.
Parameters     The write() function allows a variable number of parameters. The format for the        parameters is a format string containing string formatting expressions followed by zero or more arguments, each of which corresponds to one of The string formatting expressions are shown below:
Legal String Formatting Expressions
                        "%ld" or "%d" decimal display
                        "%lx" or "%x" hexadecimal display
                        "%lX" or "%X" hexadecimal display (with upper case letters)
                        "%lu" or "%u" unsigned display
                        "%lo" or "%o" octal display
                        "%s" display a string
                        "%g" or "%lf" floating point display
                        "%c" display a character
                        "%%" display %-character
Returns          none
Example
void display() {
int i = 10;
int j = 25;
write (“d = %ld, h = 0x%lx”,i,j);
}
Result: “d = 10, h = 0x19”
See also writeToLog, snprintf

70) writeToLog

Syntax             writeToLog(string format, ...)
Function         Writes on output string to an ASCII logging file. Write is based on the C function                             “printf”. Data is only written to a log file when logging is enabled in CANalyzer or CANoe. A call to this function is ignored when logging is disabled. The compiler cannot check the format string. Illegal format entries will lead to undefined results.
Parameters     The writeToLog() function allows a variable number of parameters. The format for the                              parameters is a format string containing string formatting expressions followed by zero or                         more arguments, each of which corresponds to one of the string formatting expressions.                            The string formatting expressions are shown below:
Legal String Formatting Expressions
                        "%ld" or "%d" decimal display
                        "%lx" or "%x" hexadecimal display
                        "%lX" or "%X" hexadecimal display (with upper case letters)
                        "%lu" or "%u" unsigned display
                        "%lo" or "%o" octal display
                        "%s" display a string
                        "%g" or "%lf" floating point display
                        "%c" display a character
                        "%%" display %-character
Returns          none
Example
void MarkLogFile(int marker) {
// marks line of ASCII logging file with an
integer
writeToLog(“===> %d”, marker);
}
Result of MarkLogFile(3) as seen in an ASCII log file:
// 0.000 ===> 3
Note                That the 0.000 indicates the time since the start of the simulation that the log file entry                              was made in units of seconds.
See also           write, snprintf, trigger, setLogFileName
Compatibility:  This function has restricted compatibility. Please see the function compatibility chart for  more details.


No comments:

Post a Comment