ITEM: D8691L
Change IBM 3151 setup programmatically
Question:
I would like to change the setup of an IBM 3151 programmatically
instead of having to use the control setup option. Specifically,
I would like to change the line/column setup of the 3151 from a
shell script. Can/How is this done?
Response:
You need to use the "Create Viewport Command" to select a
viewport type and define the size of the viewport. In your
case you'll want to create one viewport (viewport type 1) with
one of the following commands:
24 lines of 80 characters each:
ESC SP r ! ! SP 8 " P
25 lines of 80 characters each:
ESC SP r ! ! SP 9 " P
24 lines of 132 characters each:
ESC SP r ! ! SP 8 $ D
25 lines of 132 characters each:
ESC SP r ! ! SP 9 $ D
For other setup parameters you should reference the following
IBM 3151 Commands:
Set/Read Control 1: Sets or reads the machine and operating modes
of the 3151.
Set/Read Control 2: Sets or read the machine status of the 3151.
Set/Read Control 3: Sets of reads the display functions of the 3151.
Set/Read Control 4: Sets of reads the Send parameters of the 3151.
Set/Read Control 5: Sets or reads the communication values on the
main port.
Set/Read Control 6: Sets or reads the communication values on the
auxiliary port.
Set/Read Control 7: Sets or reads the information used for a print
operation.
For more information on the above commands, please reference the
IBM 3151 ASCII Display Station Reference Manual, Chapter 6,
"Commands and Responses".
Response:
Here are some samples Korn shell scripts that will change the row and
column on the IBM 3151 and set the stty rows and columns to the
appropriate values:
24x80:
\#!/bin/ksh
echo "\\033 r!! 8\\"P"
stty rows 24
stty columns 80
25x80:
\#!/bin/ksh
echo "\\033 r!! 9\\"P"
stty rows 25
stty columns 80
24x132:
\#!/bin/ksh
echo "\\033 r!! 8\\$D"
stty rows 24
stty columns 132
25x132:
\#!/bin/ksh
echo "\\033 r!! 9\\$D"
stty rows 25
stty columns 132
Question:
How do I setup the IBM 3151 to use three viewports with 8 lines
per viewport?
Response:
To set up the create viewport command to use three viewports, you must
issue the following escape sequence to the terminal:
ESC SP r \# ! SP pd1 " 0 " SP pd2 " 0 \# SP pd3 " P
where SP=space and the pdX are the ASCII Graphic Characters for the
number of lines for the particular viewport. For 8 lines per
viewport, replace all the pdX attributes with the open parenthesis.
The command to echo in this case would be:
echo "\\033 r\#! (\\"0\\" (\\"0\# (\\"P"
To select the active partition you will need to use the following
escape sequence:
ESC ! q PID
where PID is A (Viewport 1), B (Viewport 2), or C (Viewport 3).
Support Line: Change IBM 3151 setup programmatically ITEM: D8691L
Dated: September 1993 Category: N/A
This HTML file was generated 99/06/24~13:30:55
Comments or suggestions?
Contact us