Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetStartStopMsg not returning data
I am using the following to return data from a device (Davis Weather Station), but I am not getting any data.
BytesRead := GetStartStopMsg(m_Port, WaitFor, 06, 21, MaxBytes, ToFill);
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
BytesRead := GetTermedMsg(m_Port, WaitFor, 10, 13, True, ToFill);
I will get 96 bytes back in BytesRead, but I lose the CRC value. How can I get all 100 bytes?

The way the docs read the GetStartStopMsg should work as you expect it to. To get the last 2 bytes use either the ReadBuffer or ReadByte method of the ComPort class. I wish folks that came up with these protocols would frame messages with either start/stop or just a stop byte to make it easy to capture them. The buggers are the ones where you have to figure out what type of message it is first before you know how many bytes you need to expect.
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
You'd just do the 10/13 and upon return issue a read for 2 more bytes. Kind of a wierd protocol.
Dean Roddey
Explorans limites defectum
OK, I did the two reads and that seems to work... though, it appears my checksum calc is a bit messed up.

Yeah, the protocol is a bit odd. I am a bit worried about the number of fields. I am over 40 already and I havn't even done the High/Low data or the alarms.

Possibly Related Threads…
Thread Author Replies Views Last Post
  V2 Question - OpenWeatherMap Using their New JSON Data Feed kblagron 7 2,094 05-07-2020, 01:40 PM
Last Post: Dean Roddey
  Methods for getting data to CQC from outside apps zra 3 1,955 08-05-2018, 12:29 PM
Last Post: Dean Roddey
  Graph Widget - There is no editor for data type float zra 4 3,463 07-06-2017, 02:25 PM
Last Post: Dean Roddey
  Parsing Serial Trigger data Bugman 3 2,641 12-01-2016, 02:09 PM
Last Post: Dean Roddey
  help with doing an http post with data bbrendon 4 3,185 10-07-2016, 01:04 AM
Last Post: bjkiller
  data logging time values znelbok 5 3,597 10-23-2015, 06:46 PM
Last Post: Dean Roddey
  SendGet No Data Returned CQC 4.6.907 wuench 34 9,335 05-10-2015, 04:40 AM
Last Post: wuench
  Moving over CQC data ghurty 5 2,677 01-17-2015, 07:24 PM
Last Post: ghurty
  Weather Driver data issues DaveB 24 6,070 01-18-2014, 12:57 PM
Last Post: DaveB
  data entered quickly doesn't get recognized-General Listening IP Trigger Driver bug? bbrendon 6 3,017 01-05-2014, 08:56 PM
Last Post: Dean Roddey

Forum Jump:

Users browsing this thread: 1 Guest(s)