Axetris AG
LGD Compact Integration Guide V1.8
04.12.2019
27/34
Table 10
Example of a
Response
from the sensor (Ping user calibration)
Response in Hex
7B 50 58 00 00 00 05 03 0B 00 03 0C 00 05 16 00 05 17
00 05 18 00 00 00 00 00 00 00 80 3F 00 00 FA 43 00 00
7A 44 CD CC CC 3D 00 00 00 00 00 00 00 00 17 B7 D1 38
00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 7F 00 00
00 3F 00 00 80 7F 00 00 00 00 00 00 00 00
F7
7D
Response in ASCII
{ P
X . . . . . . . . . . . . . . .
. . . . . . . . . . . ? . . . C . .
z D . . . = . . . . . . . . . . . 8
. . . . . . . . . . . . . . . . . .
. ? . . . . . . . . . . . .
.
}
Description
Start of packet {
Command (P = ping)
Packet size (here 88 bytes)
Error and Status Bytes
Data
Additional zeros to reach multiple of 8
checksum
End of packet }
To ensure correct data transmission, the following parts can be checked:
1. Beginning
of each packet must be “{“
2. 2
nd
Byte must be one of the following characters:
“S”, “P”, “C”, “M”, “I”, “V” or “D”
3. The number of received bytes per packet are indicated in byte 3 and 4
4. The checksum must be OK
5.
End of each packet must be “}”
The checksum or
CS
(in the unsigned integer 8-bit format) of a packet can be calculated with following
formula
and excludes the last “}” character:
1
2
0
i
Packetsize
i
Byte
CS
If the number of bytes of a packet is not a multiple of 8, zeros have to be added between
data and the checksum to reach a multiple of 8.
Timing & RS232-protocol
Commands are formed by a set of bytes and cannot be compressed without compromising the behavior of
the sensor. Timeouts are implemented and bytes should be sent in a given time. Although the constraints
are quite loose, they require minimal considerations:
8-byte commands:
Short commands of only 8 bytes do not require very much timing attention and the sensor considers the
command only after the reception of the 7
th
byte. If a byte is lost during communication, it will result in a
wrong checksum and an error is issued accordingly, with potentially other information, such as, which byte
seems wrong, and timeout error for the missing 8
th
byte.