I'm Receiving CAN Message from my Controller(Suppose Message ID= 0x100 signals S1,S2), But I want to change the signals of Canoe Rx message before Receiving it on the Bus.
-
"before Receiving it on the Bus" means before the sender sends it. And this can only be configured at the sender side, not CANoe side. – Shyam Jan 27 '21 at 09:35
2 Answers
basically if you want to change something in a CAN frame you can do something like this in capl.
Example:
Framename: TEMP
Signal you want to change: S1, S2
on message TEMP /* or "on message 0x100" in your case */
{
/* if you have a dbc or arxml assigned to the canoe project you can directly
* use frame names and signal names to manipulate the data.
* if not you need to use it's ID and write over the bytes on it.
*/
this.S1 = whatever_value;
this.S2 = whatever_value;
output(this);
}
If you don't have a DBC/ARXML file added to the project, but i highly recommend to do so. The only thing you need to change in the above code that you have to specify which bytes you overwrite.
You change this:
this.S1 = whatever_value;
this.S2 = whatever_value;
To this:
this.byte(0) = whatever_value;
this.byte(1) = whatever_value;
But you need to know which bytes you need to overwrite.

- 58
- 1
- 7
-
if he wishes to change for the message before being received by CANoe simulation, your code will only modify the content after the reception (on message) , not before. He wishes to "hijack" the postcar :P Not alter it after reception. – VioletVynil Dec 16 '18 at 10:23
-
I understood it like he's receiveing a message from the controller, and he'd like to change the message before it gets received. But I'm not quite sure what hijacking a postcar should be in this context. But we will see what he exactly meant. But it's nice to see you here again :D – vakesz Dec 16 '18 at 10:35
-
Én is örülök :) So Postoffice1 is the Controller, the postcar is the message, and the Postoffice2 is the CANoe simulation. If he wishes to modify the content before being processed by CANoe, he has to catch it on the road, or force the Controller to send it already modified. Also, CANoe cannot modify the content of the Rx message, it will not be visible on Trace. It can only overwrite the already received message object, but I see no point in that yet. – VioletVynil Dec 16 '18 at 10:46
-
Ok, i’ve just seen your answer also. I missed some parts that a Vector VN box is necessary inbetween the 2 devices, and also i totally missed that crc must be recalculated. Are you hungarian or you’re just googling the translates? – vakesz Dec 16 '18 at 10:58
-
Yes I am hungarian. Hungarian minority in Romania. If you wish, we can discuss FR and CAN protocol and CANoe in hungarian anytime through mail. You can find it in my profile description :) . – VioletVynil Dec 16 '18 at 11:06
If you cannot modify the message before being sent by the Controller, your only option to modify your message is a HIL (Hardware In the Loop), which you position between the sender (Controller) and CANoe VNs on the bus.
They are called CANStress modules for instance, if you wish to stick to Vector products.
They will sniff the messages on your bus, and at the defined trigger (by you) will overwrite the Physical Layer with whatever you wish, successfully altering or fault-injecting the bus.
Be aware, that modifying the signals means you have to know their mapping, also how to recalculate the CRC tag and modify that also, otherwise the CANoe VN will not accept your message, and will report Rx_Err CRC Check.

- 502
- 5
- 11