0

Context: I am trying to replay a BLF file using python-can over a vector interface with an implementation of MessageSync iterator object and can.send operating on the yielded messages. While it functions for 20-30 seconds as expected but after that it keeps raising ERR_QUEUE_FULL exception while sending CAN messages. Have tried to handle that using can_bus.flush_tx_buffer() and can_bus.reset() but to no effect. I understand that the transmit buffer gets full while the messages are written too fast at a given segment causing buffer overflow. Usage:

replayReaderObj = LogReader(replay_file_path)
msgSyncObj = MessageSync(messages=replayReaderObj, timestamps=True)

I am iterating via msgSyncObj using a for loop and using can.send() on messages (provided message is not an error frame). Default args of gap(0.0001) and skip(60) are considered in which case replay timestamps are considerably delayed compared to the replay file. Hence gap as 0 is included in next attempt to ensure only offset difference is considered. It aligns the replay timestamps but causes buffer overflow in few seconds.

The same replay file while run over a Vector CANoe replay blocks runs just fine without any buffer issues in given replay duration(+10%).

Question: Can anyone shed light on whether python-can and Vector CANoe (both running on Win10 PC) has different way of configuring transmit queue buffer? Any suggestions on how I can increase the transmit queue buffer used by python-can is highly appreciated along with handling such buffer overflows(since flush_tx_buffer isn't having any impact). Note: In Vector Hardware Configuration, transmit queue size is configured as 256 messages. I am not sure if python-can uses the same configuration before I want to change it.

Additional context OS and version: Win 10 Python version: Python 3 python-can version: 3.3.4 python-can interface/s (if applicable): Vector VN1630

There is another real ECU for acknowledgement of Tx messages. This runs fine if I keep a decent wait time(10 ms - minimum that time.sleep() in Python Windows can provide) between consecutive messages. Drawback is that with the wait time injection, it takes 6x-7x times the actual replay time.

Let me know for any further information on top of this. Sorry, I will not be able to share the trace file as it is proprietary, but any details regarding it's nature I can get back on it.

  • You should show your code. How are you using the MessageSync? Are the timestamps of the sent messages the same as in the BLF file? Do you use the same bitrate during replay? Is the busload during replay higher than during recording? – MSpiller Feb 02 '22 at 09:47
  • @M.Spiller: Updated the description with the function call to MessageSync. For default gap value of MessageSync, replay timestamps are delayed. With gap=0.0, we do see alignment wrt BLF file till buffer overflows in 20-30 secs. Same baudrate is used during replay. I will check for the busload during recording but during replay it's at an average of 75-80% – Anirban Karmakar Feb 02 '22 at 15:43

0 Answers0