Areascan ds2 series – communication protocol, Packet description, 1 binary data packet structure – IDEC DS2_Series User Manual
Page 31: Short protocol binary data packet structure, Ascii data packet structure, Areascan, Ds2 series – communication protocol

DS2
series
Instruction
manual
30
7. AREAscan
TM
DS2 SERIES – COMMUNICATION PROTOCOL
7.1. Packet description
As mentioned, the communication protocol requires a master unit and a slave unit. The
communication type is half duplex (RS485).
The exchange of information is made in the request-reply mode: the master sends a data packet to
the slave that replies sending another data packet to the master.
7.1.1 Binary data packet structure
A binary data packet is composed of a group of bytes placed in a well-defined sequence, that
identifies it univocally. It presents a heading, body and an end.
The heading and the end have a fixed length while the body has a variable length.
Packet start
Length
Type
Data
Packet end Checksum
• Packet beginning: 1 byte, STX ASCII code (‘0x02’)
• Length:
1 byte, length in bytes of the Type field plus the Data field
• Type:
1 byte, code identifying the packet type ( ‘A’, ‘B’, ‘C’ ASCII code, etc.)
• Data:
variable number of bytes (from 0 to 254) that form the packet information
• Packet end:
1 byte, ETX ASCII code(‘0x03’)
• Checksum:
1 byte, complement to one of the Length, Type and
Data field bytes sum.
7.1.2. Short protocol binary data packet structure
There is a binary data packet with reduced protocol composed by one byte. This format is reserved
to trasmission of numeric type value only (for example one measure).
Data
Data: 1 byte with binary data packet
7.1.3. ASCII data packet structure
An ASCII data packet is composed of:
Packet start
Type
Data
Packet end
• Packet beginning:
1 byte, ‘*’ ASCII code (0x2A)
• Type:
1 byte, code identifying the packet type ( ‘A’, ‘B’, ‘C’ ASCII code, etc.)
• Data:
variable number of ‘0’-‘9’ ‘A’-‘Z’ ASCII codes (from 0 to 254) that form the
packet information
• Packet end:
1 byte, CR ASCII code (0x0D)
Heading
Body
End
Body
Heading Body
End