PT630 Programming Reference Guide
Page 60 of 59
------------------------------------------------------------------------------------------------------------------
2.1.3 Host
Transmission
Packet
Transmission
Format
Poll
STX ADDR
Host Data
STX ESC ‘0’ <data> CS1 CS2 ADDR
Host Command
STX ESC CMD <parameters> CS1 CS2 ADDR
Acknowledgement
ACK
Negative ACK
NAK
2.1.4 PT630
Transmissions
Packet
Transmission
Format
Terminal Data
STX <data> CS1 CS2 ETX
Terminal No Data
EOT
Terminal response
STX CMD <parameters> CS1 CS2 ETX
Acknowledgement
ACK
Negative ACK
NAK
2.1.5 Data Conversion Rules in Packet
1) One-byte data converted to two-byte data:
\ convert
to
\\
00
hex -- 1F hex convert
to
\ 80 hex -- \ 9F hex
A0
hex -- FF hex convert
to
\ 20 hex -- \ 7F hex
(excluding
DC
hex)
2) One-byte data transmitted as original data without converting all codes not in 1)
(including
DC
hex)
2.1.6 Data Checksum Calculation in Packet
1) CS =[sum of all characters (excluding STX and ETX) + packet length
(excluding STX and ADDR/ETX)] MOD 256
2) CS1 = high nibble of CS + 40H
3) CS2 = low nibble of CS + 40H
2.1.7 Example packet of command to send the file named A.EXE to PT630 with address ‘A’
Packet:
STX ESC CMD <parameters> CS1 CS2 ADDR
CMD =
‘L’
<parameters> = “A . E X E “
Packet length = total characters of ESC, CMD and <parameters> = 7
ADDR
= ‘A’ + 80H = C1H
CS
=
[(ESC+‘L’+‘A’+’.’+’E’+’X’+’E’+ADDR)+Packet
length]
MOD 256
=
[(1BH+4CH+41H+2EH+45H+58H+45H+C1H)+7]
MOD
256
= 80H
CS1
= high nibble of CS + 40H = 08H + 40H = 48H
CS2
= low nibble of CS + 40H = 00H + 40H = 40H