Command protocol
Leuze electronic
DCR 50
66
Section
Bytes (or Range) Number of
Bytes
Description
Request ID
0x0000
2
Following the convention, we add 0x8000 to
the transaction number.
Payload
39
Returns
<Response Val="0" Descrip-
tion="none" />
CRC16
0xDA64
2
In accordance with the protocol, the host device sends an acknowledgement packet before sending the
next command.
Tab. 9.6:
Host acknowledgement for example 1
Section
Bytes (or Range) Number of
Bytes
Description
Start of Frame
0x01
0x43
0x54
3
Packet Version
0x31
1
Packet Length
0x000F
2
Destination Address
0x01234567
4
Source Address
0x40000000
4
Protocol Type
0x01
1
Flags
0x01
Payload Protocol
0x00
1
Acknowledgement Num-
ber
0x8000
2
CRC16
0x2CCE
2
9.1.6
Example 2: Getting information about a device after startup
In this example, the host device has been communicating with the device for some time and is ready to
send another command: enable Code 128 and set it as a default value.
Assumptions:
• Address of the host device: 0x40000000
• Address of the device: 0x01234567
Tab. 9.7:
Command packet for example 2
Section
Bytes (or Range) Number of
Bytes
Description
Start of Frame
0x01
0x43
0x54
3
Packet Version
0x31
1
Packet Length
0x001D
2
19 + 10 = 29 = 0x001D
Destination Address
0x01234567
4
Source Address
0x40000000
4
Protocol Type
0x01
1