This document briefly describes the TNG telescope control user interface. This software was written to provide a friendly interface with the telescope, allowing the user to give commands to and get telemetry from it even without knowledge of the underlying control system hardware and software structure. The interface also gives access to on-line facilities, such as star catalogues, and to the telescope subsystems interfaces. Integration tests have been performed through subsequent steps and the merging of the different software packages involved is almost complete.
The TNG telescope control user interface (TNG-UI) was built to provide a friendly interface between the user and the Galileo Telescope control system (TNG-CS). The code is written using IDL and its widgets: IDL is a widespread, rather flexible language and supplies all the necessary mathematical and graphical facilities needed; moreover its widgets are a good way to build an easy-to-use window interface.
The TNG-CS is based on different hardware/software architectures, widely described in related papers (see ref. 1 and 2). At low level, the control of the telescope is made by means of VME crates, one for each subsystem (Drive, Active Optics, Rotator Adapter, etc.); GATE (GAlileo Telescope Environment) is the main software package running on VME CPUs.
At high level, HP workstations are used. Each workstation communicates with one or more VMEs through standard IP channels. The software package WSS (Workstation Software System) interacts with GATE and manages the communication between the workstations and the telescope.
WSS processes can be divided into two categories: Main processes, providing for the basic functionality of WSS, and Ancillary processes, controlling the telescope subsystems. TNG-UI is seen by WSS as an ancillary process. At run time, the communication between the two programs is assured by a library of functions accessed by the call_external IDL procedure.
The main goal of TNG-UI is to present the user with an easy interface, where all the relevant information from the telescope is collected and where she/he can enter all the commands to control an observation. At the same time, this should be done hiding the underlying complexity of heterogeneous hardware and software choices.
The main problem we had to solve was in fact the need to merge different software packages (SPs), written by different people in different languages. To reach the purpose we built a software strongly independent (i.e. it can run in stand-alone mode), and at the same time very flexible to allow easy interaction with the other SPs. Data exchange is fitted to the characteristic of each SP.
The operations handled by the TNG-UI can be subdivided in three classes, depending on the affinity with the interacting SP:

Through the main window (see Fig. 2) the following basic operations
are handled:
1. Display information. The information available in the main window
is:

2. Send commands to the telescope:
This window is opened by clicking the New next button of the Main window. Here the data of the new target to be pointed by the telescope are provided. Data can be entered one by one by the user, and the program will verify if wrong data are provided (i.e.: coordinates value out of boundary). It is also possible to "catch" the data of already defined target (previous, current, as well as catalogue stars) using catch-buttons (Get previous, Get current, Get APTA). Once defined, a preliminary calculation of Azimuth and Elevation of the selected target can be performed. By clicking the Apply button the data are transferred to the next target box of the Main window.

