7Check Sum
The Check Sum is data to which
PC side |
|
|
|
|
|
|
|
|
STX | ID | GET command | ETX |
|
|
|
|
|
02 (hex) | 2 Byte | 3 Byte | 03 (hex) |
|
|
|
|
|
|
|
|
| Set side |
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| STX | GET command | Data | Check sum | ETX |
|
|
|
| 02 (hex) | 3 Byte | *Byte | 2 Byte | 03 (hex) |
Example) Check Sum value that is added when the GET command [GAA] returns the following
Data group (ASCII) | GET command | Data (6 Byte) | Check sum |
+ check sum | GAA | 100128 | xx (before calculation) |
| |||
|
|
|
|
|
|
|
|
|
| ≠ | ||
The data group is put into binary code |
|
| 47 | 41 | 41 | 31 30 30 31 32 38 |
| |
|
| |||||||
one character at a time then displayed. |
|
|
|
|
|
|
|
|
Only the last two digits are displayed. | when these values are added the result is 1F5 (hex) |
≠
xx, where xx is 0B (hex), is added to 1F5 so the last two digits are 00 (in this case 200)
≠
as the data format, OB is converted to ASCII code and sent
≠
The following data is output from the plasma display side.
STX | GET command | Data | Check sum | ETX |
02 (hex) | GAA | 100128 | 0B | 03 (hex) |
|
|
|
|
|
*The returned data group isin capital English letters. Please keep this in mind when introducing it into the binary code..
7Examples of check sum applications
Example 1) When the data is missing 1 Byte
STX | GET command |
|
|
| Data |
|
| Check sum | ETX | ||||
02 (hex) |
|
| GAA |
| 100 (missing data) 28 |
| 0B | 03 (hex) | |||||
|
|
| 47 | 41 | 31 | 30 | 30 | 32 | 38 |
|
|
| |
|
|
|
|
| |||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data group is calculated according to rules set by a PC application when these values are added, the result is 1C4 (hex)
≠
value xx, where xx is 3C (hex), is added to 1C4 such that the last
two digits are 00 (in this case 200)
≠
check sum [OB (hex)] and the calculated [3C (hex)] do not match
≠
Since they do not match, the PC application repeats the GET command and retrieves the data again.
Example 2) When 1 Byte of data in the data is unreadable
STX | GET command |
|
|
| Data |
|
|
|
| Check sum | ETX | ||||
02 (hex) |
|
| GAA |
|
|
| 100328 |
|
|
|
| 0B | 03 (hex) | ||
|
|
| 47 | 41 | 31 | 30 | 33 | 30 | 32 | 38 |
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data group is calculated according to rules by a PC application when these values are added, the result is 1F7 (hex)
≠
value xx, where xx is 09 (hex), is added to 1F7 such that the last two digits are 00 (in this case 200)
≠
check sum [OB (hex)] and the calculated [09 (hex)] do not match.
≠
16 | Since they do not match, the PC application repeats the GET command |
and retrieves the data again. |