3DM
®
-GX5-35
DCP Manual
2.2.2
Example “Ping” Reply Packet
The “Ping” command will generate a reply packet from the device. The reply packet will contain an
ACK/NACK field. The ACK/NACK field contains an “echo” of the command byte plus an error code.
An error code of 0 is an “ACK” and a non-zero error code is a “NACK”:
Header
Packet Payload
Checksum
SYNC1 “u
SYNC2 “e”
Descriptor
Set byte
Payload Length
byte
Field
Byte
Length
Field
Descriptor
Byte
Field Data
MSB
LSB
0x75
0x65
0x01
0x04
0x04
0xF1
Command Echo: 0x01
Error code: 0x00
0xD5
0x6A
Copy-Paste version of reply:... “7565 0104 04F1 0100 D56A”
The packet header has the “ue” starting sync bytes characteristic of all
. The descriptor
set byte (0x01) identifies the payload fields as being from the Base command set. The length of the
payload portion is 4 bytes. The payload portion of the packet consists of one field. The field starts
with the length of the field which is followed by the descriptor byte (0xF1) of the field. The field
descriptor byte identifies the reply as the “ACK/NACK” from the Base command descriptor set. The
field data consists of an “echo” of the original command (0x01) followed by the error code for the
command (0x00). In this case the error is zero, so the field represents an “ACK”. Some examples of
non-zero error codes that might be sent are “timeout”, “not implemented”, and “invalid parameter in
command”. The checksum is a two byte
(see the
for
instructions on how to compute a Fletcher two byte checksum).
The ACK/NACK descriptor value (0xF1) is the same in all descriptor sets. The value belongs to a
set of reserved global descriptor values.
The reply packet may have additional fields that contain information in reply to the command. For
example, requesting
will result in a reply packet that contains two fields in the packet
payload: an ACK/NACK field and a device status information field.
2.3
Data Overview
Data packets are generated by the device. When the device is powered up, it may be configured to
immediately stream data packets out to the host or it may be “idle” and waiting for a command to either
start continuous data or to get data by “polling” (one data packet per request). Either way, the data
packet is generated by the device in the same way.
11