The text of a manual · part 45 of 47
PDT 1100 Terminal Programmer's Guide: Appendix M Communications, pages 388 to 397
Pages 388 to 397 of 413, from PDT 1100 Terminal Programmer's Guide
The original document is the PDF (3.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Symbol PDT-1100
Page 388
Communications
IR Protocol Overview The IR protocol is the communications procedure for the serial infrared link, which is used to transmit files between the PDT 1100 and a host (or between the PDT 1100s). It adopts the response method using ACK/NAK codes. The Ir protocol can be used also for communications through the direct-connect interface. The IR protocol is composed of a defined set of the control character sequences including the following three phases: ! ! !
Phase 1: Establishment of data link - the sending station confirms that the receiving station is ready to receive data. Phase 2: Data transmission - the sending station transmits data to the target receiving station. Phase 3: Release of data link - the sending station confirms that transmitted data has been correctly received by the receiving station. If yes, the sending station terminates the data transmission and releases the data link.
M-21
Page 389
PDT 1100 Terminal Programmer’s Guide
Control Characters The control characters are classified into two groups: transmission control characters and text control characters.
Transmission Control Characters The transmission control characters listed below are used to compose transmission control sequences in phases 1 through 3. Table M-5. Transmission Control Characters Symbol
Value
Meaning
DLE EOT
1004h End Of Transmission
Function Releases a data link (Phase 3). Requests abort of transmission (Phase 2).
DLE ENQ 1005h Enquiry
Requests establishment of a data link (Phase 1). Prompts the receiver to respond to the sent text (Phase 2).
DLE ACK
Acknowledgment response to DLE ENQ (Phase 1). Acknowledgment response to text (Phase 2).
1006h Acknowledge
Acknowledgment response to DLE EOT (Phase 3). DLE NAK 1015h Negative Acknowledge
Negative acknowledgment response to DLE ENQ (Phase 1). Negative acknowledgment response to text (Phase 2).
WACK
Requests suspension of data reception during erasure of the flash ROM.
1038h Wait For Acknowledge
Transparency The PDT 1100 uses the transparent mode which allows the control characters and codes (e.g., STX, ETX, SOH, and DLE) to be transmitted as normal data in the transmission texts. To transmit a DLE as normal data, type DLE DLE per DLE.
M-22
Page 390
Communications
Text Control Characters The text control characters are used to format transmission texts. In the Ir protocol, they include the following headers and a terminator: Table M-6. Text Control Characters Symbol
Value
Meaning
Function
DLE SOH 1001h Start Of Heading
Indicates the start of heading text (Phase 2).
DLE STX
1002h Start Of Text
Indicates the start of data text (Phase 2).
DLE ETX
1003h End Of Text
Indicates the end of data text (Phase 2).
In the Ir protocol, you cannot change the values of the headers and terminator with the protocol functions in BASIC 3.0.
M-23
Page 391
PDT 1100 Terminal Programmer’s Guide
Format of Transmission Messages The PDT 1100 transmits data as units of a file. First, it transmits a heading text which includes the file to be transmitted(e.g., file name and the number of data texts). Following the heading text, it transmits the data text in the file. A heading text and data text comprise a text. In actual text transmission, the text is divided into several blocks, then a header, terminator, serial number, receiver station's ID, and CRC-16 (Cyclic Redundancy Check) are added to each block. This procedure forms a transmission block. A set of transmission blocks makes up one transmission message. Shown below is an example of a transmission message formed with the Ir protocol.
Text
Heading Text
S D L * O E H
Data Text 1
Data Text 2
I
Data Text
E D L * T E X
C R C
Transmission Block
Data Text 1
E D L * T E X
C R C
Transmission Block
Data Text 2
E D L * T E X
C R C
Transmission Block
Heading Text D
(2 bytes)
Transmission Message
D S L * T X E
D S L * T E X
I D
I D
Serial Number (5 bytes)
Serial Number
34864068.eps
Figure M-20. Transmission Message formed with Ir Protocol In the above figure, DLE SOH, DLE STX and DLE ETX are text control characters as described in [2] Control Characters. An ID denotes the ID number of the receiver station, expressed by two bytes. A serial number is expressed by a five-digit decimal number, starting from 00001 to 32767, and identifies data texts. For the CRC-16, refer to [6] CRC.
M-24
Page 392
Communications
Note: You can use the control characters for expressing IDs, serial numbers, or text data.
Transmission Control Sequences Following is a typical message transmission sequence supported by the Ir protocol. This sequence example does not include transmission errors or negative responses. Receiving Station
Sending Station Establishment of Data Link (Phase 1)
DLE ENQ and IDM* DLE ACK and IDs** D S I L *O E H D
D E C Heading Text L * T R E X C
DLE ACK and IDs D S I Serial L*T Number E X D
Data Text 1
D E C L *T R E X C
DLE ACK and IDs Data Transmission (Phase 2)
D S I Serial L *T E X D Number
D E C Data Text n-1 L * T R E X C
D S I Serial L *T Number E X D
D E C L *T R E X C
DLE ACK and IDs Data Text n
DLE ACK and IDs Release of Data Link (Phase 3)
DLE EOT and IDs DLE ACK and IDs *IDm: ID of sending station **IDs: ID of receiving station
35864069.eps
Figure M-21. Ir Protocol Transmission Message M-25
Page 393
PDT 1100 Terminal Programmer’s Guide
Data transmission may accidentally involve various types of errors. The Ir protocol is designed to recover from those errors as frequently as possible. What follows is the Ir protocol for phases 1 through 3.
Phase 1: Establishment of Data Link Normal Phase 1 The sending station transmits a sequence of DLE ENQ and IDm (sending station's ID) to the receiving station. Upon receipt of a sequence of DLE ACK and IDs (receiving station's ID) from the receiving station, the sending station shifts to phase 2. Sending Station
Receiving Station
DLE ENQ and IDm
DLE ACK and IDs
To phase 2.
Figure M-22. Normal Phases Phase 1 with repeated transmission of DLE ENQ and IDm due to no response or invalid response: If the sending station receives no response or any invalid response from the receiving station in response to the sent sequence of DLE ENQ and IDm, it iterates sending of the sequence at 0.5-second intervals up to 60 times. If the sending station receives a sequence of DLE ACK and IDs before sending the sequence of DLE ENQ and IDm 60 times, it shifts to phase 2. Sending
DLE ENQ and IDm
Station 0.5 second
DLE ENQ and IDm
0.5 second
DLE ENQ and IDm
Receiving Station
DLE ACK and IDs
To phase 2. 35864070.eps
Figure M-22. Phase 1 with repeated transmission of DLE ENQ and IDm Transmission
M-26
Page 394
Communications
Note: You may modify the number of iterations of a sequence of DLE ENQ and IDm for the sending station. The default is 60 times at 0.5-second intervals. For details, refer to the SET LINKUP TIME screen in System Mode (p. 52) and the XFILE statement given on XFILE on page 10-130. Abnormal termination of phase 1 (Abort of phase 1): If the sending station receives no sequence of DLE ACK and IDs from the receiving station after sending a sequence of DLE ENQ and IDm 60 times in succession, it sends a sequence of DLE EOT and IDm to the receiving station 0.5 seconds from the 60th sequence of DLE ENQ and IDm, then aborts the message transmission. Sending Station DLE ENQ and IDm (1) 0.5 second
DLE ENQ and IDm (2)
0.5 second
DLE ENQ and IDm (3)
0.5 second
DLE ENQ and IDm (60)
Receiving Station
DLE EOT and IDm
Abnormal Termination 35864071.eps
Figure M-23. Abort of Phase 1 Note: The receiving station's default timeout is 30 seconds. You may modify the timeout length on the SET LINKUP TIME screen in System Mode or by using the XFILE statement (refer to XFILE on page 10-130).
M-27
Page 395
PDT 1100 Terminal Programmer’s Guide
Phase 2: Data Transmission Normal phase 2:The sending station first sends a transmission block containing the heading text. Each time the sending station receives a sequence of DLE ACK and IDs from the receiving station, it sends a transmission block containing the data texts as shown below. When a sequence of DLE ACK and IDs is received in response to the last transmission block (data text n), the sending station proceeds to Phase 3. If a transmission message contains no data text, the sending station transmits the heading text only. Sending Station
Receiving Station
Heading Text DLE ACK and IDs
Data Text 1 DLE ACK and IDs
Data Text n-1 DLE ACK and IDs
Data Text n DLE ACK and IDs
To phase 3. 35864072.eps
Figure M-24. Normal Phase 2 Phase 2 with suspension of data reception for erasure of the flash ROM: If the receiving PDT 1100 needs to erase the flash ROM for receiving downloaded files, it sends a sequence of WACK and IDs to the sending station to suspend data transmission. When the sequence of WACK and IDs are received, the sending station stops the data transmission until a response
M-28
Page 396
Communications comes from the receiving station. If no response comes within one minute, the sending station sends a sequence of DLE EOT and IDs and aborts the current transmission.
Sending Station
Heading Text
Receiving Station
WACK and IDs
Start Of Erasur
DLE ACK and IDs
End Of Erasure
Data Text #1 DLE ACK and IDs
35864073.eps
Figure M-25. Phase 2 with suspension of data reception
M-29
Page 397
PDT 1100 Terminal Programmer’s Guide
Phase 2 with a sequence of DLE NAK and IDs If the sending station receives a sequence of DLE NAK and IDs from the receiving station in response to a transmission block containing text data m, it sends that transmission block again immediately as shown below. If the sending station receives a sequence of DLE ACK and IDs before receiving the sequence of DLE NAK and IDs 10 times in succession, it continues the subsequent message transmission. Sending Station
Data Text m
Receiving Station
DLE ACK and IDs Data Text m DLE ACK and IDs Data Text m DLE ACK and IDs Data Text m+1
Figure M-26. Phase 2 with a sequence of DLE NAK and IDs If the sending station receives a sequence of DLE NAK and IDs 10 times in succession or it fails to send a same transmission block, it proceeds to Phase 3 to abort the message transmission abnormally, even if Phase 3 terminates normally. Sending Station
Data Text m(1)
Receiving Station
DLE ACK and IDs Data Text m(2) DLE ACK and IDs
Data Text m(10) DLE ACK and IDs
Occurrence Of An Error
To phase 3.
Figure M-26. Phase 2 with Repeated Transmission of DLE ENQ and IDs
M-30