on message
Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DEDescription
The event procedureon message is called on the receipt of a valid CAN message.
To access the control information you would use selectors.
The key word this is available within an on message procedure, to access the data of the message that has just been received.
CAPL programs are by default not transparent to bus events. This means that a CAPL node in the evaluation branch of the measurement configuration will block the data flow to its right side. You must explicitly program the passing of messages in CAPL nodes in the evaluation branch.
To make the CAPL node transparent to messages you would write:
For each message received, the reaction is to immediately resend the same message on the bus, causing the event procedure
on message * to be called, etc.
NoteIf for example a CAPL program contains the
on message procedures on message 123 and on message *, the procedure on message 123 will be called up, when a message with the identifier 123 is received. For all other messages the procedure on message * will be called up.
In contrast to bus events, value changes of environment variables are transparent to CAPL programs in the evaluation branch. Thus, a new environment variable is also available on the right side of CAPL nodes, and the user does not need to program this explicitly.
Selectors
MessageExample
Gateway ExampleThe gateway should transmit all messages between Bus 1 and Bus 2 in both directions:
on message procedure in the same node.