Checksum for Equipment Communication

Lou Picciano loupicciano at comcast.net
Thu Jan 8 13:28:40 EST 2015


233 decimal is 11101001 in binary. 

By my read of those docs, you then convert each of the binary 'groups' into the ASCII char of its hex... 

Hex Values of those groups: 0Eh 09h 

Corresponding chars: Shift-Out, Tab 

But (the) ambiguously-worded docs might actually mean: 'E9' is the checksum... 

Lou Picciano 

----- Original Message -----

From: "Michael Mantkowski" <michaelj at clientrax.com> 
To: "OmnisDev List - English" <omnisdev-en at lists.omnis-dev.com> 
Sent: Thursday, January 8, 2015 1:12:28 PM 
Subject: RE: Checksum for Equipment Communication 

Do I did the following which gives me 233 as the checksum. However, the 
paragraph and examples seem to be suggesting that the final checksum is only 
2 digits and that somehow Hex is involved here. 

Do I divide this up to 23 and 3 and then use the ASCII value of those 
numbers as Hex? 

??? Confussed. 

Thanks, 

Mike 


Calculate lvSendText as 
con('1H|\^&|||ClienTrax|||||DiasysTech1^R910^280001||D|E1394-97|201412190917 
27') ;; Need to change 'D' to 'P' for production 
For lvCount from 1 to len(lvSendText) step 1 
Calculate lvChecksum as lvChecksum+asc(lvSendText,lvCount) 
End For 
Calculate lvChecksum as mod(lvChecksum,256) 
Calculate lvSendText as con(chr(2),lvSendText,kCr,chr(3),lvChecksum,kCr,kLf) 


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 
********************************************************************* 



-----Original Message----- 
From: omnisdev-en-bounces at lists.omnis-dev.com 
[mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf Of Phil Potter 
(ou) 
Sent: Thursday, January 08, 2015 12:12 PM 
To: omnisdev-en at lists.omnis-dev.com 
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 

_____________________________________________________________ 
Manage your list subscriptions at http://lists.omnis-dev.com 




More information about the omnisdev-en mailing list