I should also note an observation I’ve had with my code.  I’m going from the 
Teensy to a Max3232 to the T-102.  Even with power off on the 102 I receive 
garbage on the port.  My code seems to catch all the preambles though to start 
a packet. Code is starting to get larger so I’m going to post a Github for 
anybody to look at.

Bill

Sent from my iPhone

> On Sep 19, 2019, at 10:17 PM, Bill Nobel <b_no...@hotmail.com> wrote:
> 
> Hi John, yes I receive 2 packets fine (with response) then things go strange 
> only on checksum.  Your C# routine is different from DLPlus for the Calc, 
> I’ll try that in the morning and see if that changes.
> 
> Sent from my iPhone
> 
>> On Sep 19, 2019, at 9:58 PM, John R. Hogerhuis <jho...@pobox.com> wrote:
>> 
>> Are you sure you got a full, aligned packet? It starts with ZZ , counted 
>> length, no missing characters?
>> 
>> The DLPlus checksum is correct. More likely you're misaligned, or somehow 
>> dropped, swapped, or corrupted a character.
>> 
>> Here is the C# code too for comparison
>> 
>>        public byte Checksum(byte[] ary, uint ofs, uint fence)
>>        {
>>            uint sum = 0;
>> 
>>            for (var i = ofs; i < fence; i++)
>>                sum += ary[i];
>> 
>>            return (byte)((~sum) & 0xff);
>>        }
>> 
>> Welcome to the cabal of TPDD protocol initiates.
>> 
>> -- John.

Reply via email to