[DUG] HEX to decimal
Jeremy Coulter
jscoulter at gmail.com
Mon Aug 8 18:37:43 NZST 2011
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-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Marshland Engineering
Sent: Monday, 8 August 2011 13:06
To: delphi at 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 at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe
More information about the Delphi
mailing list