The text of a manual · part 13 of 20
Bar Code Handy Terminal BHT-4000 User's Manual: Chapter 3 Communications Operations of BHT-4000, pages 90 to 98
Pages 90 to 98 of 163, from Bar Code Handy Terminal BHT-4000 User's Manual
The original document is the PDF (3.1 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.
Filed in the catalog under the NipponDenso BHT-3045, Denso BHT-3041 and Denso BHT-3045
Page 90
3.2.2 Communications Parameters In each of System Mode, Easy Pack 4.2, and user programs written in BHT-BASIC 3.0, you may set the communications parameters listed below. Communications Port
Optical interface or direct-connect interface
Transmission Speed
300, 600*, 1200, 2400, 4800, 9600, 19200, 38400** bps, or High Speed***
Character Length
7 or 8 bits
Vertical Parity
Odd, even, or none
Stop Bits
1 or 2 bits
RS/CS Control
Enable or disable * Not available in System Mode. ** Available only when the direct-connect interface port (QM connector) has been selected. *** Available only in Transfer Utility.
In System Mode Refer to Chapter 2, Subsection 2.4.3 Detailed Description of the Functions in System Mode, [ 4.5 ] Setting the communications parameters and interface port.
In Easy Pack 4.2 Refer to Chapter 4, Subsection 4.3.2 Manager Menu, [ 3 ] "Set Condition" Mode.
In BHT-BASIC 3.0 To set the transmission speed, character length, and the number of stop bits, use the OPEN "COM:" statement in BHT-BASIC 3.0. OPEN "COM: ... "
Opens the interface port selected in System Mode.
OPEN "COM1: ..."
Opens the optical interface port for data transmission routing through the CU-4000, irrespective of the setting in System Mode.
OPEN "COM2: ..."
Opens the direct-connect interface port for direct data transmission, irrespective of the setting in System Mode.
Note that it is impossible to open both the optical interface port and the direct-connect interface port concurrently. Through the interface port opened by the OPEN "COM:" statement, the XFILE statement transmits a designated file. 80
Page 91
Chapter 3. Communications Operations of BHT-4000
3.3 BHT-Protocol 3.3.1 Overview The BHT-protocol is the communications procedure used to transmit files between the BHT-4000 and a host (or between the BHT-4000 terminals). It adopts the response method using ACK/NAK codes. The BHT-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 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.
81
Page 92
3.3.2 Control Characters The control characters are classified into two groups: transmission control characters and text control characters.
(1)
Transmission control characters
The transmission control characters listed below are used to compose transmission control sequences in phases 1 through 3. 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).
82
Page 93
Chapter 3. Communications Operations of BHT-4000
(2)
Text control characters
The text control characters are used to format transmission text. In the BHT-protocol, they include the following headers and a terminator. 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 by the protocol functions in BHT-BASIC 3.0. If you designate none of them in a user program, the BHT-4000 may apply those as listed above. Refer to the "BHT-BASIC 3.0 Programmer's Manual."
83
Page 94
3.3.3 Basic Format of Transmission Messages Basically, the BHT-4000 transmits data as a unit of a file. First, it transmits a heading text which includes the attribute information of a file (e.g. file name and the number of data texts) to be transmitted. 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, and a header and terminator are added to each block. If the serial number management or error checking by BCC (Block Check Character) are required, the serial number and BCC are also added to each block. This procedure forms a transmission block. A set of transmission blocks comprises a transmission message. Shown below is an example of a transmission message formed with the BHT-protocol.
Text
Heading text
S O H
Transmission Message
Data text 1
Data text 2
Heading text
Serial number
Data text 1
S T X
Serial number
Data text n
E T X
B C C
Transmission block
E T X
B C C
Transmission block
E T X
B C C
Transmission block
...
S T X
Data text n
In the above figure, SOH, STX, and ETX are text control characters as described in Subsection 3.3.2. The serial number is added to every data text in order to identify those texts. For BCC, refer to Subsection 3.3.6.
84
Page 95
Chapter 3. Communications Operations of BHT-4000
3.3.4 Transmission Control Sequences Shown below is a typical message transmission sequence supported by the BHTprotocol. This sequence does not include transmission errors or negative responses.
Sending Station
Establishment of Data Link (Phase 1)
Receiving Station
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 T Serial number X
Data text n
E B T C X C ACK
Release of Data Link (Phase 3)
EOT ACK
85
Page 96
Data transmission may accidentally involve various types of errors. The BHT-protocol is designed to recover from those errors as frequently as possible. What follows is the BHT-protocol for phases 1 through 3.
Phase 1: Establishment of Data Link
■ Normal phase 1 The sending station transmits an ENQ to the receiving station. Upon receipt of an ACK from the receiving station, the sending station shifts to phase 2.
ENQ
Sending station
Receiving station
ACK
To phase 2.
■ Phase 1 with no response or invalid response If the sending station receives no response or any invalid response from the receiving station in response to the ENQ sent, it iterates sending of an ENQ at three-second intervals up to 10 times. If the sending station receives an ACK before sending an ENQ ten times, it shifts to phase 2. Sending station
ENQ
3 sec. ENQ 3 sec. ENQ
ACK
To phase 2.
86
Receiving station
Page 97
Chapter 3. Communications Operations of BHT-4000
■ Abnormal termination of phase 1 (Abort of phase 1) If the sending station receives no ACK from the receiving station after sending an ENQ 10 times in succession, it sends an EOT to the receiving station after three seconds from the 10th ENQ to terminate the message transmission abnormally.
Sending station
Receiving station
ENQ(1) 3 sec. ENQ(2) 3 sec. ENQ(3)
ENQ(10) 3 sec. EOT Abnormal termination
87
Page 98
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 an ACK from the receiving station, it sends a transmission block containing the data texts as shown below. Upon receipt of an ACK in response to the last transmission block (data text n), the sending station shifts 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
ACK
Data text 1
ACK
Data text n-1
ACK
Data text n
ACK
To phase 3.
88