Checksum for Equipment Communication
Lou Picciano
loupicciano at comcast.net
Thu Jan 8 12:39:38 EST 2015
Whoops! Of course, Phil is exactly right - the checksum bit of your problem is exactly 'ASCII add'
(sorry, read too fast - a lot of other kinds of checksumming in my head.)..
----- Original Message -----
From: "Phil Potter (ou)" <Phil at pgpotter.demon.co.uk>
To: omnisdev-en at lists.omnis-dev.com
Sent: Thursday, January 8, 2015 12:11:52 PM
Subject: Re: Checksum for Equipment Communication
Presume ASCII ?
Seems you just add up the Ascii character code for each character in
your data string and then mod 256 to get a number between 0 and 255 for
the checksum.
The function asc() in Omnis might help here...
or you may need to use bytemid() if your in a later version of Omnis.
regards
Phil.
On 08/01/2015 16:55, Michael Mantkowski wrote:
> Does anyone here understand What I need to do to create the checksum for the
> following line of text I want to send to a lab text machine? I have all of
> the communications setup and working via TCP/IP. But I am not quite sure
> how to calculate the checksum.
>
> Data:
> 1H|\^&|||ClienTrax|||||DiasysTech1^R910^280001||D|E1394-97|20141219091727
>
> I believe I get a Checksum of the above then add a <STX> on the front and
> <CR>Checksum<ETX><CR><LF> on the back.
>
> This is what the mfg says needs to be done...
>
> During the transfer phase, the sender transmits messages to the receiver.
> Messages are sent in frames that contain a maximum of 247 characters (7 for
> control and 240 for the message itself). Messages longer than 240 characters
> are divided between two or more frame. So there are two type of frames,
> Intermediate and End.
> Each frame starts with the <STX> character and a frame number that is a
> digit ranging from 0 to 7. The frame number begins with 1 with the first
> frame and it is incremented by one for every new frame, rolling over to 0
> after 7. This number permits the receiver to distinguish between new and
> retransmitted frames.
> The checksum permits the receiver to detect a defective frame, and is
> encoded as two characters that are sent after the <ETB> or <ETX>. The
> computation for the checksum does not include <STX>, the checksum
> characters, or the trailing <CR> and <LF>. Each other characters are added
> to the checksum modulo 256. The checksum is an integer represented by eight
> bits that can be considered as two groups of four bits. Each group is
> converted to the ASCII character of the hexadecimal representation. The two
> characters are transmitted as the checksum.
>
>
> *********************************************************************
> Michael Mantkowski
> ClienTrax Software
> 1-614-875-2245
> *********************************************************************
>
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>
>
> --
> Phil Potter
> Based in Chester in the UK.
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com
More information about the omnisdev-en
mailing list