QTERM-IV/P40 User's Manual
27
Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770
have at least one key defined with the EOP character. The
EDIT buffer is not cleared automatically after transmission.
4.3.4
EDIT Mode and the Use of Local and Host Data
Because host data in the string definitions is sent to the
EDIT buffer on the LCD, Local-mode, display data loses
some of it's utility when you run in Block Mode. For exam-
ple, a key defined as follows:
<k00> 'To Host',\L, 'Local data'
would put both “To Host” and “Local Data” in the EDIT
buffer. Since both strings wind up in the EDIT buffer, what
use is Local Mode? Don't be fooled; there are big differ-
ences in the way Host and Local data are handled.
Host data is not interpreted in any way by the QTERM,
other that to detect an EOP Terminator indicating the EDIT
buffer should be transmitted. The QTERM simply puts all
Host Data, as is, into the EDIT buffer. On the other hand,
Local Data is sent through the QTERM's command proces-
sor. The command processor looks for any QTERM com-
mands and executes them. If it cannot find any commands,
it assumes the Local Data is just display information and
sends it to the LCD. Both the strings in the key definition
above get into the EDIT buffer, but they get there in
entirely different ways.
Because of this behavior, you probably will not use Local
Mode display data, by itself, very often while running in
Block Mode. You will find uses for Local Mode commands
though. For example, by executing a Local Mode cursor
positioning command, you could put Local mode display
data on the LCD but somewhere other than the EDIT
buffer. You cannot do this with Host Data; it is always
directed to the EDIT buffer.
4.3.5
Defining Editing Keys for the EDIT Buffer
Certain commands, when executed from within a Local
Mode string while running in Block Mode, can be used to
create EDIT Buffer editing keys so the user can modify
characters entered into the EDIT buffer prior to sending the
buffer to the host. These commands, if executed from
within a Local Mode string, behave differently than if they
were received from the host and operate only on the EDIT
buffer. These commands are: BackSpace (ASCII BS, 08),
DELete (ASCII DEL, 127), Cursor Left (
]
D), Home Cur-
sor (
]
H), and Flush TX buffer (
]
k).
Backspace, Delete and Cursor Left will only move the cur-
sor left to the start of the EDIT buffer. Home Cursor homes
the cursor to the start of the EDIT buffer and Flush TX
Buffer clears the EDIT buffer and returns the QTERM to
IDLE mode. These functions are not usually limited to
operating on the EDIT buffer; this behavior only occurs
when they are executed within a Local Mode string while
the QTERM is in Block Mode.
As an example, you might want to define 3 EDIT buffer
editing keys: clear buffer, cursor left and cursor right.
These keys would be defined as follows:
<k00> \L,x1B,'H',x1B,'K'; Clear Buffer
<k01> \L,x1B,'C'; Cursor Right
<k02> \L,x1B,'D'; Cursor Left
There are a few things to notice in these definitions. First,
note that the Clear Buffer key does not use the Flush TX
buffer command but rather, homes the cursor (
]
H) then
clears to the end-of-line (
]
K). This is because the Flush
TX Buffer command not only clears the EDIT buffer, it
also returns us to IDLE mode. To clear the EDIT buffer and
remain in EDIT mode, home the cursor to the start of the
buffer with the
]
H command, then clear the line.
Also note that the Cursor Right key uses the standard Cur-
sor Right command which is not one of the commands
mentioned above which takes on special behavior regarding
the EDIT buffer. This is because the Cursor Right com-
mand naturally stops at the end of the current line which is
also always the end of the EDIT buffer.
Lastly, the Cursor Left key uses the standard Cursor Left
command. This command will normally move the cursor
left up to the beginning of the current line. In this applica-
tion though, since we are in Block Mode and it is being
executed from within a Local Mode string, the Cursor Left
command takes on special behavior and stops at the start of
the EDIT buffer rather than the start of the current line.
4.3.6
The EOP Terminator and EDIT Mode
In order to transmit the EDIT buffer to the host, the
QTERM must execute a string defined with the EOP Ter-
minator character. When the EOP Terminator is executed,
the EDIT buffer is transmitted, the cursor returns to the
start of the EDIT buffer, EDIT mode is canceled and the
terminal returns to IDLE. Note that the EDIT buffer is not
cleared.
If you wish to clear the EDIT buffer after it is transmitted,
you can define your “Enter” key as follows:
<k53>x0D,\L,x1B,'K';Transmit buffer
;and clear it
x0D is the default EOP Terminator (you may define EOP to
be any byte value), then we switch to Local Mode and clear