![Opticon MDI-4 00/N210 Series Скачать руководство пользователя страница 14](http://html1.mh-extra.com/html/opticon/mdi-4-00-n210-series/mdi-4-00-n210-series_instruction-manual_1642143014.webp)
MDI-4x00 / N210 Image Capture
Image Capture Manual
10
3.3.
Output Protocol
Protocol used for output is described below.
3.3.1.
Image Information Format
[Function]
This is used for image output. The image information (Information) and the image itself (Data) may be
contained in the image output.
[Format]
Start Char
rec No
Length
(A)
Information, Data (*)
Check Sum
End Char
0x21
0x0D
* When Transmission mode is ALL, Information is transmitted, followed by Data (entire image).
[Field]
Field
Size
[byte]
Details
Start Character
1
‘!’ (0x21)
rec No
2
Default value is 0.
When packets in the same format are sent continuously, this field is
incremented sequentially.
Length
4
The size of (A)
(A)
*
Information
Information of image
Data
Image itself
PART transmission mode: send line by line
ALL transmission mode: send an entire image
Check Sum
2
Calculated according to the method described below.
End Character
1
<CR> (0x0D)
* Refer to next page for each format.
3.3.2.
Calculation of the checksum
Description
The checksum is the 16 bit sum of the data elements with index i (0,1,2,
…
.) weighted by (i+1).
Calculation method
Start with a checksum of 0; then, for each data element with index 0, 1, 2, 3, and so on, multiply the
value of the data element by its index+1, and add the result to the checksum, keeping only the 16
least significant bits.
As a formula
Checksum
= (
∑
i
=
0
length
−
1
x
i
∗
(
i
+
1
))
mod
2
16