Skip to main content
Open topic with navigation CAPL Functions » General » General Event Procedures

General Event Procedures

Valid for: CANoe DE • CANoe4SW DE • CANoe:lite DE • CANoe4SW:lite DE CAPL is a procedural language in which the execution of program blocks is controlled by events. These program blocks are referred to as event procedures. Within an event procedure there may be reactions to the following events: The program code that you define in event procedures is executed when the event occurs. For example, you could send a message onto the bus in response to a key press (on key), track the occurrence of messages on the bus (on message), or else execute cyclically defined actions (on timer).

Example

Example

Note for Using Handlers within CAPL Test Nodes

Note for preStop handler, event handler and time handler:
If a test is stopped (test module inactive), these handlers will not be executed within the CAPL test node.
Example: In a XML test module a CAPL test node is added.
on preStart
{
    write ("start");
}

on preStop
{
    write ("stop");
    deferStop (5000);
}
If the test module is inactive, the on preStart() write is displayed, on preStop will not be executed. Event Procedures: Overview