What I found really surprising, is its support of the so-called block mode and for fields for output and input on the screen, which enable a host computer to define kind of a form on the screen, which the user can fill out. After pressing the "Send" key or a function key the input fields changed by the user are transferred in one go back to the host.
This looks very much like the way how 3270 terminals for the IBM mainframe computers work. Unfortunately, the commands, which the IBM 3151 understands in order to define the fields etc. are not the same as the ones of the IBM 3270 protocol, but they are very similar. Therefore, it is quite easy to translate the 3270 commands to semantically equivalent 3151 commands and vice versa. The IBM 3151 also speaks ASCII instead of the EBCDIC encoding used by the IBM mainframes. But this translation is also straightforward.
This little interface program performs these translations by connecting to a real or emulated IBM mainframe via telnet and to an IBM 3151 terminal via an RS232 serial port connection. Then, the data stream coming in from the mainframe is transformed into the corresponding 3151 commands, EBCDIC is tranlated to ASCII, and the result is then sent to the terminal. The same is done for the other direction.
Alternatively, you can download everything here: mainframe3151.zip
The github repository and the zip file contain the source code and an executable file (mainframe3151.exe) for Windows. You can just use the exe file or build the program from the sources with the "make.bat" batch file. You need gcc and MinGW for this.
mainframe3151 <serial port> <server> <port> [ -i ]Where the parameters mean the following:
mainframe3151 COM3 localhost 3270This establishes the connection with an IBM 3151 terminal connected at serial port COM3 and with an emulated mainframe (e.g. with Hercules) running on your computer. The mainframe emulation in this case accepts its terminal connections at telnet port number 3270.
The 3151 connected to a mainframe then looks like this:
I also made a video about it:
Have fun working on a mainframe with a real IBM terminal!