Response Packet; Host Acknowledgement; Example 1: Enabling Code 93 Upon Startup - Leuze electronic DCR 40 Original Operating Instructions

Scan engine
Table of Contents

Advertisement

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
Start of Frame
Packet Version
Packet Length
Destination Address
Source Address
Protocol Type
Flags
Payload Protocol
Acknowledgement Num-
ber
Transaction Number
Request ID
Payload
Leuze electronic
Bytes (or Range) Number of
Bytes
0x01
3
0x43
0x54
0x31
1
0x001D
2
0x0FFFFFFF
4
0x40000000
4
0x01
1
0x00
0x02
1
0x0000
2
0x0000
2
0x8000
2
10
DCR 40
Description
19 + 10 = 29 = 0x001D
Broadcasting to every listening device.
Starting with zero for the transaction number.
Following the convention, we add 0x8000 to
the transaction number.
The bytes represent the ASCII command
SYCO93PEN1.
Command protocol
65

Advertisement

Table of Contents
loading

Table of Contents