on message
Function
The event procedureon messageis called on the receipt of a valid CAN message. To access the control information you would useselectors. The key wordthisis available within anon messageprocedure, 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: on message * {output(this);}; However, please note that you are programming a recursive if you are using this code in CANoe's simulation configuration:For each message received, the reaction is to immediately resend the same message on the bus, causing the event procedureon message *to be called, etc.
Selectors
Message
Gateway example The gateway should transmit all messages between Bus 1 and Bus 2 in both directions: on message CAN1.*{message CAN2.* msg;if(this.dir != rx) return; //important!msg = this;output(msg);}on message CAN2.*{message CAN1.* msg;if(this.dir != rx) return; //important!msg = this;output(msg);} Further examples
Resolution of Ambiguities