Title: Message

Nhmmm .. the last serial interface I programmed (a Weidemueller device) required the data also as a hexadecimal string. A simple “inttohex(mychecksum and $ff,2);” should do the job (is in the SysUtils unit). Just send your data as a string like ‘0df20a0a02450231384301000a’ !

 

By the way, to convert your data from a hexstring to integer (for calculating your checksum) you can use the “strtoint('$’+’1e');” function. Make sure the number you pass into the strtoint routine has a $ char in front so that the string will be interpreted as hex.

 

Cheers,

Stefan

 

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kyley Harris
Sent:
Sunday, 25 July 2004 5:07 p.m.
To: [EMAIL PROTECTED]; 'NZ Borland Developers Group - Delphi List'
Subject: RE: [DUG] Pulling my hair out

 

Unless I’m missing something HEX data is string data ie  Chr($0d)+Chr($06) etc etc

 

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Coulter
Sent:
Sunday, 25 July 2004 7:38 p.m.
To: 'NZ Borland Developers Group -
Delphi List'
Subject: RE: [DUG] Pulling my hair out

 

yeah its all sorted now. Thanks.

 

The only thing I am having trouble with at the moment is, I need to output the HEX to a comport, and I am using ther ASyncPro comp. from Turbopower, but, it only seems to output strings.

 

Anyone know how I can output the hex data via the Asyncpro comps?

 

Thanks, Jeremy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Mueller
Sent:
Sunday, 25 July 2004 19:21
To: 'NZ Borland Developers Group -
Delphi List'
Subject: RE: [DUG] Pulling my hair out

 06  = 06

+07 = 0d

+01 =  0e

+73 = 81

+01 = 82

+00 = 82

 

and the other thing with keep the base byte means that at the end just make a (mysum and $ff to keep the first 8 bit).

 

Regards,

Stefan Mueller

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Coulter
Sent:
Sunday, 25 July 2004 9:28 a.m.
To: [EMAIL PROTECTED]
Subject: [DUG] Pulling my hair out

 

Hi all.

I am pulling my hair out here at the moment.

 

I have this line of data :-

 

0df20a0a02450231384301000a

 

Its a hex data. Now the last 0A is the checksum.

The document I have says that the checksum is made up of the SUM of BYTES for these values :-

 

0a 0a 02 45 02 31 38 43 01 00

 

and this line of data has a HEX checksum of 82 (thats 82 in HEX)

 

06 07 01 73 01 00

 

But I am stuffed if I can work it out. I thought I had it figured out, but NO !

 

Can someone enlighten me how to come to these values? I am SURE I am meant to know this, but its sure as hell not coming to me.

 

Cheers, Jeremy

 

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to