I am able to write messages using the PCAN-USB, however it doesn't seem to be able to read messages.
I am attempting to do the following:
Code: Select all
while (true)
{
TPCANStatus result = TPCANStatus.PCAN_ERROR_OK;
do
{
TPCANMsg msg;
TPCANTimestamp time;
Console.WriteLine(result.ToString());
result = PCANBasic.Read(PCANBasic.PCAN_USBBUS1, out msg, out time);
if (result != TPCANStatus.PCAN_ERROR_QRCVEMPTY)
{
ProcessMessage(msg, time);
}
} while ((result & TPCANStatus.PCAN_ERROR_QRCVEMPTY) != TPCANStatus.PCAN_ERROR_QRCVEMPTY);
}
If I had done something wrong, I would've assumed that the error would repeatedly occur, due to the loop, but this is not the case.
Does anyone know what I'm doing wrong?
Thank You.