Professional Documents
Culture Documents
Sabre Interface Protocol A
Sabre Interface Protocol A
Sabre Interface Protocol A
a member of the
Shering Weighing Group Limited
Release: A
Date: 14 February 2001
Approved Equipment
1.1 Overview
The method that Sabre Digital Weight Indicators, and other Sabre devices, use to
communicate with the external world is known as the Sabre Interface Protocol. It is
a simple packet protocol intended for use over serial links. It includes a checksum
for error detection.
Please note that this document only covers the Sabre Interface Protocol itself. For
a full list of the available commands the reader should refer to the Software
Interfaces section of the SABRE 82x Digital Weight Indicator User’s Manual
supplied with their weighbridge.
Page 2
Sabre Interface Protcol Release A
EOT
STX
ETX
MESSAGE CRC
Page 3
Sabre Interface Protcol Release A
while (*s)
crc = (crc<<8) ^ _ccitt_lut[(crc>>8)^(*s++)];
return crc;
}
Page 4
Sabre Interface Protcol Release A
Package data in
Sabre Protocol
format
Send Packet No
Get DWI
Response (time
out after one
second)
ACK?
No
NAK? Yes
No
No
Timeout? Yes
No
Unexpected
response. Fail.
Finish
(Start receiving if
required)
A packet is sent by, say, device A. It then waits for a response from, say, device B.
Device A will only wait for a response from device B for one second before timing
out.
If device B responds with an acknowledgement (ACK) character, then the send has
succeeded. Device A will then continue normally.
Page 5
Sabre Interface Protcol Release A
two more times (three including the original send) before stopping and indicating the
problem to the application software.
If device A receives no response from device B after one second, then device A will
again attempt to re-send the packet, again up to a maximum of three times.
Page 6
Sabre Interface Protcol Release A
Buffer characters
until EOT received
(timeout after 1 sec)
Got EOT?
Yes No
No
Check packet
structure
and CRC, etc.
Yes
Yes
Send ACK
Return ERROR
Extract message
from packet
Return message
When device A goes into receive mode it will wait for a packet, terminating when the
End Of Transmission (EOT) character is received, or timeout if there are no
characters after one second.
Once the EOT character is received, device A will attempt to decode the received
packet. It will check that the packet frame is correct, i.e. the SOH, STX, ETX and
EOT character are at the correct positions in the packet. It will then extract the CRC
of the message content of the packet sent by device B and calculate its own CRC for
the message part of the received packet. It will then compare the two. If either test
fails, device A will send a NAK character.
Page 7
Sabre Interface Protcol Release A
PC sends <SOH>0<STX>03000000<ETX>crc<EOT>
PC sends <SOH>0<STX>03000000<ETX>crc<EOT>
Page 8
Sabre Interface Protcol Release A
These timeouts are specified in seconds. The software implementing these timeouts
should use appropriate functions to measure real seconds – i.e. they should not use
approximations, such as a FOR loop optimised for a particular computer or class of
computer, that may vary over time as hardware evolves.
Page 9