I was meaning to look at some code I have for doing a similar thing, but
glad you got it sorted. The stopbits wouldn't have been helpful :-) Its much
easier to spot that sort of thing when its just text, but when its binary
its a bit more difficult :-)

Jeremy

-----Original Message-----
From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
Behalf Of Marshland Engineering
Sent: Monday, 8 August 2011 13:06
To: delphi@delphi.org.nz
Subject: Re: [DUG] HEX to decimal

I finally got it working. The number of stop bits was wrong, that's why the 
first character was always correct and the rest incorrect.

Final code

  if SerialPortNG.NextClusterSize >= 0 then begin
       sRaw:=SerialPortNG.ReadNextClusterAsString;
       for i:=1 to length(sRaw) do
           iData[i]:= byte(sRaw[i]);

Thanks Wallace

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
unsubscribe

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Reply via email to