IntroductionMTB StatementsFile SystemCompilerApplicationsReference GuideIndex

QTerm Gateway

Comet includes the ability to communicate with specialized external software routines. These interfaces are accomplished via Comet gateways. The QTerm gateway is a session of QTerm, running on a Comet host processor, that provides access to a remote system to which the QTerm is connected.

One way to visualize a QTerm gateway is as a "tunnel." The tunnel runs from the Comet system, to QTerm (running memory resident in the same machine as Comet), and then to the remote processor where QTerm is connected. On that remote processor, the 8 sessions of QTerm are configured with terminal names and partitions name. Read and write requests to the gateway from the Comet system are directed by QTerm, through the appropriate session, to the remote processor. The remote processor then does some activity to that terminal name, which goes back through the tunnel, to the initiating terminal, the one that opened the gateway.

  ___________________                     ______________________
  |  Comet machine  |                     |  Remote processor  |
  |                 |                     |                    |
  |                 |                     |                    |
  | configured      |                     |  configured        |
  | gateways and    |                     |  partitions:       |
  | sessions:       |                     |                    |
  |                 |                     |                    |
  | T14 ----- G00   |              /------|  partition P14     |
  | T15 ----- G01   |-------------|-------|  partition P15     |  
  | T16 ----- G02   |              \------|  partition P16     |
  |                 |                     |                    |
  -------------------                     ----------------------

The diagram above show the stricture of a system set of for 3 QTerm gateways. The Comet machine has QTerm loaded and connected to the Remote machine. The QTerm in the Comet machine is configured as T14/P14, T14/P15, and T16/P16 on the Remote machine. In Comet, gateway G00 is configured to correspond to the session number associated with T14; G01 corresponds to the session number of T15; and G02 corresponds to the session number of T16. Any user running under Comet on the Comet machine can open a gateway, and directly communicate wit the Remote machine. The Remote machine can also communicate with the Comet machine by writing to one of the QTerm terminal names. The Remote machine can be either a Comet system of a Qantel system.

Example:

As an application example, the following simple program provides the functionality of a *REMOTE program. In this example, the QTerm gateway allows a single-user Comet system, or any terminal on a multi-user Comet system to actually run programs on the Remote system. Essentially, whatever is typed on the Comet terminal is transmitted through the gateway to the Remote processor. When this program us run n a terminal on the Comet system, whatever is typed on the terminal is written to the chosen gateway. If the user types RUN *EDIT, the *EDIT program would urn on the Remote processor in the partition associated with gateway G01. The prompt that is displayed when the program is run will be written to the Comet terminal. Effectively, the Comet terminal is now "locally" attached to the remote processor.

  LENGTH 2 & LOCAL M$
  LENGTH 200 & LOCAL A$, B$, C$, D$
  1000    FORMAT M$;A$;B$;C$;D$
  2000    FORMAT (ET);A$;B$;C$;D$
  3000    FORMAT (EN);A$;B$;C$;D$
  CLEAR
  100     A$="WHICH SESSION (0-8)?" & PRINT (0,2000)
          INPUT (0) A$
          A$=SUB(A$,1,1)
          IF A$ LT "0" OR A$ GT "8" THEN GOTO 100
          A$ = "G0"+A$
          OPEN (1) A$, EXCP=100
  1000
          ESCAPE TO 2000
          A$=STS(0)
          IF SUB(A$,3,1)="1" THEN READ (0,1000) & PRINT (1,1000)
          IF SUB(STS(1),9,1) NE "1" THEN GOTO 1000
          READ (1,1000
          IF M$="@0E04@" FILE (1) CTL="@06" &_    ! turn off F2
                         FILE (1) CTL="@05@       ! and F3
          IF M$="@0E0F@"                          ! logoff program
               IF A$="" THEN RUN "QMONITOR"       ! sends this to
               GOTO 1000                          ! exit
          ENDIF
          IF M$="@0E05@"                          ! if (ET)
               PRINT (0,2000)                     ! tell Comet, so
                                                  ! subsequent
                                                  ! prints stay in
                                                  ! (ET)
          ELSE
               IF M$="@0E06@"                     ! check for (EN)
                    IF A$="@0E0F@" RUN "QMONITOR
                    PRINT (0,3000)
               ENDIF
          ENDIF
          GOTO 1000
  2000    FILE (1) CTL="@03@"
          PRINT (0) "@0E04@"
          GOTO 1000

In its simplest explanation, a program running on Comet system A above can write to the QTerm gateway, and by writing to the gateway it is just as if whatever is written was actually entered at the QTerm gateway PC.

Because QTerm provides up to 8 sessions, there are essentially 8 gateways available to any Comet system.

The QTerm gateway responds to several controls which allow for full terminal interaction. The controls are:

Control Description
"@01@" Set F1
"@02@" Set F2
"@03@" Set F3
"@04@" Modem command follows
"@05@" Reset F3
"@06@" Reset F2
"@07@" Reset F1

These controls are written to the QTerm gateway by using the FILE command in MTB. You will note that at statement label 2000 in the listing above, the program issues the following command to the gateway:

     FILE (1) CTL="@03@"

Since the program is coded for an ESCAPE TO 2000, whenever F3 is pressed on the local terminal, an F3/Transmit is issued to the gateway and to the remote processor.

The QTerm gateway also responds to the STS function with the following returned values:

  Byte    Description/Value(s)
  =================================================================
  1       "@77@"
  2       "@99@"

  3-10    Describe the status of the terminal, each byte being 1 or
          0 with the following meaning:

          Byte 3    inoperable if set to 1
          Byte 4    F3 is on if set to 1
          Byte 5    F2 is on if set to 1
          Byte 6    Read request is pending is set to 1
          Byte 7    80-column mode if set to 1
          Byte 8    not used
          Byte 9    Busy if set to 1
          Byte 10   F1 was pressed if set to 1

  11-18   Describe the last poll type, each byte being 1 or 0 with
          the following meaning:


          Byte 11   Always 0
          Byte 12   Always 0
          Byte 13   Always 0
          Byte 14   Set to 1 if the last poll was a status poll,
                    set to 0 if the last poll was a data poll
          Byte 15   Always 0
          Byte 16   Always 1
          Byte 17   Set to 1 if the last poll was a status poll,
                    set to 0 if the last poll was a data poll
          Byte 18   Always 1

Gateways may also be used to read and write files between machines, in an interactive manner. Rather than using QTerm to upload or download an entire file, you can write an MTB program that opens the gateway, requests a record from the host processor, receives the record, and displays it on the terminal that requested it. You can also write a program in QICBASIC on the Qantel system that reads and writes to the QTerm session associated with the gateway.

One gateway application, already in use, moved a large history file from a Qantel system to a Comet single-user system, and connected the Comet system to the Qantel via QTerm. When a user on the Qantel system needs to see something in the history file, a program is run on the Qantel that writes to one of the QTerm partitions, requesting a record to be read. A program running on the Comet system, receives the request for information by reading the gateway device, and returns the appropriate date to the Qantel by writing to the gateway.