Command Protocol; General Commands; Command Packet - Leuze electronic DCR 40 Original Operating Instructions

Scan engine
Table of Contents

Advertisement

9

Command protocol

Each device has a well-defined protocol for communication. The protocol can be split into two parts:
• General command/response-type communication
• Barcode decoding
9.1

General commands

Most of the time, the user will use the command protocol when communicating with the device. The figure
shows the general command sequence for sending a command to the device.
Fig. 9.1:
General command sequence
• The host device sends a properly formatted command to the device.
• The device sends an acknowledgement to the host device.
• Immediately after the acknowledgement, the device sends a response to the command.
• To maintain communication integrity, the host device sends an acknowledgement back to the device.
9.1.1

Command packet

To send a command to the device, a properly formatted packet must be formed.
Tab. 9.1:
Command packet format
Section
Start of Frame
Packet Version
Packet Length
Destination Address
Leuze electronic
Bytes (or Range) Number of
Bytes
0x01
3
0x43
0x54
0x31
1
0x0013 – 0xFFFF 2
0x00000000 –
4
0x0FFFFFFF
DCR 40
Description
Three bytes that indicate the beginning of a
message
Indicates the version number for the packet
format. This value is always 0x31.
Indicates the number of bytes that are sent
after these two bytes, up to and including the
CRC. This value should be 19+N.
This value is written as a 2-byte big endian
value.
Represents the address of the device that
you are attempting to communicate with.
0x0FFFFFFF is a special address indicating
that the host device wants to broadcast to all
devices on the network. Anything less than
this value is a real device address.
This value is written as a 4-byte big endian
value.
Command protocol
62

Advertisement

Table of Contents
loading

Table of Contents