Siemens SIMATIC TIWAY 1 User Manual page 180

Unilink host adapter
Hide thumbs Also See for SIMATIC TIWAY 1:
Table of Contents

Advertisement

USING THE NON-INTELLIGENT TERMINAL PROTOCOL
A.1.5
Error-Checking Code
Following the message body is an ASCII four-character error-checking code
(ECC) in the form of a 16-bit hexadecimal number that is included at the end of
the message just before the semicolon terminator. The ECC is a checksum
computed by both the sending and receiving stations as follows:
1. Divide the character count and the message body into blocks of four
2. Treat each block as a four-digit hexadecimal number.
3. Sum the resulting numbers (blocks).
4. Take the two's complement of the sum to get the ECC.
As an example, consider a message whose body is the CONFIGURE ADAPTER
command:
ASCII
Codes
The total character count is found by adding together the number of characters
in the message, the four characters for the ECC, the four characters for the
character count, and the two characters used to delimit the message. Thus, the
total character count for a message containing "2001000202000E" is
UNILINK HOST ADAPTER
USER MANUAL
characters, left-justified and zero-filled. The beginning and ending
delimiters are not included in the calculation.
20
01
32
30
30
31
30
Starting Delimiter –
Character Count –
Message Body – 2001000202000
Error–checking Code
Ending Delimiter –
Total Character Count
* Numbers in parentheses are the corresponding
decimal values.
00
02
02
30
30
32
30
:
=
01
(1)*
?
=
04
(4)
E
=
0E
(14)
?
=
04
(4)
;
=
01
(1)
0018 (24)
A-4
00
0E
32
30
30
30
45

Advertisement

Table of Contents
loading

Table of Contents