The spectrometer interacts with the user via a series of m e n u s . E a c h m e n u p r o v i d e s c o m m a n d s r e l a t i n g to a particular aspect of the operation of the system. These menus a l l o w easy access to a l l of the m ajor system functions and make the spectrometer both interactive and easy to use. The relationship between the menus is shown in figure 2.16 together with the character commands used to move from one to another. Those lines shown broken in figure 2.16 require i n t e r m e d i a t e disc storage for the results•
The control software is w r i t t e n in two l a n g u a g e s to o p t i m i s e s p e e d and m e m o r y r e q u i r e m e n t s . A l l d a t a acquisition and interface control routines are written in a s s e m b l e d Z80 m a c h i n e code, w h e r a s d a t a a n a l y s i s , storage, manipulation and display routines are written in compiled Pascal. In addition, user i n t e r a c t i o n via the menu system is incorporated into the high level programs.
Because of space c o n s tr ai nt s w ithin the m e m o r y of the Nascom III, the control system is formed from three high l e v e l programs. 'CONTROL' is r e s p o n s i b l e for a l l data c o l l e c t i o n and i m m e d i a t e a n a l y s i s . The z e r o and calibration program 'CALIBRAT' is used for setting up the system for a m e a s u r e m e n t series, w h i l e 'ANALYSIS' is r e s p o n s i b l e for o f f - li ne a n a l y s i s and d i s p l a y of the
ZERO AND CALIBRATION MENU
C STARTj
ANALOGUE GENERATION MENU DIGITAL ^ GENERATION MENU RESULTS MANIPULATION MENUA I
ANALYSIS & DISPLAY MENU A M MASS COMPENSATION MENU FIGURE 2.1 6R e l a t i o n s h i p B et we e n the M e nu s and the High P rog ra ms .
CALIBRAT
CONTROL
results. The relationship between each of these programs and the m e n u s y s t e m is s h o w n in f i g u r e 2.16. The computer will automatically load and execute the relevant program when required. Several other programs have been w r i t t e n to p e r fo r m s p e c i a l i s e d a n a l y s i s and d i s p l a y functions [2 ]. This library of support programs will not be discussed here.
The software system r elies h e a v i l y on the f a c i l i t i e s provided by the operating systems in the Nascom III. For more details the literature available with the equipment s h o u l d be c o n s u l t e d [ 6 , 7 , 1 8 , 1 9 , 2 0 , 2 1 ] . A b a s i c understanding of Pascal and assembly language programming has been assumed. Many textbooks on these languages have been published [22,23,24].
Listings of the s p e c t r o m e t e r software are g i v e n in the appendices. Appendix II contains the Pascal source text for the three programs; CONTROL, CALIBRAT and ANALYSIS. A p p e n di x III h o l d s the flo w charts, and a p p e n d i x IV an assembler listing of the machine code routines.
2.5*2 High Level Data Analysis
In this section the main data analysis fuctions performed by the high l e v e l p rogra m C O NT RO L are described. These i n cl ud e a m p l i t u d e and phase d i f f e re nc e c a l c u l a t i o n , a u t o r a n g i n g and the c o m p r e s s i o n system. Each f u n c t i o n takes up the m ajor part of a p r o ce du r e in the c o m p l e t e program (see appendix II). The relevant procedures are:
AMPLITUDES : amplitude and phase calculation.
AUTORANGE : autoranging system.
ANALYSIS B : autoranging, compression and averaging. In the complete software system the first two procedures are nested in the third. •On initiation of a measurement the ANALYS IS B pr oc e du re is called, which then c a l l s A M P L I T U D E S and A U T O R A N G E as required. S e v e r a l minor p r o c e d u r e s are c a l l e d by t h e s e m a i n o ne s d u r i n g execution. For s i m p l i c i t y these w i l l not be d is cu s s e d here. Figures 2.17-2.19 show f l o w charts of the three main data analysis procedures.
The Amplitudes Procedure
This p ro cedure initiat es a m e a s u r e m e n t via the m a c hi n e code routines d es cr i b e d in the next section. F ro m the tables of data generated the amplitude of each signal is c omputed (in volts), t og et he r with the phase d i f f e r e n c e (in radians) and the s ignal period (in seconds). The gain of the input boards is a u t o m a t i c a l l y taken into account when the c a l c u l a t i o n s are made. The softw ar e f o l l o w s c l o s e l y the a l g o r i t h m o u t l i n e d in sect io n 2.5* By testing the sign of the i nt eg ra l sums and i[>2 defined in equat io n 2.4, phase d if fe r e n c e s in the range 0 - 2tt can be detected. Figure 2.17 shows the f l o w chart
for this procedure. The Autorange Procedure
After the first execution of AMPLITUDES control is passed to this procedure. At the start of each measurement the p r o g r a m m a b l e gains of the input boards is set at an
( SfART )
<
CALL (^L E V A N T MACHINE CObE EAT AAcQUlSrTlON OQOTirit - bAOf o r fcAOf 2-
>
CALCULATE TMHE PEfcOb CP HSNALS 1
2 __________