05-29-2008, 03:46 AM
I am using the following to return data from a device (Davis Weather Station), but I am not getting any data.
The format of the data coming back is 100 bytes:
ACK + 99 byte data packet (LF CR CRC are the last four bytes of the packet)
I use 21(NAK) for the terminator since I know it should not be in the data packet and count on MaxBytes (set to 100) to get all the data. I then will do a CRC check on the data to validate it.
In debugging, I get zero for BytesRead. Yet if I do
I will get 96 bytes back in BytesRead, but I lose the CRC value. How can I get all 100 bytes?
Thanks.
Code:
BytesRead := GetStartStopMsg(m_Port, WaitFor, 06, 21, MaxBytes, ToFill);
ACK + 99 byte data packet (LF CR CRC are the last four bytes of the packet)
I use 21(NAK) for the terminator since I know it should not be in the data packet and count on MaxBytes (set to 100) to get all the data. I then will do a CRC check on the data to validate it.
In debugging, I get zero for BytesRead. Yet if I do
Code:
BytesRead := GetTermedMsg(m_Port, WaitFor, 10, 13, True, ToFill);
Thanks.