Transmission of Scanner Commands
MP150
Protocol
9
3
Transmission of Scanner Commands
Commands serve to setup functional modes and parameters in the scanner.
3.1
Command structure
Commands are generally transmitted from the PC to the scanner, and have the following format:
SOH Operation Code [Sector] [Parameter] EOT BCC
The [Operation Code] and [Parameter] are to be find in section
and the [Sector] is described in section
The frame (composed of SOH, EOT and BCC) may be left out, but should be used in the RS485
connection to avoid communication errors. (The predecessor MP50 did require the frame.)
If a command was sent with the frame, then the scanner will answer with the frame. The decision
with/without frame is made at the first sign (SOH or not SOH).
These ASCII control characters used in the protocol with their associated decimal and hexadecimal
values are the following:
Control character
decimal
hexadecimal
SOH
„start of heading”
01D
01H
STX
„start of text”
02D
02H
EOT
„end of transmission”
04D
04H
ACK
„acknowledge”
06D
06H
NAK
„negative acknowledge”
21D
15H
SYN
„synchronous idle”
22D
16H
EOF
„end of file”
26D
1AH
ETB
„end of transmission block”
23D
17H
ESC
„escape”
27D
1BH
During command and parameter transmission, transmission reliability is checked with a Block
Character Checksum (BCC).
The BCC is transmitted as the last byte of the command or parameter string. The BCC is a modulo 256
sum of all previously transmitted characters and bitwise OR-ed with 80H or 128D (to set the highest bit
of the BCC).
Example
(send the command
AR
):
SOH
01H
”A”
41H
”R”
52H
+ EOT
04H
BCC = 98H
and afterwards, bitwise OR-
ed with 80H yields (which, in this case, does not change the byte’s value):
BCC = 98H
Содержание LineScanner MP150
Страница 1: ...MP150 Linescanner Protocol Manual Rev B4 Aug 2019 51101...
Страница 2: ......