considering the PCAN-Basic API, the reset function clear the transmit and receive buffer of the specified channel:
Code: Select all
# Resets the receive and transmit queues of the PCAN Channel # def Reset( self, Channel): """ Resets the receive and transmit queues of the PCAN Channel Remarks: A reset of the CAN controller is not performed Parameters: Channel : A TPCANHandle representing a PCAN Channel Returns: A TPCANStatus error code """ try: res = self.__m_dllBasic.CAN_Reset(Channel) return TPCANStatus(res) except: print ("Exception on PCANBasic.Reset") raise
Is there a minimum time to wait after calling the reset function to give the API enough time to clear the internal buffer completely?
I have noted the following behavior: 100 messages are sent at 1 Mbit (as fast as possible in a loop, i.e. the frames have to be buffered by the PCAN, because writing to the queue is faster than frames can be put on the bus). Afterwards the reset function is called and then send one frame and read directly. In this case, however, there are some old messages from the previous call.