Data Exchange Protocol between Language Teacher xx200D and Personal Computer
Serial port settings
Baud rate |
4800 |
Data bits |
8 |
Parity |
None |
Stop bits |
2 |
Exchange diagram
Data record
|
Bytes
|
Value, hex
|
Start marker
|
1
|
0x7E
|
Type of data
|
1
|
Personal phones = 0x00
Business phones = 0x09
Memo = 0x02
Anniversary = 0x0A
Schedule = 0x01
Account = 0x03
Deposit = 0x04
Withdrawal = 0x05
Transfer = 0x06
First language User's Dictionary = 0x07
Second language User's Dictionary = 0x08
|
Data length in bytes
|
1
|
nDataLen
|
Divider1
|
1
|
0x00
|
Data
|
nDataLen
|
<Data>
0xF0 – divider between fields
|
Divider2
|
1
|
0x00
|
CRC
|
1
|
- CRC = Sum of transmitted bytes from <Type of data> to <Divider2>
- CRC = 0xFF – CRC
|
End marker
|
1
|
0xF3
|
Protocol description
- Receiver sends Record Reception Request – 0x5C.
- After reception of Record Reception Request Transmitter sends the records of the selected section in the following order:
- Start marker - 0x7E
- type of data -
Personal telephones = 0x00
Business telephones = 0x09
Memo = 0x02
Anniversary = 0x0A
Schedule = 0x01
Account = 0x03
Deposit = 0x04
Withdrawal = 0x05
Transfer = 0x06
First language User's Dictionary = 0x07
Second language User's Dictionary = 0x08
- Data length in bytes
- Divider1 - 0x00
- Data (fields divider – 0xF0, there is no divider after the last field)
- Divider2 - 0x00
- CRC – complement of the sum of the all trasmitted bytes (without Start marker) to 0xFF.
- End marker – 0xF3
- Reciever receives the data and check the CRC. If CRC is OK, go to the step 1. If CRC is bad, connection closes.
- After the transmission of the last record Transmitter sends End of transmission (0xF5) immediately after the End marker of the last record and connection closes.
Data format
Type of data |
Field Name |
Field type |
Field limitation, bytes |
Personal telephones |
name |
text |
All over 5 field length sum is 250. Each of them can not exceed 246. |
tel |
text |
fax |
text |
e-mail |
text |
address |
text |
Business telephones |
name |
text |
All over 6 field length sum is 250. Each of them can not exceed 245. |
tel |
text |
fax |
text |
e-mail |
text |
address |
text |
contact |
text |
Schedule |
date |
date+year |
5 |
start time |
time |
5 |
end time |
time |
5 |
affair |
text |
206 |
alarm time |
time |
5 |
Anniversary |
date |
date |
3 |
content |
text |
239 |
Memo |
title |
text |
All over 2 field length sum is 250. Each of them can not exceed 249. |
content |
text |
Account |
a/c no. |
text |
These 3 fields length sum is 214. Each of them can not exceed 210. |
owner |
text |
details |
text |
credit limit |
float |
Storage length is 18, but the input length is 10 |
amount |
float |
Storage length is 18 |
Deposit, Withdrawal |
date |
date+year |
5 |
a/c no. |
text |
These 2 fields length sum is 229. Each of them can not exceed 228. |
owner |
text |
amount |
float |
Storage length is 18, but the input length is 10 |
Transfer |
date |
date+year |
5 |
from a/c |
text |
These 3 fields length (owner also included) sum is 229. Each of them can not exceed 228. |
to a/c |
text |
amount |
float |
storage length is 18, but the input length is 10 |
owner |
text |
see from a/c and to a/c fields. |
First language User's Dictionary |
title |
text |
All over 2 field length sum is 250. Each of them can not exceed 249. |
content |
text |
Second language User's Dictionary |
title |
text |
All over 2 field length sum is 250. Each of them can not exceed 249. |
content |
text |
Note: New line symbol in the textual data has the code 0x0D (not 0x0A 0x0D)
Date, Year and Time encoding
|
Byte 1
|
Byte 2
|
Byte 3
|
Byte 4
|
Date |
Month
|
Day
|
-
|
-
|
Date+Year |
Century
|
Year
|
Month
|
Day
|
Time |
Hours
|
Minutes
|
-
|
-
|
Every byte in Date, Year and Time are encoded as binary-decimal number. That means that every half byte represents one decimal digit. To avoid zero bytes every half byte is incremented by 1. So if we have Time in the unit encoding as follow:
0x34 0x66
We decrement every byte by 0x11. Now we have 0x23 0x55. Every half byte should be interpreted as decimal digit now: 23h 55m
Another example for Date+Year:
0x2A 0xAA 0x23 0x3A should be interepreted as 19 99 12 29 or 29-dec-1999
|