Warning: When a directly attached device is connected to the IBM 71 71 port with a null modem cable, it is possible to
Chapter 6. IBM 7171 I/O Interface to the Host System
It is assumed that the reader is familiar with 3270 style Channel Command Words (CCW's) and data streams. They are defined in other IBM documentation.1
6.1 High Level Examples
HOST INTERRUPT ..
CCW CHAIN: FIRST IS SELECT RM
CHANNEL END STATUS ..
DEVICE END STATUS ..
CHAINED READ MODIFIED CCW DATA ..
CHANNEL END +
..
DEVICE END STATUS
Data movement between the host and its control units has its direction references in relation to the host. This means that Outbound Data is from host to a control unit. Inbound Data is coming to the host from a control unit.
IBM 7171 TERMINAL
ENTER KEY
I
• SELECT RM I APPLY READ MODIFIEDI
LOGIC TO TERMINAL IMAGE AND BUILD OUTPUT BUFFER
I I
• RD MOD
I
I
(The terminal keyboard locks up until a WRITE or E/W command with the)
I
(keyboard reset bit on is sent to the terminal. )
I I
Figure 6-1. Channel Inbound Data
Refer to IBM 3270 Information Display System: 3274 Control Unit Description and Programming Guide.
Chapter 6. IBM 7171 I/O Interface to the Host System
6-1
HOST CCW: ERASE/WRITE DATA STREAM
CHANNEL END STATUS II DEVICE END STATUS II
Inbound data is signaled by an action from the terminal. In the example, in
Figure 6-1, an ENTER key is hit. The IBM 7171 creates an attention interrupt for the host. The host operating system must issue some type of Read command to determine what the terminal wants. In this example a CCW chain of Select RM and Read Modified is issued. Select RM is used to inform the IBM 7171 that a Read Modified command will follow, and that to minimize channel busy the control unit should be waiting with the data stream. This is what the example shows, note that when the Select RM is received initial status of Channel End is issued and the channel is freed up for the time it takes the IBM 7171 to get the data. When the data is waiting in the buffer ending status of Device End is issued, informing the host that it may issue the following Read Modified CCW. The Read Modified command moves the data inbound immediately then supplies ending status of Channel End plus Device End.
IBM 7171 TERMINAL
I
•
I
•
I (verify data stream)
I • ERASE FULL SCREEN
I I
• SCREEN DATA
I
Figure 6-2. Channel Outbound Data
Outbound data is initiated by the host. In this example an Erase/Write CCW command is being executed. The Erase/Write command is sent to the IBM 7171, followed by the data to write on the screen. When all data is transferred to the IBM 7171, it responds with Channel End. Data stream verification and internal screen image updating takes place followed by Device End response back to the host. The IBM 7171 now sends the new screen image to the terminal.
6.2 Data Streams
The control unit provides information to, and accepts information from, the channel at an instantaneous byte rate established by the channel or control unit, whichever is the slower.
Write command operations direct movement of data to the terminal systems via the control unit. Read command operations receive their data from the screen image that exists in the control unit.
6-2
IBM 7171 Reference Manual and Programming Guide6.2.1 Interface Codes
6.2.2 Data Stream
3270 Data Stream Function
Data, commands, and orders transmitted between the control unit and the host system are in the form of interface codes. Two different codes are used in the United States: Extended Binary Coded Decimal Interchange Code (EBCDIC) and American National Standard Code for Information Interchange (ASCII). The EBCDIC codes are also used in World Trade countries (ASCII is available only in the U.S.); refer to IBM 3270 Information Display System Character Set Reference, GA27-2837, for details. The IBM 7171 only supports the EBCDIC codes from the host.
The 3270 data stream consists of application data, commands, and orders which are transmitted between the control unit and the host system.
Data transfer commands are issued to initiate such operations as the total or partial writing, reading, and erasing of data in a selected terminal character buffer.
Control commands initiate control unit operations not involved with data transfer (except for status information). Orders can be included in write data streams either alone or intermixed with display data.
Buffer control orders are interpreted and executed as they are received by the control unit, and are used to position, define, modify, assign attributes on a field and character basis, and format data being written to a display character buffer; to erase selected unprotected data in the buffer; and to reposition the cursor.
The 3270 outbound data stream consists of a Write Control Character (WCC), and if appropriate, orders, character data, and the parameters needed by a control command. Inbound data streams consist of orders and character data or requested sense and control information.
The command defines the operation to be performed.
Commands: The operations which may be specified include:
• Write to the character buffer.
• Erase and then Write to the character buffer.
• Read the entire character buffer.
Read only the Modified data from the character buffer (some exceptions).
• Erase All the Unprotected data from the character buffer.
Select a terminal and initiate terminal character buffer to control unit buffer transfer of all data, modified data only, or data from position in preparation for a Read Buffer, Read Modified or a Write operation.
• Perform No functional Operation, retrieve pending status.
Sense further definition of the Unit Check condition.
Sense the Control Unit Identification.
Chapter 6. IBM 7171 I/O Interface to the Host System
6-3
6.2.3 Write Commands
Write Command
Command codes are shown below.
Command EBCDIC
Erase All Unprotected OF
Erase/Write 05
Erase/Write Alternate OD
No Operation 03
Read Buffer 02
Read Modified 06
Select RM OB
Select RB 1B
Select RMP 2B
Select RBP 3B
Select WRT 4B
Sense 04
Sense ID E4
Write 01
Test 10 Instruction2 00 Figure 6-3. IBM 7171 CCW Command Codes
Three write type commands, Write, Erase/Write, and Erase/Write Alternate are used to load, format, and selectively erase device buffer data. These commands can also initiate certain device operations such as resetting the keyboard and sounding the audible alarm. Write and Erase/Write operations are identical except that Erase/Write causes complete erasure of the device buffer before the write operation is started. Thus, Erase/Write is used to load the buffer with completely new data, whereas Write can be used to modify existing buffer data.
Erase/Write Alternate is used by some devices to select an alternate size character buffer. After this selection is done, it functions as an Erase/Write command.
The data stream received by the IBM 7171 for a Write type command operation consists of a Write Control Character (WCC), followed by orders and/or data.
The minimum data stream for a Write type command is a one byte WCC. This is ensured because the byte count field of the write channel command word (CCW) must be set to a minimum of one or else the command code is not sent.
2 Test 10 Instruction appears to the control unit as a x ' 00' command code, but x ' 00 ' may not be coded in a CCW.