CAPL2

6)  canOffline

Syntax              canOffline();
Function         Cuts the connection between the node and the bus. Messages sent from the node are not passed through to the bus. The function canOnline() will restore the connection to the bus.
Parameters     none
Returns          none
Example ...
canOffline();
See also canOnline
Compatiblity This function can only be used in nodes in CANoe’s Simulation Setup window.

7)  canOnline

Syntax             canOnline();
Function         Restores the connection of the node to the bus. After a call to the function canOffline() the node can be connected to the bus with the function canOnline(). Messages sent from the node are passed through to the bus.
Parameters     none
Returns          none
Example ...
canOnline();
See also canOffline
Compatibility This function can only be used in nodes in CANoe’s Simulation Setup window.

8)  cos

Syntax             double cos(double x);
Function         Calculate cosine of x
Parameter      Value (in radians) whose cosine is to be calculated.
Note                To convert degrees to radians, multiply degrees by PI/180.
Returns          Cosine of x.
Example
double x;
x = cos(PI); // result -1, PI is a built-in
constant
double tangent(double x) {
return sin(x) / cos(x);
}
See also sin, sqrt, exp

9)  elCount

Syntax               long elCount(...);
Function         Determines the number of elements in one dimension of an array. See example for usage with multi-dimensional arrays.
Parameter      Array of any type
Returns          Number of elements in the array
Example
// One-dimensional array
void bsp(int ar[]) {
int i;
for(i=0; i < elCount(ar); i ++)
...
}
// Two-dimensional array
void bsp2(byte ar[][]) {
int i, j;
for(j=0; j < elCount(ar); j ++ )
for(i=0; i<= elCount(ar[j]); i ++ )
...
}
Note: For the two-dimensonal array, elCount(ar) is used to get the number of elements in the first dimension and elCount(ar[j]) is used to get the number of elements in the second dimension.
See also runError, strlen


10)  exp

Syntax              double exp(double x);
Function         Calculate the value of the exponential function with a given degree
Parameter      Exponent to base e
Example
double x;
x = exp(1.0); // Result: 2.7182...
See also cos, sin, sqrt

11)  fileName

Syntax               fileName();
Function         Output the name of the CAPL program in the Write window. Helpful for debugging purposes.
Parameters     none
Returns          none
Example
...
fileName();
...
Result: output of actual filename of CAPL program to write window

See also runError


No comments:

Post a Comment