Command protocol
Leuze electronic
DCR 50
64
NOTICE
The acknowledgement number in the device acknowledgement packet is the same as the trans-
action number in the previous command packet.
9.1.3
Response packet
After the acknowledgement is sent, the device sends a response to the command. The response packet
has the same format as the command packet (see chapter 9.1.1 "Command packet") with the following dif-
ferences:
• The payload part of the response packet contains the response from the device.
• The transaction number and the request ID are swapped in the response packet (as compared to the
command packet).
• The destination address and the source address are swapped in the response packet (as compared to
the command packet).
The response is formatted as XML message. Each command description shows an example of a response
from each command when getting a value for a setting.
9.1.4
Host acknowledgement
After reception of the response packet, the host device must send an acknowledgement packet to the de-
vice. This host acknowledgement has the same format as the device acknowledgement (see chapter 9.1.2
"Device acknowledgement") with the following differences:
• The destination address and the source address are swapped in the host acknowledgement packet (as
compared to the device acknowledgement packet).
• The acknowledgement number in the host acknowledgement packet is the same as the transaction
number in the response packet.
9.1.5
Example 1: Enabling Code 93 upon startup
In this example, the host device has just powered the device and is ready to send its first command: make
sure Code 93 is enabled.
Assumptions:
• The host device does not know what the address of the device is and thus, will send out a broadcast.
• Address of the host device: 0x40000000
• Address of the device: 0x01234567
Tab. 9.3:
Command packet for example 1
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
0x0FFFFFFF
4
Broadcasting to every listening device.
Source Address
0x40000000
4
Protocol Type
0x01
1
Flags
0x00
Payload Protocol
0x02
1
Acknowledgement Num-
ber
0x0000
2