Sync Bytes : the key concepts of T2A packet
LXSDF T2A packet uses initial 2 bytes for each packet transmission as “Purpose for Synchronizing Packet”. The first byte is allocated the fixed value 255(0xFF in hex), and fixed 254 (0xFE in hex) for second byte. Namely, Sync Bytes are designed only in the spots where appear 255 and 254 sequentially in the whole packet byte arrays.
Receiving side should check each byte abd extract the “Sync Bytes”, so it can find the starting spot of 1 packet. Once finding the starting spot, it is able to extract the data needed in the program under the TX packet Standard..
The following picture indicates that the orange color part in the first 1 packet is assigned “Sync Bytes” and then a series of bytes for one packet.
T2A Packet Definitions
The table shows the definitions of T2A packet. Each index is one byte and transmitted in order when transmitting serial. An available value for each packet index, the terms of the packet elements.
|Index||Value||Packet Element Name for Stream Mode.||Packet Element Name for Non-Stream Mode.|
|0||255||SyncByte0 (Synchronization Byte 0)|
|1||254||SyncByte1 (Synchronization Byte 1)|
|2||0~254||PPD (Packet Property Data). 0~15 : Stream Mode, 16~254 : Non-Stream Mode.|
|3||0~254||PUD0 (Packet Unit Data 0)||PBS (Packet Byte Size)|
|4||0~255||PC (Packet Count)||IID (Information ID)|
|5||0~253||PUD 1 (Packet Unit Data 1)||.|
|6||0~255||PCD (Packet Cyclic Data)||.|
|7||0~253||CRD (Command Response Data). bit 6
PUD2 (Packet Unit Data 2). bit 5,4,3
PCDT (Packet Cyclic Data Type). bit 2,1,0
|8||0~253||PSD1 (Packet Stream Data High Byte)||.|
|9||0~255||PSD0 (Packet Stream Data Low Byte)||.|
|10||0~253||PSD1 (Packet Stream Data High Byte)||.|
|11||0~255||PSD0 (Packet Stream Data Low Byte)||.|
|N-1||0~253||PSD1 (Packet Stream Data High Byte)||.|
|N||0~255||PSD0 (Packet Stream Data Low Byte)||.|
|Common packet elements for both Stream Mode and Non-Stream Mode|
|Data placement for multi channel stream data. Freely expandable to any number of channels. The typical example of the multi channel stream data is the continuous output of a multi channel ADC(Analog to Digital Converter).|
Difference between Stream & Non-Stream Mode
|Packet Index||Stream Mode||Non-Stream Mode|
|2||PPD : available value 0 ~ 15||PPD : available value 16 ~ 254|
|3||PUD0 : general data allocated.||PBS : Packet Byte Size allocated.|
|4||PC : +1 for each packet.||IID : Information ID allocated.|
|6||PCD : PCD data is allocated each PC.||general data allocated.|
|7||PCDT : means PCD type.||general data allocated.|
|8 and over||PSD : real time stream data allocated.||general data allocated.|
Packet Byte Size
- Stream Mode : Predefined fixed value. ex. 16, 32, …, etc depends on applications. .
- Non-Stream Mode : Determined by packet index 3( PBS ) per each packet