3.3 THE PREVIEW WINDOW
In the Preview window information about position and limit condition of objects can be obtained. Once the target is defined by the user using the catch-button, the program calculates and displays the limit STs (that's to say the sidereal times at which the target reaches the mechanical limits of the telescope) and the time needed to reach those limits (time-to-limit) which is periodically updated. STs and time-to-limit for Azimuth and Elevation axes are shown on the left part of the window, the ones for rotator axis on the right. A graphical representation is also provided at the bottom of the window (see Fig. 4).

3.4 THE HISTORY WINDOW
In the History window the telescope activity is recorded. Telescope status, commands sent, target selected during the night and so on can be retrieved by the user at any moment. It is opened by the Main window at the boot and suddenly hidden. Its content is also written on a log file to disk.
3.5 THE TELEMETRY WINDOWS
The user can access the Telemetry windows to display in detail
the telemetry coming from the telescope. The table of telemetry parameters
useful at this level is not completely defined; however the following telemetry
windows are available:
The Encoder window will be useful to handle directly a packet of encoder readouts. Once retrieved from VMEGATE, the packets are displayed by two draw widgets, and the telescope velocity and acceleration along the two axes are calculated and displayed as well. Relevant data can be saved to and loaded from disk, and a zoom facility is provided to explore in detail significant regions of the graphic.

3.6 THE BUILDING WINDOW
From this window the user can control movable parts of the building
and of the telescope, and monitor the position of the service cranes. The
following parts can be remote-controlled:

Due to geometric and safety reasons, not all the operations are available at the same time. For example, the M3 baffle can't be raised before the mirror cover is in open position. All these priority are taken in account by the code, and only the allowed widget are sensitive for a given system configuration.
3.7 POINTING AN OBJECT
To point a given object, the user will therefore perform the following actions:
The stellar catalogues available are:
The first one contains a very small number of objects (about 5000) but with very accurate position and magnitude. This small catalogue was extracted from the Fundamental Catalog FK5 Extension and will be used to make and check the telescope set point. The interface of this catalogue APTA (Accurate Procedure for Telescope Aim) was written in IDL language (see ref. 7 and ref. 8). APTA is a stand alone task that communicates and exchanges information with the TNG-UI by mean of structure variables that can be modified from both SP. Fig. 7 shows the APTA graphical interface called from the Main window pressing the Apta button. This interface displays all the objects of the catalogue and moves them on the sky with a settable refresh rate ranging from 10 to 120 seconds. The user, to make the telescope set point, must press the Point button; a new window will be opened. Moving the cursor on the graphical interface the apparent coordinates of the objects highlighted will be displayed. Pressing the left button of mouse the data of selected star are sent to the Next object input window. Here we list the buttons of the APTA windows with a little description:

The second catalogue contains about 15 million of objects from a matching between the GSC-1.1 (complete up to magnitude 15) and the Tycho catalogues taking only objects classified like a star (ref. 9). The goal of this catalogue is to provide the user with a list of stars, close to the target object, suitable for guiding purposes. For the time being, stars are selected only on the basis of their proximity to the target; it is foreseen, however, to implement a set of checks, both on the stars themselves (magnitude, color) and on technical constraints (i.e. to avoid probe collisions).
Files are binary, for a faster reading, and each record contains the
following information:
| Field N. | Variable | Type |
| 1 | Right Ascension (degree) | Real*16 |
| 2 | Declination (degree) | Real*16 |
| 3 | Magnitude | Real*8 |
| 4* | Proper Motion R.A. (mas) | Real*8 |
| 5* | Proper Motion Dec (mas) | Real*8 |
| 6* | B | Real*8 |
| 7* | B-V | Real*8 |
| 8 | Identification 1 | Integer*4 |
| 9 | Identification 2 | Integer*4 |
The extracting procedure reads, only the first time that it is called, an ascii table that contains the list of files with its right ascension and declination range. When a user sends a query, this procedure searches, in this table, the corresponding file and extracts only the objects that satisfy it. The link at this catalogue, using the button of the Main window, is simpler than APTA because the Main window sends only some parameters (see Fig. 8) and the catalogue procedure will respond with a list of objects. In the GSC search window the mandatory fields to be filled are: Epoch, RA, Dec, Elong. In the Suggested GS will appear, after clicking on Search button, a list of the objects that match with the query. The user, clicking on it, can choose the best Guide Star according to her/his purpose.

The integration with the star catalogues has been done, requiring some modification on both sides in order to achieve a higher efficiency and compactness in the data exchange protocol and to solve some conflicts between the programs when running together on the same platform.
At the moment we are testing the communication between TNG-UI and WSS. Commands defined in the tables were sent to the telescope through the entire pipe and received by the VME-CPU DRIVE. An acknowledgement was sent back by GATE and successfully received by the interface. During the test the shared library was slightly modified to improve the communication protocol.
We plan to insert, on the GSC search facility, the automatic display of the digitized sky using the GSC-1 Sky Survey. This will be very useful to help the user in identifying the field. We also plan to upgrade the catalogue with the GSC-1.2 and the GSC-2 catalogues that will be complete up to the 19th magnitude (with a lot of plates until 21th) in three different colours for about two billion objects. This GSC-2 catalogue will be available on December 1999.
A document which describes the whole software integration at TNG is
available at:
http://www.tng.iac.es/html/documents/tngdocpub/software/software_comm.html