CAPL6

32)  outport
Syntax             outport(word addr, byte value);
Function         Output a byte to a port.
Parameters     Port address or “LPT1”/”LPT2"/”LPT3" and value to be output..
Returns          none
Note    The built-in constants LPT1, LPT2, and LPT3 can be used as a port address.
Example
...
outport (0x3f8, 12); // Outputs 12 to port 0x3f8
outport (LPT2, ‘x’); // Outputs ‘x’ to LPT2
...
See also inport

33)  output

Syntax            output(message msg);
output(errorFrame);
output(pg pg_msg);
Function         Outputs a message, an error frame, or a parameter group from the program block onto the CAN bus.
Parameters     Variable of type message, errorFrame, or pg.
Returns          none
output(msg)  Example
variables {
message can2.125 msg = { // declare CAN-Message
dlc = 1,
byte(0) = 1
};
}
on key F1 {
output (msg); // output Message to CAN 2
}
output(errorFrame) Example
on key F10 {
output(errorFrame); // output error frame to CAN1
}
output(pg) Example
variables {
pg DashDisplay dDisplay;
}
on key F9 {
dDisplay.FuelLevel.phys = 75;
output(dDisplay);
}

34)  putValue

Syntax             putValue(EnvVarName,int val);
putValue(EnvVarName,float val);
putValue(EnvVarName,char val[]);
Function         Assigns the value val to the environment variable with identifier EnvVarName. Integers are assigned to discrete environment variables, floating point numbers are assigned to continuous environment variables, and character strings are assigned to character string environment variables.
Parameters     Environment variable name, new value of environment variable
Returns          None
Example
// Assign the value 0 to environment variable
“Switch”
putValue(Switch,0);
// Assign the value 22.5 to environment
// variable “Temperature”
putValue(Temperature,22.5);
// Assign the value Master to environment
// variable “NodeName”
val = getValue(NodeName,”Master”);
See also getValue
Compatibility This function has restricted compatibility. Please see the function compatibility chart for more details.

35) random

Syntax            dword random(dword x);
Function        Calculates a random value n such that 0 <= n < x.
Parameter     Upper limit for the random value.
Returns         The random value.
Example
...
dword randVal;
randVal = random(101); // Get a value 0..100
...
36)  resetCan

Syntax                 resetCan();
Function         Resets the CAN controller. This can be used to reset the CAN controller after a BUSOFF or to activate configuration changes. Since execution of the function takes some time and the CAN controller is disconnected from the bus briefly, messages can be lost when this is performed.
Parameters     none
Returns          none
Example
on key ‘r’ { // Controller is reset when ‘r’ key is
pressed
resetCan();
}
See also setOcr,  setBtr
Compatibility This function has restricted compatibility. Please see the function compatibility chart for more details.

37)  runError

Syntax                runError(long err, long);
Function         Triggers a run error. Outputs the error number to the Write window indicating the error number and the passed number, and then terminates the measurement.
Parameters     Numbers that are represented in CANalyzer as a references for the user. The values under 1000 are reserved for internal purposes. The second parameter is reserved for future expansion. Currently, the second parameter can be any number.
Returns          none
Example
...
if(rpm < 0) runError(1001,1);
...
See also elCount

38) seqFileClose

Syntax             long seqFileClose(long fileHandle);
Function         This function closes the file specified by the long integer fileHandle. The file handle is assigned by the seqFileLoad() function. All buffers allocated by the system are freed upon closing.
Parameters     The file handles of the file to close.
Returns          The function returns zero with success. If the operation fails, it returns non-zero error code.
Example
long fileHandle;
long errorCode;
fileHandle = seqFileLoad(“capl.dat”);
...
errorCode = seqFileClose(fileHandle);
if (errorCode == 0)
{
write(“File closed.”);
}
else
{
write(“Error number %d closing file.”, errorCode);
}
See also seqFileLoad, seqFileRewind, seqFileGetBlock, seqFileGetLine, seqFileGetLineSZ
Compatibility This function can only be used in P-Blocks in CANalyzer’s transmission branch and CANoe’s simulation setup window.


No comments:

Post a Comment