How can I manipulate the data in receiving CAN frame via CAPL script and forward it into the same CAN bus?

1k Views Asked by At

For example, I'm receiving a CAN frame from ECU with id 0x100 with some data inside in CAN channel 1. I want to change only byte 7 to 0xFF and forward this frame further in channel 1. My code is below:

on message 0x100
{
  message 0x100 msg;
  msg = this;
  msg.byte(7) = 0xFF;
  output(msg);
}

But, in CAN trace, I see the message as it is, without byte 7 changed. What I do wrong? Maybe there is something that I do not understand..

I have one assumption to solve it, but this requires wiring changes to my hardware. If I make one channel for input and another channel for output, then I can use CAPL as a gateway and send frame from CAN1 to CAN2 inside one CAN-bus.

Any ideas are welcome. Thank you.

0

There are 0 best solutions below