0

I'm kind of new to CAPL. Today I am trying to use the output function for sending UDS messages on CAN, using a simple code below:

      UdsReq.dir = 1;
      UdsReq.byte(0) = 0x02;
      UdsReq.byte(1) = 0x10;
      UdsReq.byte(2) = 0x03;
      output(UdsReq);

However, the issue I am facing currently is that even if the messages are sent out on correct ID, there is no response. Whereas if I use the Diag Console to send the same messages manually, it is getting answered just right.

If I compare CAN logs for both, the "Length" and BitCount values are zero in the CAPL generated messages. I am unable to set these fields, seem to be read-only.

  • CAPL generated:
 0.050000 1  7B0    Tx   d 8 02 10 03 00 00 00 00 00  Length = 0 BitCount = 0 ID = 1968
 0.150000 1  7B0    Tx   d 8 02 27 01 00 00 00 00 00  Length = 0 BitCount = 0 ID = 1968
  • Sent manually via diag console:
 8.893776 1  7B0    Tx   d 8 02 10 03 00 00 00 00 00  Length = 240244 BitCount = 123 ID = 1968  // 1  OTP(01) Atom 7B0->7B8 : SF Length:   02   [ 10 03 ]
 8.899728 1  7B8    Rx   d 8 06 50 03 00 32 01 F4 00  Length = 233911 BitCount = 121 ID = 1976  // 1  OTP(02) Atom 7B8->7B0 : SF Length:   06   [ 50 03 00 32 01 F4 ]
11.034792 1  7B0    Tx   d 8 02 27 01 00 00 00 00 00  Length = 240244 BitCount = 123 ID = 1968  // 1  OTP(03) Atom 7B0->7B8 : SF Length:   02   [ 27 01 ]
11.039620 1  7B8    Rx   d 8 06 67 01 B6 2F C0 FC 00  Length = 231925 BitCount = 120 ID = 1976  // 1  OTP(04) Atom 7B8->7B0 : SF Length:   06   [ 67 01 B6 2F C0 FC ]

My inferences:

  1. Length and BitCount are coming as zero in CAPL generated messages. This must have made the frames invalid. However, I cannot modify these fields - it is read only.
  2. Initially the CAPL messages were being displayed as TxRq (option is unticked in the simulation setup settings). Hence I have manually set .dir = 1. Does this have something to do with it?

What could the reason be? Any help is greatly appreciated.

  • I've removed the tag info from the title again. It is redundant noise, as the tag system works extremely well here and does not need help. Please DO NOT put it back in the title. – Ken White Feb 14 '23 at 02:34
  • There is nothing in a CAN frame called "bit count". What is Length = 240244 supposed to be? Sounds like nonsense. Where is the DLC? It seems that you need to get a better tool to listen to the CAN traffic because your current one doesn't seem to give out any meaningful info. – Lundin Feb 14 '23 at 08:51
  • You should not have to set `dir`. Could you elaborate about your setup, i.e. where is the CAPL code running? Is the node in the simulation setup or in the measurement setup? To which busses is it connected? Length (the frame duration in ns) and BitCount are provided by the HW interfaces when they observe the message on the bus. Not every HW can provide these values. You should never (and thus can never) set them manually. – MSpiller Feb 14 '23 at 09:05

0 Answers0