Discussion:
need a control character
(too old to reply)
muta...@gmail.com
2021-06-11 04:38:06 UTC
Permalink
When my application, e.g. micro-emacs, is printing
something on the screen, and then does a calculation,
only micro-emacs knows whether it has finished
writing or not. The OS and the user need to wait.

On some terminals, like a 3270, the screen would
actually be locked while this is happening.

Then, micro-emacs switches to read. It is only at that
point that the OS knows that the writing has finished.

I'm not so much interested in the 3270 at this point,
but a user/app/OS at the other end of a COM port
using a terminal emulator, maybe ANSI.

The OS my end needs to send something down the
COM port to let the user know that they can start
typing, and that the OS my end is now in read mode.

I guess an ANSI sequence could be sent, if one exists.
But it may be a line mode terminal, so I don't think
that is the right level.

I think there should be a control character to say that
the mode has just switched. Does one exist?

Thanks. Paul.
muta...@gmail.com
2021-06-11 05:49:16 UTC
Permalink
I guess XON and XOFF would do this.

And one end can keep sending XON to say "hey,
I'm waiting!!!".

BFN. Paul.
muta...@gmail.com
2021-06-11 06:14:06 UTC
Permalink
And when you are doing interactive chat, you need
a button that says "send and over-to-you" and you
are now at the mercy of the other guy. Your computer
will lock waiting for him to respond.

Whereas if you just want to continuously rant, you just
keep hitting "send" (or "enter").

I guess on a button-less system you need to enter a
control character. Would ctrl-Z do the trick? That
would presumably trigger EOF on the other end, which
may be the correct thing to do. Well, you really want to
trigger XON. Maybe you should do ctrl-Q.

BFN. Paul.
muta...@gmail.com
2021-06-11 07:09:58 UTC
Permalink
And if someone currently in control of a conversation
also has nothing to say, they should send an EOF
somehow instead of an XON.

Unless a two-way XON triggers an EOF both ends?

BFN. Paul.
Scott Lurndal
2021-06-11 14:13:37 UTC
Permalink
Post by ***@gmail.com
When my application, e.g. micro-emacs, is printing
something on the screen, and then does a calculation,
only micro-emacs knows whether it has finished
writing or not. The OS and the user need to wait.
On some terminals, like a 3270, the screen would
actually be locked while this is happening.
Then, micro-emacs switches to read. It is only at that
point that the OS knows that the writing has finished.
I'm not so much interested in the 3270 at this point,
but a user/app/OS at the other end of a COM port
using a terminal emulator, maybe ANSI.
The OS my end needs to send something down the
COM port to let the user know that they can start
typing, and that the OS my end is now in read mode.
I guess an ANSI sequence could be sent, if one exists.
But it may be a line mode terminal, so I don't think
that is the right level.
I think there should be a control character to say that
the mode has just switched. Does one exist?
I think RS232C ports have been full duplex for half
a century, and half-duplex with a control character
is a ridiculous step backward.

There's a reason nobody uses block-mode terminals
any more.
muta...@gmail.com
2021-06-11 14:57:11 UTC
Permalink
Post by Scott Lurndal
Post by ***@gmail.com
I think there should be a control character to say that
the mode has just switched. Does one exist?
I think RS232C ports have been full duplex for half
a century,
And before that?
Post by Scott Lurndal
and half-duplex with a control character
is a ridiculous step backward.
No. It's neat. Within the limits of C90.
Post by Scott Lurndal
There's a reason nobody uses block-mode terminals
any more.
3270s aren't used anymore? Even via emulation?

BFN. Paul.
JJ
2021-06-11 14:57:17 UTC
Permalink
Post by Scott Lurndal
I think RS232C ports have been full duplex for half
a century, and half-duplex with a control character
is a ridiculous step backward.
There's a reason nobody uses block-mode terminals
any more.
AFAIK, all serial port pins are one way only. i.e. TX can't be used to
receive data, and RX can't be used to send data. So, half-duplex is
impossible.

XON-XOFF is just a software implementation for RTS-CTS via TX-RX on 3-wires
(TX-RX-GND) cables. And the existence of "don't send anything yet" signal is
to prevent buffer overrun. For (old/lightweight) controllers which don't
have any hardware buffer, that is to tell the other end that the processor
is currently busy with other things - where any received data will be
ignored and lost.
Rod Pemberton
2021-06-12 12:40:04 UTC
Permalink
On Fri, 11 Jun 2021 21:57:17 +0700
Post by JJ
Post by Scott Lurndal
I think RS232C ports have been full duplex for half
a century, and half-duplex with a control character
is a ridiculous step backward.
There's a reason nobody uses block-mode terminals
any more.
AFAIK, all serial port pins are one way only. i.e. TX can't be used to
receive data, and RX can't be used to send data. So, half-duplex is
impossible.
Wikipedia says otherwise:
https://en.wikipedia.org/wiki/RS-232#RTS,_CTS,_and_RTR
--
What is hidden in the ground, when found, is hidden there again?
Rod Pemberton
2021-06-12 12:39:54 UTC
Permalink
On Thu, 10 Jun 2021 21:38:06 -0700 (PDT)
Post by ***@gmail.com
When my application, e.g. micro-emacs, is printing
something on the screen, and then does a calculation,
only micro-emacs knows whether it has finished
writing or not. The OS and the user need to wait.
On some terminals, like a 3270, the screen would
actually be locked while this is happening.
Then, micro-emacs switches to read. It is only at that
point that the OS knows that the writing has finished.
I'm not so much interested in the 3270 at this point,
but a user/app/OS at the other end of a COM port
using a terminal emulator, maybe ANSI.
The OS my end needs to send something down the
COM port to let the user know that they can start
typing, and that the OS my end is now in read mode.
I guess an ANSI sequence could be sent, if one exists.
But it may be a line mode terminal, so I don't think
that is the right level.
I think there should be a control character to say that
the mode has just switched. Does one exist?
Apparently, software flow control for RS-232C is called XON/XOFF:
https://en.wikipedia.org/wiki/Software_flow_control

Hardware hardware flow control for RS-232C is generally done via the
RTS/CTS lines. RS-232C also has DTR/DSR lines which is used for
hardware flow control with certain devices.
https://en.wikipedia.org/wiki/RS-232#RTS,_CTS,_and_RTR

RS-232C null-modem cables usually tie RTS & CTS together, and tie DTR,
DSR, & CD together, on each end. This allows for a 3-wire cable (RXD,
TXD, GND), e.g., via RJ14 telephone cord, to connect between two
DB25-to-RJ45 adapters wired as null-modems.
https://en.wikipedia.org/wiki/Registered_jack#RJ11,_RJ14,_RJ25_wiring

Random image from Google of DB25-to-RJ45 adapter used with RJ14:
https://www.computercablestore.com/modular-adapter-kit-db25-male-to-rj45-green
--
What is hidden in the ground, when found, is hidden there again?
Loading...