Search code examples
caplcanoe

Method of listening to UDS message on CAN 1 and outputting control code on CAN2 in CAPL


I'm a complete amateur in programming but have some experience with operating Vector tools and long time familiarity with automotive CAN networks and UDS. I can send a control message to operate the relay on a RAD I/O interface on bus 2 manually (ON KEY) so I know the command works (clickety click) but I need it to do so on receipt of a diagnostic CAN frame (on diagrequest). The problem is, the diagRequest is on CAN bus 1 and I need to send the command on CAN bus 2. Any CAPL keyboard warriors able to suggest a solution please?

includes
{

}

variables
{
  message 0x600 radio={dlc=8};
}

ON key 'p'
{radio.byte(0)=0x04;
output (radio);
}
ON key 'o'
{radio.byte(0)=0x00;
output (radio);
}
on diagRequest RequestTransferExit

  {radio.byte(0)=0x04;
output (radio);
}

Solution

    1. You should configure your Simulation node to gateway (in its Configuration... Buses Tab) add the other CAN also, so it can access simultaneously.

    2. In order to output the ID on a different channel, you have to define the radio message with the Channel selector also, like this:

      variables { message CAN1.0x600 radio={dlc=8}; }