PCAN_Read results in PCAN_ERROR_QRCVEMPTY
Posted: Fri 19. Jun 2015, 08:13
Hi
II have a PCAN-USB-Adapter attached to my Linux-Virtual Machine and another USB-Adapter attached to my Windows 7, so I can use the PCAN-Viewer to see whats happening on the BUS. In between there is the hardware part, that is target of my CAN-Messages (so the second PCAN-USB-Adapter is just for debugging purpose).
To wake up the target and keep it alive I have to send 2 different messages in a permanent loop. So i built a background thread which is sending these messages every 100 (or 200) milliseconds.
Now comes the interesting part. To flash a new Software onto the target i have to send CAN-Messages read out of a binary file to it. This is done in an alternate thread. The CAN-Messages should be sent using the ISO-TP-Standard.
Therefore it should send a block of messages, wait for a Response, interpret the response and then send the next block. It does so for the first block. I see the sent Request and the corresponding response. But when I try to get that response via CAN_Read, it tells me the Receive Queue is empty. But As i said I need this response to trigger the next Request. And because I do not get this response I end up in a Timeout and my Program shuts own.
Has anybody an idea about that? I saw another thread about a pretty similar problem, but it doesn't quite fit my needs, therefore I opened another thread.
Thanks in advance
Best regards
Alex
II have a PCAN-USB-Adapter attached to my Linux-Virtual Machine and another USB-Adapter attached to my Windows 7, so I can use the PCAN-Viewer to see whats happening on the BUS. In between there is the hardware part, that is target of my CAN-Messages (so the second PCAN-USB-Adapter is just for debugging purpose).
To wake up the target and keep it alive I have to send 2 different messages in a permanent loop. So i built a background thread which is sending these messages every 100 (or 200) milliseconds.
Now comes the interesting part. To flash a new Software onto the target i have to send CAN-Messages read out of a binary file to it. This is done in an alternate thread. The CAN-Messages should be sent using the ISO-TP-Standard.
Therefore it should send a block of messages, wait for a Response, interpret the response and then send the next block. It does so for the first block. I see the sent Request and the corresponding response. But when I try to get that response via CAN_Read, it tells me the Receive Queue is empty. But As i said I need this response to trigger the next Request. And because I do not get this response I end up in a Timeout and my Program shuts own.
Has anybody an idea about that? I saw another thread about a pretty similar problem, but it doesn't quite fit my needs, therefore I opened another thread.
Thanks in advance
Best regards
Alex