1.0 Binary Message Structure - Prolific PL-6315 User Reference Manual

Binary message protocol
Table of Contents

Advertisement

1.0 Binary Message Structure

The PL-6315 binary message comprises of binary string with length of up to 255 characters. It has the
following format:
Format
%%<Message Start>Message Body><Message End><CR><LF>
Description
Leading Byte 1
Leading Byte 2
Message Start
Message Body
Message End
Ending Byte 1
Ending Byte 2
Message Start: <Frame Type> <Frame ID>
Message Type: ACK (06h), NAK (15h), Input (F1h), Output (F2h)
Message ID: Number between 0x01, 0xEF
Message Body: Contains input parameter or output information related to the particular message.
Message End: Checksum byte. The checksum is calculated by performing exclusive-or, XOR, of all
bytes from <Message Type> till the last byte prior to <Checksum Byte>:
CS = CS ^ <Data Byte>, where initially CS = 0
Sample C-Code for Calculating Checksum
char BIN_ComputeChecksum( char* buf, int len )
{
int
i;
char chksum;
chksum = 0;
for (i=0; i<len; i++ ) chksum ^= buf[i];
return sum;
}
Sample Binary Message: The following binary message sets baud-rate to 19200.
25 25 f1 02 00 02 00 00 00 00 00 00 f3 0d 0a
PL-6313 Product Datasheet
Message Type
Message ID
Checksum Byte
- 5 -
PL6315_Binary Message Protocol_v0.5.doc
Value
%
25h
%
25h
Up to 250 bytes
<CS>
xxh
<CR>
0Dh
<LF>
0Ah
Revised Date:
July 21, 2009
Document Version 0.3

Advertisement

Table of Contents
loading

Related Products for Prolific PL-6315

Table of Contents