The text of a manual · part 43 of 47
PDT 1100 Terminal Programmer's Guide: Appendix M Communications, pages 368 to 377
Pages 368 to 377 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 368
Appendix M Communications Basic Communications Specifications The following table lists the communications specifications for the PDT 1100 and a host computer via the CRD 1100 (optical interface) or direct-connect interface cable. Table M-1. Communications Specifications Communications Port
Optical Interface
Synchronization
Direct-connect Interface Start-stop
Transmission Speed
2400, 9600, 19200, 38400, 57600, or 115200 bps
300, 600, 1200, 2400, 4800, 9600, 19200, or 38400 bps
Character Length
8-bits
7- or 8-bits
Transmission Bit Order
LSB (Least significant bit) first
Response Method
ACK/NAK response
Vertical Parity
None
Even, odd, or none
Transparency
Transparent or non-transparent mode
Stop Bit Length
1 bit
1 or 2 bits
Synchronization For accurate data transaction, synchronize the transmission between the sender and receiver. To do this, define the bit order, position, the character length, and the beginning and end of the character to be transmitted. The start-stop synchronization is an asynchronous system which synchronizes each character as a unit; that is, it externally adds start and stop bits to the leading and trailing bit positions M-1
Page 369
PDT 1100 Terminal Programmer’s Guide of the character to be transmitted, respectively. A clock starts counting when it receives the start bit and it stops communicating when the stop bit is received. The number of the stop bits is selectable (1 or 2 bits).
Optical Interface Communications Range The optical interface's maximum effective range is 80 cm with the IR beam within a 10° angle of divergence.
Transmission Code and Bit Order All characters should be coded to 7- or 8-bit code for data transmission. The standard data exchange code of the PDT 1100 is 7- or 8-bit code. The transmission bit order is LSB (Least Significant Bit) first. Following is an example for transmitting character A (41h, 01000001b) coded to 8-level code with an even parity and a single bit for start and stop bits. LSB 1
Start Bit
0
0
0
0
0
1
0
0
Stop Bit Parity Bit
35864050.eps
Figure M-1. Transmission Example
Response Method When two devices initiate communications, they exchange signals for correct data transmission. This procedure is called “handshaking” or “data link establishment phase.” The sender sends a control code ENQ (05h) to inquire if the receiver is ready to receive data, and the receiver replies with a control code ACK (06h)(positive) or NAK (15h)(negative) to start data transmission.
Vertical Parity A vertical parity bit is a redundancy bit added to every character to be transmitted to check that data has been transmitted accurately. The parity bit should be set to “1” or “0” depending upon the parity parameter setting, to make the number of set bits in the character even or odd. The receiver counts the number of set bits in the transmitted character code to
M-2
Page 370
Communications make sure that it has the selected number (even or odd) of set bits. The vertical parity bit immediately follows the MSB (Most Significant Bit) as shown below. LSB b0
MSB b1 b2 b3 b4 b5 b6
Vertical Parity Bit LSB b0
MSB b1 b2 b3 b4 b5 b6 b7
Vertical Parity Bit
35864051.eps
Figure M-2. Vertical Parity
BCC for Horizontal Parity Checking The PDT 1100 supports horizontal parity checking for every transmission block to check data transmission. A horizontal parity byte called BCC (Block Check Character) is appended after the ETX of every transmission block. Every parity bit of BCC is set so that all set bits at the same bit level (including a parity bit) in the transmission block characters have an even number by binary addition, excluding SOH, STX, and functions SOH$ and STX$. (Refer to SOH$ on page 11-47 and STX$ on page 11-50.)
M-3
Page 371
PDT 1100 Terminal Programmer’s Guide
(Vertical Parity)
35864062.eps
Character
[For 8-bit Data]
Horizontal Parity Byte (BCC)
Figure M-3. Horizontal Parity Checking
IR Protocol 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: ! ! !
M-4
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.
Page 372
Communications
Communications Parameters In System Mode and user programs written in BASIC 3.0, you may set the communications parameters listed below Table M-2. Communications Parameters Communications Port
Optical interface
Direct-connect interface
Transmission Speed
2400, 9600, 19200, 38400, 300*, 600*, 1200, 2400, 4800, 57600, or 115200 bps 9600, 19200, or 38400 bps
Character Length
8 bits
7 or 8 bits
Vertical Parity
None
Odd, even, or none
Stop Bit Length
1 bit
1 or 2 bits
* The 300 bps and 600 bps are not available in System Mode.
In System Mode Refer to the PDT 1100 Terminal Product Reference Guide to set communications parameters in the system mode.
In BASIC 3.0 To set the transmission speed (optical interface only), character length, vertical parity, and stop bit length , use the OPEN "COM:" statement in BASIC 3.0. !
! !
OPEN "COM:... " opens the interface port selected in System Mode.Through the interface port opened by the OPEN "COM:" statement. The XFILE statement transmits a designated file through the interface port. OPEN "COM1:... " opens the optical interface port for data transmission routing through the CRD 1100, regardless of the setting in System Mode. OPEN "COM2:... " opens the direct-connect interface port for data transmission, irrespective of the setting in System Mode. Note: You cannot open both the optical interface port and the directconnect interface port at the same time.
M-5
Page 373
PDT 1100 Terminal Programmer’s Guide
Communications Protocols The PDT 1100 supports both the protocol and the Ir protocol for file transmission.
Protocol The protocol uses the ACK/NAK response method to transmit files between the PDT 1100 and a host (or between PDT 1100s). The protocol is composed of a defined set of 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 whether or not all of the transmitted data has been correctly received by the receiving station. If yes, the sending station terminates the data transmission and releases the data link.
Control Characters There are two groups of control characters: transmission control characters and text control characters. The transmission control characters in the following table compose transmission control sequences in phases 1 through 3. Table M-3. Transmission Control Characters Symbol Value
Meaning
Function
EOT
04h
End Of Transmission
Releases a data link (Phase 3), requests abort of transmission (Phase 2).
ENQ
05h
Enquiry
Requests establishment of a data link (Phase 1), prompts the receiver to respond to the sent text (Phase 2).
ACK
06h
Acknowledge
Acknowledgment response to ENQ (Phase 1), acknowledgment response to text (Phase 2), acknowledgment response to EOT (Phase 3).
NAK
15h
Negative Acknowledge Negative acknowledgment response to ENQ (Phase 1), negative acknowledgment response to text (Phase 2).
The PDT 1100 uses non-transparent mode. It views the control characters and codes (e.g., STX, ETX, and SOH) as starting or ending markers and does not transmit them as normal data in the transmission texts. M-6
Page 374
Communications
Text control characters format transmission texts. In the protocol, they include the following headers and a terminator. Table M-4. Text Control Characters Symbol
Value
Meaning
Function
SOH
01h
Start Of Heading
Indicates the start of heading text (Phase 2).
STX
02h
Start Of Text
Indicates the start of data text (Phase 2).
ETX
03h
End Of Text
Indicates the end of data text (Phase 2).
You may designate headers and a terminator with the protocol functions in BASIC 3.0. If you do not designate them in a user program, the PDT 1100 may apply them as listed above.
Format of Transmission Messages The PDT 1100 transmits data as units of a file. First, it transmits a heading text which includes the file information (e.g., file name and the number of data texts) to be transmitted. Then, it transmits the data text in the file. A heading text and data text comprise a text. In text transmission, the text is divided into several blocks, with a header and terminator added to each block. If the serial number management or error checking by BCC (Block Check Character) is required, the serial number or BCC is also added to each block. This forms a transmission block. A set of transmission blocks makes up one transmission message.
M-7
Page 375
PDT 1100 Terminal Programmer’s Guide
Shown below is an example of a transmission message formed with the protocol.
Text
Heading Text
Data Text 1
Data Text 2
S O
Heading Text
H
Transmission Message
S T X
Serial
Data Text 1
Number
S T X
Serial Number
Data Text
E
B
T
C
X
C
E
B
T
C
X
C
E
B C C
T
Data Text
X
Transmission Block
Transmission Block
Transmission Block
35864052.eps
Figure M-4. Protocol Transmission Message In this figure, SOH, STX, and ETX are text control characters as described in Control Characters. A serial number is expressed by a five-digit decimal number, starting from 00001 to 32767, and identifies transmitted data texts. For the BCC, refer to PDT 1100 Terminal Product Reference Guide.
M-8
Page 376
Communications
Transmission Control Sequences Shown below is a typical message transmission sequence supported by the protocol. This example does not include transmission errors or negative responses. Receiving Station
Sending Station Establishment of Data Link (Phase 1)
ENQ ACK
S O H
Heading Text
E B T C X C ACK
S T Serial Number X
Data Text 1
E B T C X C ACK
Data Transmission (Phase 2)
S T Serial Number X
Data Text n-1
E B T C X C ACK
S Serial Number T X
Data Text n
E B T C X C ACK
Release of Data Link (Phase 3)
EOT ACK 35864053.eps
Figure M-5. Sample Transmission Control Sequence M-9
Page 377
PDT 1100 Terminal Programmer’s Guide
Errors may occur during data transmission. The protocol recovers from these errors as frequently as possible. Following is the protocol for errors during phases 1 through 3.
Phase 1: Establishment of Data Link Normal phase 1:The sending station transmits an ENQ to the receiving station. When an ACK is received the receiving station, the sending station shifts to phase 2. ENQ Receiving Station
Sending Station ACK
To phase 2.
35864054.eps
Figure M-6. Normal Phase Phase 1 with iterated ENQ transmission 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 an ENQ , it resends an ENQ at three-second intervals up to 10 times. If it receives an ACK during this time, it proceeds to phase 2. Sending Station
ENQ
3 seconds
ENQ
3 seconds
ENQ
Receiving Station
ACK
To phase 2.
Figure M-7. Phase 1 with Repeated ENQ Transmission M-10