microcomputer-assisted temperature programmed desorption studies

26
0097~8485/88 $3.00 + 0.00 Pergamon Press plc Com~ul. Chem. Vol. 12, No. 4, pp. 317-342, 1988 Printed in Chmt Britain APPLICATION MICROCOMPUTER-ASSISTED TEMPERATURE PROGRAMMED DESORPTION STUDIES H. S. TAN, P. CHIAROT* and W. E. JONES? Department of Chemistry, Dalhousie University, Halifax, Nova Scotia, Canada B3H 453 (Received 2 Uctober 1987) Abeztract-An IBM-PC assisted ultra-high vacuum system for temperature programmed desorption studies is described. With the use of a self-consrructed interface hoard and a commercial IEEE interface, the microcomputer controls the heating of the adsorbent and stores the partial pressure-temperature-time data from a quadrupole mass spectrometer and thermocouple. Hardware and software details are umsentcd and discussed. Applications of the system are illustrated by the resutts of carbon monoxide &sorption from CdTe(1 IO) surface. LNTRODUCTION The method of temperature programmed desorption (TFD) has been widely used to investigate the kinetics of desorption of adsorbed gases from surfaces. This technique has been described by several authors (e.g. Readhead, 1962; Menzel, 1975; King, 1975; Yates, 1985). Generally, the experiments are conducted in an ultra-high vacuum (UHV) system and the adsorbent sample, usually in the form of a thin crystal disk, is rigorously cleaned in vacuum. The adsorbate gas is then introduced into the UHV chamber and after the adsorption of the gas, a temperature ramp, preferably linear in time, is applied to the adsorbent to desorb the gas. The partial pressure of the desorbing gas is recorded by a mass spectrometer, producing a ther- mal desorption spectrum (TDS). In a continuously pumped system, if the ratio of the pumping speed to the volume of the UHV chamber is large and the heating rate is low, the desorption rate is directly proportional to the partial pressure of the desorbing gas (King, 1975). Essentially, the TDS is the profile of the desorption rate as a function of temperature and consists of one or more peaks. The peaks produced are the net result of the counteracting effects of increasing temperature and depletion of the absorbed molecules. The TDS data can he analysed to yield information on various adsorption parameters such as the number of various desorption phases, the surface coverage, the acti- vation energy of the desorption and the kinetic order of the desorption. The number of peaks leads to useful information concerning the number of phases or states on the surface. The integral of the peak area is proportional to the initial surface coverage. The * Present address: Department of Chemical Engineering, University of Waterloo, Waterloo, Ontario, Canada N2I 4B6. t To whom correspondence should be addressed. shapes of the peaks and their behaviour with chang- ing initial coverages can be used to derive the order of desorption. Statistical analysis of the data, in terms of an Arrhenius (Polanyi-Wigner) type model, yields values of the desorption activation energy and the pre-exponential factor. In this paper we describe a microcomputer-assisted system for TPD studies. An IBM PC, equipped with appropriate interfaces. is used to run the temperature ramp program, display and save the partial pressure-temperature-time data, and process the data to yield the heating rate and surface coverage. The TDS of carbon monoxide from CdTe(l10) surface is presented as an exampIe. EXPERIMENTAL SYSTEM A schematic of the experimental system is shown in Fig. 1. The stainless steel UHV chamber is pumped with a liquid nitrogen-trapped diffusion pump and contains the sample crystal, a sputter ion gun for cleaning the front surface of the crystal, an ionization gauge for monitoring the chamber pressure, a DATAQUAD quadrupole mass spectrometer for monitoring the desorption flux, and a leak valve for introducing the adsorbate gas. A background pres- sure of the order of 1 x lo-” torr is routinely achieved in the chamber. Large pumping speeds are maintained in the system and this ensures that the desorption rate is proportional to the partial pressure of the desorbing gas. The crystal sample (adsorbent) is either spot-welded or soldered, with indium as a soldering medium, onto a nickel heating wire and a copper-constantan thermocouple is attached to the crystal. The output of the thermocouple is compared with a second identical junction maintained at ice point. The sample temperature is raised by resistively heating the support wires. The heating rate of the 317

Upload: hs-tan

Post on 21-Jun-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microcomputer-assisted temperature programmed desorption studies

0097~8485/88 $3.00 + 0.00 Pergamon Press plc

Com~ul. Chem. Vol. 12, No. 4, pp. 317-342, 1988 Printed in Chmt Britain

APPLICATION

MICROCOMPUTER-ASSISTED TEMPERATURE PROGRAMMED DESORPTION STUDIES

H. S. TAN, P. CHIAROT* and W. E. JONES? Department of Chemistry, Dalhousie University, Halifax, Nova Scotia, Canada B3H 453

(Received 2 Uctober 1987)

Abeztract-An IBM-PC assisted ultra-high vacuum system for temperature programmed desorption studies is described. With the use of a self-consrructed interface hoard and a commercial IEEE interface, the microcomputer controls the heating of the adsorbent and stores the partial pressure-temperature-time data from a quadrupole mass spectrometer and thermocouple. Hardware and software details are umsentcd and discussed. Applications of the system are illustrated by the resutts of carbon monoxide &sorption from CdTe(1 IO) surface.

LNTRODUCTION

The method of temperature programmed desorption (TFD) has been widely used to investigate the kinetics of desorption of adsorbed gases from surfaces. This technique has been described by several authors (e.g. Readhead, 1962; Menzel, 1975; King, 1975; Yates, 1985). Generally, the experiments are conducted in an ultra-high vacuum (UHV) system and the adsorbent sample, usually in the form of a thin crystal disk, is rigorously cleaned in vacuum. The adsorbate gas is then introduced into the UHV chamber and after the adsorption of the gas, a temperature ramp, preferably linear in time, is applied to the adsorbent to desorb the gas. The partial pressure of the desorbing gas is recorded by a mass spectrometer, producing a ther- mal desorption spectrum (TDS). In a continuously pumped system, if the ratio of the pumping speed to the volume of the UHV chamber is large and the heating rate is low, the desorption rate is directly proportional to the partial pressure of the desorbing gas (King, 1975).

Essentially, the TDS is the profile of the desorption rate as a function of temperature and consists of one or more peaks. The peaks produced are the net result of the counteracting effects of increasing temperature and depletion of the absorbed molecules. The TDS data can he analysed to yield information on various adsorption parameters such as the number of various desorption phases, the surface coverage, the acti- vation energy of the desorption and the kinetic order of the desorption. The number of peaks leads to useful information concerning the number of phases or states on the surface. The integral of the peak area is proportional to the initial surface coverage. The

* Present address: Department of Chemical Engineering, University of Waterloo, Waterloo, Ontario, Canada N2I 4B6.

t To whom correspondence should be addressed.

shapes of the peaks and their behaviour with chang- ing initial coverages can be used to derive the order of desorption. Statistical analysis of the data, in terms of an Arrhenius (Polanyi-Wigner) type model, yields values of the desorption activation energy and the pre-exponential factor.

In this paper we describe a microcomputer-assisted system for TPD studies. An IBM PC, equipped with appropriate interfaces. is used to run the temperature ramp program, display and save the partial pressure-temperature-time data, and process the data to yield the heating rate and surface coverage. The TDS of carbon monoxide from CdTe(l10) surface is presented as an exampIe.

EXPERIMENTAL SYSTEM

A schematic of the experimental system is shown in Fig. 1. The stainless steel UHV chamber is pumped with a liquid nitrogen-trapped diffusion pump and contains the sample crystal, a sputter ion gun for cleaning the front surface of the crystal, an ionization gauge for monitoring the chamber pressure, a DATAQUAD quadrupole mass spectrometer for monitoring the desorption flux, and a leak valve for introducing the adsorbate gas. A background pres- sure of the order of 1 x lo-” torr is routinely achieved in the chamber. Large pumping speeds are maintained in the system and this ensures that the desorption rate is proportional to the partial pressure of the desorbing gas. The crystal sample (adsorbent) is either spot-welded or soldered, with indium as a soldering medium, onto a nickel heating wire and a copper-constantan thermocouple is attached to the crystal. The output of the thermocouple is compared with a second identical junction maintained at ice point.

The sample temperature is raised by resistively heating the support wires. The heating rate of the

317

Page 2: Microcomputer-assisted temperature programmed desorption studies

318 H. S. TAN ef al.

To Sample Heater

From Mass spectmmater

Detector UHVChambsr

IBM- PC

Fig. 1. Schematic of experimental system.

sample is controlled from the IBM-PC micro- computer which calculates and sends a value of a binary variable HEAT to a DAC (digital-to-analog converter+ontrolled power supply. The binary variable HEAT is related to the current supplied to the heater and their relationship is linear from 0 to 70% of full heater current. A linear temperature-time relationship can be obtained in this range if a func- tion of HEAT = a + b (time), where a and b are the heating coefficients, is used to calculate the value of HEAT with increase in time. Within the range of l&60% of full current, excellent linearity can be achieved with a correlation coefficient of 0.9999. The user-supplied values of u and b can be varied to yield different heating rates. The output of the thermo- couple is recorded by a digital voltmeter in mV and the data is transmitted to the microcomputer using a custom interface. The partial pressure of the desorb- ing gas, detected by the mass spectrometer analyser, is transmitted through an IEEE interface to the microcomputer and saved. During data acquisition, The TDS, as a function of time or temperature, is displayed graphically on the high resolution screen or printed on the printer.

The typical experimental procedure is as follows: the crystal surface is cleaned by argon ion sputtering for 20 min and the sample is heated to 300 K to desorb any residual gas remaining on the surface. Adsorption is carried out by introducing the ad- sorbate gas into the UHV chamber through the leak vaive for a specific time. The sample is held at about 85 K during the adsorption period. Following the desired exposure, desorption is initiated by running the temperature ramp program. During the initializ- ation of the program data such as the date, the data file name, the adsorbent sample name, the maximum temperature, and the maximum allowable current are obtained interactively from the operator. Tbe operator specifies the maximum safe current to be supplied to the heater so that overheating of the

crystal sample cannot occur. The power supply will be turned off automatically if the maximum current is reached. Once the operator enters this information, data acquisition can begin.

Several accompanying programs allow the oper- ator to review and process the previously stored data. The functions of these programs include: plotting and listing of the data, estimation of the heating rate and the associated correlation coefficient (using a linear least squares procedure), and integration of the area under the TDS curve.

INTERFACE HARDWARE

The interface hardware consists of two main sec- tions: an eight bit D/A converter to control the power to the sample heater, and a custom interface to connect the digital voltmeter to the IBM micro- computer. Both of these circuits have been construc- ted on a board, and the board has been plugged into the IBM-PC expansion bus. This board was designed in-house so that pre-existing circuitry such as the digi- tal voltmeter and the heater assembly could be used in a computer-controlled environment. The interface circuit was built around an IBM PROTOTYPE BOARD. The documentation on this board can be obtained in the IBM Technical Reference Manual 6025005. A block diagram of the computer interface and control circuit is given in Fig. 2.

Sat&e heater cuntroi!er The sample heater requires a low voltage, high

115VAC

CMOS Buffer ’

Fig. 2. Block diagram of computer interface and heater controller circuit.

Page 3: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies 319

P R OTO BOAR 0

(“I

ADJUST FOR 20 MA FULL SCALE

1D OAC TO HEATER CONTROL

I‘:: PIN D SOCKET

PROTOBOARD EDGE CONNECTOR PINS 809~+12

807b-12

Fig. 3. Circuit diagram for IBM PC-heater controller interface. DAC is complementary binary coded: OOOw = full scale, FFF, = 0 V. DAC is wired for 8 bit resolution.

current source of power, typically about 2.5 V at 20 A for full power. This is supplied by a transformer, the primary of which is fed from a Honeywell SCR phase controller. This controller was obtained from an experimental apparatus used in the past. Although not modem, it works well and requires standard 4-20 mA industrial control level signals. This control signal is provided by an eight bit digital-to- analog converter (DAC) contained on the interface board. The circuit diagram for the IBM PC-heater controller interface is given in Fig. 3. The normal voltage output provided by the DAC’s output op- amp is converted to a current by resistor Rl.

The controller is reasonably linear from 0 to 70% output, corresponding to the 4-20 mA input control signal A bias control in the controller allows the range to be offset. In our case it is operated with 0 mA equal to 0% output, and 16 mA equal to 70% output. Beyond 16mA, the control is non-linear, with >30 mA being required to produce 95% output, which is the limit of the controller. The value of RI has been chosen to give 30 mA output when the DAC is at full scale. This puts the linear range of the controller in the lower half of the DAC’s output range, while still allowing close to 100% power when needed. The particular DAC used requires a negative logic drive: a value of 0 sent to it gives full scale output, a value of 255 sent to it gives a zero output.

Digital uoltmeter interface

A 4 digit voltmeter, used to read the thermo- couples in the apparatus, was constructed. It consists of: (1) a switchable input amplifier with fuI1 scale inputs of 20 and 200 mV and (2) an Intersil ICL7135 analog-to-digital converter (ADC)/Display (con- structed using the fntersil Evaluation boards designed for these integrated circuits). The circuit diagram for the amplifier, power supply and switch assembly is given in Fig. 4. The interface circuit diagram for EL7135 ADC can be obtained from Intersil Inc., Cupertino, Calif.

This circuit was built and used prior to the micro- computer being introduced to the experimental sys- tem, and was well-suited to manual reading. As the meter was self-powered, its thermocouple inputs were completely floating with respect to ground, an important consideration as the thermocouples themselves were connected directly to the sample support assembly, which could assume a non-ground potential during certain phases of the experiment.

When the computer was added later, the Intersil ADC was easily interfaced to the computer, as it has a pulse output corresponding to the input voltage. The pulses are counted during the ADC BUSY interval, and a constant of 10001 is subtracted from that count, to factor out the reference integrate phase. Only four wires are used in the interface, one to command the ADC to start the conversion, one pulse signal, one gate signal (BUSY), and one polarity signal. The polarity signal is needed as the thermocouples are operated at temperatures both above and below O”C, and therefore produce both polarity outputs. The A/D converter requires a maxi- mum of 0.4 s per conversion, dependent upon the RC clock used, as well as the input voltage applied,

The IBM interface, as shown in Fig. 5, consists of a buffer on each of the four lines outlined above (the Intersil ADC is CMOS), as well as an Intel 8253 Programmable Counter/Timer IC. The BUSY signal from the A/D converter is used as the counter Gate input, and the count pulses go into the counter clock input. The program loads the 8253 counter with a constant, commands the ADC to start conversion, and waits until the conversion is complete. The 8253 is a down counter, so the A/D pulses decrement the constant that was placed in the counter before the start of conversion. The count remaining at the end of the conversion is used to derive the A/D input voltage. The polarity signal from the A/D converter is also read by the program to determine polarity.

It should be noted that connecting the digital voltmeter to the microcomputer resulted in ground-

Page 4: Microcomputer-assisted temperature programmed desorption studies

320 H. S. TAN er al.

HAMMOND IN4005

5 VOLTS TO ICL7135EV BOARD

s-l

+ TO 1CL7135EV _ _ ANALOG INPUT

Fig. 4. Circuit diagram for amplifier, power supply and switch assembly.

ing the meter by way of its connection to the grounded IBM PC. This requires that the micro- computer interface to the meter be disconnected when non-grounded thermocouple readings are taken. This could be overcome by using opto- isolators on the four interface lines, but this has not yet been done, nor does it seem necessary for the TPD experiments.

Communication with the DATAQUAD mass spectrometer is achieved over an IEEE Interface Bus. The IEEE-488 Interface is supplied by Spectramass Inc. and the Processor card is plugged into the IBM-PC expansion bus.

SOFTWARE PROGRAMS

The main program TPDMAIN is written in BASIC and its flow chart is shown in Fig. 6. It starts by displaying an equipment warning message. This is to prompt the operator to check if the following manually operated procedures have been carried out: (i) the mass spectrometer has been turned on and in the proper operating mode, (ii) the power supply has &en turned on, (iii) the data diskette is in the drive 3, and (iv) the voltmeter has been connected and is reading the correct thermocouple. It then dimensions and initializes the necessary variables such as time, temperature, partial pressure, etc. The commu- nication interfaces of the mass spectrometer and digital voltmeter are also initialized. Experimental parameters such as the date, data file name, ad- sorbent name, maximum temperature, and maximum allowable current are obtained interactively from the operator. The program also reads the previously specified heating coefficients LZ and b, from a data file, previously created by running a supporting program. The TDS graph is set up and the experimental run is started by applying a current corresponding to the initial value of HEAT. The run is terminated when the user-specified maximum temperature is reached

or if interrupted by entering an asterisk or the tenth function key. The experimental parameters and the partial pressure-temperature-time data are saved in a diskette in drive B of the IBM-PC.

The time interval between data points is about 0.4 s as this is the time required for the A/D conversion in the digital voltmeter. The compiled version of the program is used and code execution is a small fraction of the total looptime. The slowest operations are the A/D conversion. The A/D conversion of the mass spectrometer interface is faster than that of the voltmeter. The data files created by the main program are in ASCII format. The data can thus easily be uploaded to a mainframe computer or read by other microcomputer software such as SYSTAT for further processing and analysis. Errors which occur during data acquisition can be trapped and the error number will be printed. The error numbers correspond to the BASIC error messages in the Micro-soft IBM-PC BASIC manual.

The TDS data can be retrieved, reviewed and processed by two accompanying programs in the software package: PRINTOUT and GRAPH. The PRINTOUT program is used to retrieve the experi- mental parameters and list the raw data of all the recorded variables. The GRAPH program can be used to perform the following tasks: (i) displaying the TDS as a plot of pressure vs time or temperature, and a plot of temperature against time, (ii) calculating the heating rate and the correlation coefficient between temperature and time by fitting the temperature-time data using linear regression, and (iii) integrating the area under the pressure-time curve, using the trape- zoidal approximation, to produce and ‘save the sur- face coverage data. If different types of thermocouple are used, a temperature correction program, TCORR, allows the user to enter the appropriate coefficients of the temperature-voltage polynomial equation. These values are then saved and used to calculate the temperature in the main program. All

Page 5: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption ,studies

DEVICE (0 ADDREsSES OEVO-30~EX DEV 1 - 3MmX DEV?- 30EHEX DEV3--3!lc”EX

PRDTOBOA

+5

Fig. 5. Circuit diagram for digital voltmeter-IBM PC interface. All designations prefixed with E and IBM prototype board pin connections.

the TPD programs are contained on a single diskette and their names appear on the computer screen in a menu form when the IBM-PC is booted. Each program could be accessed by entering the number or name of the program.

RESULTS

The system has been used to study the desorption of CO from the surfaces of Ni( 110) and CdTe( 110). The results for CO/CdTe(llO) TDS are presented. Interpretation and discussion of the results, in terms of a physical mechanism for desorption, will be published in a separate paper.

The adsorbent sample is a thin single crystal of CdTe and the exposed surface is of (110) orientation. The sample was heated from about 95 to 200 K and a heating rate of about 2.0 K/s was used by setting the heating coefficients a = 150 and b = -0.15. Figure 7 shows a plot of the temperature-time data. A linear regression, using the program GRAPH, gives a slope (heating rate) of 2.07 + 0.02 K/s and a correlation coefficient of 0.99993. The TDS produced from a single run is shown in Fig. 8. The TDS has a single peak with the peak temperature at 156 K. The surface covemges were also obtained by integrating the pressure vs time curve using the GRAPH program.

The level of automation of the present system is limited to data acquisition for one single run, and thus for one TDS at a single value of heating rate and initial surface coverage. To obtain TDS at

various heating rates and of different initial surface wverages, the operator has to intervene after each run to carry out the following procedures: (i) rotate the sample manipulator so the active surface is facing the ion sputtering gun, (ii) introduce argon into the LJHV chamber by manually adjusting the leak valve, and cleaning the active surface by argon ion

EQUIPMENT

VARIABLES

1ST DATA POINT

NO

Fig. 6. Flow chart of main program TPDMAIN.

Page 6: Microcomputer-assisted temperature programmed desorption studies

322 H. S. TAN et al.

190

g 170

f 160

6 150 b

,140 t!E 130

120

110

100 0 20 40

Time (s) Fig. 7. Plot of temperature vs time for desorption of CO

from CdTe(ll0).

sputtering, (iii) close the leak valve and pump the argon gas from the vacuum chamber, and (iv) open the leak valve and introduce the adsorbate gas. The manipulator could be motorized and controlled by the microcomputer. An automatic-controlled leak valve, driven by a stepper motor, is also commercially

10 r

2 I I I I I I I I/ I 100 120 140 160 160 200

Temperature (K)

Fig. 8. Thermal desorption spectrum of CO from CdTe(l IO). Heating rate; 2.0 K/s.

available. With the installation of a manipulator motor and an automatic leak valve, complete automation could be achieved.

Presently, data processing is limited to the calcu- lation of heating rate and integration of TDS, hut does not include a statistical analysis of desorption models and estimation of the associated kinetic parameters. This is because our preliminary analysis of TDS data for the CO/CdTe( 110) system indicates that the desorption could not be satisfactorily described by simple first or second order Polanyi- Wigner models. More complicated models, such as the changing-order model proposed by Arthur (1973), should be used. We are currently working on a theory of the desorption mechanism for CO/CdTe(llO) system, in order to develop an appropriate kinetic model. If a satisfactory model is developed, it is possible that this model, with other kinetic models proposed in the literature, could be incorporated in the TPD software and automatically tested and analysed by statistical procedures.

AckmwMgemenrs-We are deeply indebted to B. Millier for designing the electronic circuits and computer interfaces. Research was supported by the Natural Sciences and En- gineering Council of Canada.

REFERENCES

Arthur J. R. (1973) Surface Sci. 38, 394. King D. A. (1975) .Sur$~e Sci. 47, 387. Me-1 D. (1975) Interactions on metal surfaces. In Topics

in Appkd Physics (Edited by Gomers EL), Vol. 4, p. 101. Springer, New York.

Readhead P. A. (1962) Vocuwn 12, 203. Yates J. T. Jr (1985) Methods of experimental physics. In

Solid Srore Physics: Surfaces (Edited by Park R. L. & Lagally M. G.), Vol. 22, p. 425. Academic Press, Orlando.

APPENDIX

Main Program: TPDMAIN

10 KEY OFF 20 XEY lo,"*" 50 FLAGl%=O 70 ON ERROR GOTG 4420 80 SCREEN 0 90 CIS 100 LOCATE 4,33,0 110 COLOR 8,7 120 PRINT m TPDMAIN n 130 COLOR 7,B 140 LOCATE 8.1 150 PRINT "This is a temperature ramp program designed to measure and record any 1' 160 PRINT 170 PRINT "1 of 8 partial pressure peaks from the DATAQUAD as the run proceeds." 180 PRINT 190 PRINT "The run is terminated when either the user specified maximum temperature” 200 PRINT 210 PRINT "1s reached or an asterisk is entered or the tenth function key is struck." 220 UICATE 20,29 230 INPUT “Continue ( Y/N ) "iX$

Page 7: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies 323

240 IF X$ = "n" OR X$ = "N" THEN END 250 IF X$ < > "y" AND X$ < > "Y" THEN MCATE 20,lO : PRINT SPC(15) : GOT0 220 260 CLS 270 Ml$ = "###.##" 280 M25 = "####.#" 290 M3$ = "###.I" 300 M4$ = W##.###" 310 M5$ = "#c##" 320 N6$ = ~*##_#^-^n 330 COLOR 15 340 LOCATE 3,lO 350 360

PRINT 'When you have confirmed the following proceed." COLOR 7,8

378 LOCATE 5.15 380 PRINT *lL Dataquad is OK (power,pressure, filament on, proper" 390 LOCATE 6.20 400 PRINT &de and mass selected)" 410 LOCATE 8,15 428 PRINT v- Power supply on (auto setting)" 438 LOCATE lo,15 448 PRINT II- Data diskette in drive B'* 450 LOCATE 12.15 460 PRINT *I- Walt meter connected (reading correct thermocouple)" 470 LOCATE 23,20 480 PRINT u<-z press any key to continue >>'I 490 A$ = INXEY$ 500 IF AS = uw THEN 490 510 DIM SARS(10) ;;z D~:,~~~6~l~~~~~6O",Vl'(6OO',"T%'6OO',PPl!'6OO),A#'l2),F"$'lO',D(9)

540 PITDl% = PH301 550 PITDZ% = &H302 560 PITC% = &H303 570 DACL% = BH305 580 DACH% = &H306 590 DAC2% = &H308 600 POL% = stIi3oc 610 SCALE! = 20000 / 2048 620 OUT PITC%,&H30 630 OUT PITC%,&H52 640 OUT PITDl%,lOO 650 OUT PITC%,&H98 660 PARAMS = "INIT/l/&h210/P/" 670 GOSUB 4530 680 OPEN '*b: temp.dat" FOR INPUT AS I1 690 INPUT #l,ORDER% 700 FOR 1% = 0 TO ORDER% 710 INPUT #l,A%(I%) 720 NEXT 1% 730 CLOSE 740 A#(81 = A#(O) + 273.15 741 OPEN "B:heat.dat" FOR INPUT AS #l 742 INPUT#l,O% 743 FOR I%=0 TO O%:INPUT#l,D(I%):NEXT 744 CMSE 750 OPEN "b:IPARAMS" FOR INPUT AS #l 760 INPUT #l,SAMPLE$ 770 INPUT #~,DATF$ 780 INPUT #l,MTEMP! 790 INPUT #l,SICPE! 800 INPUT #l,CONST! 810 INPUT #l,MCURR% 820 INPUT #l,A! 825 INPUT #~,TD 830 INPUT #l,DGS 840 CLOSE 850 X2%= LEN(DATFS) - 2 860 DATF2$ = RIGHTS(DATFS,XZ%) 870 DATS = DATES 880 CHNL% = 1 890 SEMS = "Y" 900 SEM% = 7 910 CLS 920 COLOR 8,7 930 x31 = 5 940 LOCATE 2,25 950 PRINT M SET INITIAL PARAMETERS W 960 COIOR 7,8

Page 8: Microcomputer-assisted temperature programmed desorption studies

324 H. S. TAN et al.

970 LOCATE 4.5 980 990 1000 1010 1020 1030 1040 1050 1060 1070 1100 1130 1140 1141 1142 1150 1160 1170 1180 1190 1200 1210 1220 1230 1240 1250 1260 1270 1280 1290 1320 1330 1360 1370 1375 1376 1380 1390 1400 1410 1420 1430 1440 1450 1460

<1470

PRINT "-1) Date:*, LOCATE 5,5

PRINT ,, 2) Sample:,, LQCATE 6,5 PRINT n 3) Data File:,, MCATE 7,5 PRINT I' 4) Max. Temp.:" LOCATE 8.5 PRINT ##'5) slope (K/SeC.):" LOCATE 9.5

PRINT 'I 6) Max. c;rrent (100-O):” LOCATE 10,s PRINT ,, 7) Time Delay (O-10):" LOCATE 11,5

PRINT ,, 8) Channel Number (l-8):" LGCATE 12,5 PRINT " 9) SEM on : I, LOCATE 13,5 PRINT "10) Display or Graph Data (D/G):,, X2%= 1

LOCATE X2%+ 3,20 PRINT DAT$ LQCATE X2%+ 4,20 PRINT SAMPLES LCCATE X2%+ 5.20 PRINT DATFZ$ LOCATE X2%+ 6,21 PRINT USING M2$:MTKNPI LOCATE X2%+ 7,25 PRINT USING Ml$;SLOPEI

LOCATE X2%+ 8,31 PRINT USING MZ$;MCURR%

LOCATE X2%+ 9,32 PRINT USING Ml$;TD

LOCATE X2%+ lo,32 PRINT USING MSS:CHNL% LOCATE X2%+ 11,40 PRINT SBM$ LOCATE X2%+ 12,40 PRINT DG$

MCATE 21,20 PRINT "OK (Y) or # to Change,, MCATE ,,O LCCATE 21.43 INPUT X$ IF X$ = "Y" OR X$ = "y" THEN 2230

X2%= VAL(X$) IF X2%< 1 OR X2%> 10 THEN BEEP : GOT0 1420

MCATE ,,l ON X2% GOSUB 1550,1590,1630,1680,1740,1860, LC)CATE 21,43 PRINT SPC(5) GOT0 1420

X4% = 20 GOSUB 2110 INPUT "",DAT$ RETURN

X4% - 20 GOSUB 2110 INPUT "",SAMPLE$ RETURN

X4% = 20 GOSUB 2110 INPUT "",DATFZS IF LEN(DATF2$) > 8 THEN BEEP : GOT0 1630

RBTURN X4% = 22 GOSUB 2110 INPUT “‘I ,MTEMP$ MTEMPI = VAL(MTBMP$) IFMTBMPl = 0 THEN BEEP : GOT0 1680

1480 1490 1500 1510 1520 1530 1540 1550 1560 1570 1580 1590 1600 1610 1620 1630 1640 1650 1660 1670 1680 1690 1700 1710 1720 1730

.2221,1980,2170,2040

RETURN 1740 X4%=27:GOSUB 2llO:INPUT "",SLCPE$:SLGPE=VAL(SLOPE$):IF SLOPE-0 THEN BEEP:GOTO 1740 ELSE RETURN 1800 BEEP:LOCATE 21,43:PRINT SPC(S):RETURN 1860 X4%=33:GOSUB 2110:INPUT "",MCURR$:MC!URR%=INT(VAL(S~PE$)):IF (MCURRZ~O) OR (MCURR%>255) THEN BEEP:GOTG 1860 ELSE RETURN 1980 X4% = 34

Page 9: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption Studies

GOSUB 2110 nwuT ““I ES CHNL% = INT(VAL(B$)) IF CHNL% < 1 OR CHNL% > 8 THEN BEEF : GOT0 1980

RETURN X4% - 40 GOSUB 2110 INPUT n",DG$ IF DGS = "d" THEN DG$ = "D" : RETURN

IF DGS = "g" THEN DG$ = "0" : RETURN IF DG$ < > "G" AND DG$ < > I'D" THEN BEEP : GOT0 2040 RETURN

325

1990 2000 2010 2020 2030 2040 2050 2060 2070 2080 2090 2100 2110 LOCATE 21,43 2120 PRINT SPC(5) 2130 LOCATE X2%+ 3,X4% 2140 PRINT SPC(25) 2150 LOCATE X2%+ 3,X4% 2160 RETURN 2170 X4% = 40 2180 GOSUB 2110 2190 INPUT ""l SEMS 2200 IF SEM$ = "n" OR SEMS = "N" THEN SEMP = 5 : RETURN 2210 IF SEM$ = "y" OR SEMS = "Y" THEN SEM% = 7 : RETURN 2220 GOT0 2170 2221 X4% = 34 2222 GOSUB 2110 2223 INPUT "",TDS 2225 TD=VAL(TD$):RETUFW 2230 OPEN qfib:iparama+' FOR OUTPUT AS #l 2240 IF LRFTS(DATFP$,Z) = "b:" OR LEFT$(DATF2$,2) = "B:" THEN DATF$ = DATF2$ ELSE DATF.$ = "b:" + DATFPS ;;iz PRINT #l,SAMPLE$

PRINT #~,DATF$ 2270 PRINT #l,MTEMP! 2280 PRINT #l,SLUPE! 2290 PRINT #l,CONST! 2300 PRINT #l,MCURR% 2310 PRINT #l,A! 2315 PRINT #~,TD 2320 PRINT #l,DG$ 2330 CLOSE 2340 N% = 0 2350 X!(O) = - 100 2360 GOSUB 3260 2370 DATA-STRINGS = "84" + CHRS(b) + CHR$(32) + CHR$(8) + "CL" 2380 PARAMS = 'NR.STR/19//EOI/" 2390 GOSUB 4530 2400 PARAM$ - "RD.STR/19//EOI/" 2410 GCSUB 4530 2420 2430

MA",";,; ASC(MID$(DATA.STRING$,CHNL%,l)) = "D" THEN FLAGl% = - 1 ELSE GOSUB 3580

2440 CLS 2450 LOCATE 10,lO 2460 PRINT "Press any key to begin the run.” 2470 A$ = INXEY$ 2400 IF A$ = II" THEN 2470 2490 CLS 2500 IF FLAGl% THEN GOSUB 2950 ELSE GCSUB 4070 2501 LOCATE ,,0 ;;z; OUT DACZ%,INT(D(O))

START! = TIMER 2550 WHILE A$ < > 11*11 AND TI(N%) < MTEMP1 2560 N% = N% + 1 2570 XT! = TIMER 2580 XI(N%) = XT! - STARTI 2590 GOSUB 3490 2600 GOSUB 3260 2610 ITL = SLOPE! * X!(N%) + TI(1) 2630 HT%(N%) = INT(D(O)+D(l)*X(N%)+D(2)*X(N%)*2+D(3)*X(N%)*3) 2640 IF HT%(N%) t 255 THEN HT%(N%) = 255 2650 IF HT%(N%) < MCURR% THEN HT%(N%) = MCURR% 2660 OUT DACZ%,HT%(N%) 2670 IF FLAGl% THEN GOSUB 3090 ELSE GOSUB 4350 2680 A$ = INKEY$ 2690 IF 8% = 600 THEN LOCATE 25,65 : PRINT " OUT OF MEMORY '*; : AS = Il*” 2700 WEND 2710 LOCATE 1,65 2720 PRINT "saving data" 2730 HEAT% = 255

Page 10: Microcomputer-assisted temperature programmed desorption studies

326 H. S. TAN er al.

2740 OUT DAC2%,HEAT% 2750 OPEN DATF$ FOR OUTPUT AS #l 2760 PRINT #l,-l,MASS% 2770 PRINT #l,DAT$ 2780 PRINT #l,SAMPLE$ 2790 PRINT #l,DATF$ 2800 PRINT #~,SL~~PE~:TD:O% 2801 FOR I%=0 TO O%:PRINT#l,D(I%):NEXT 2810 FOR J% - 1 TO N% 2820 2830 2840 2850 2860 2870 2880 2890 2900 2910 2920 2930 2940 2950 2960 2970 2980 2990

3010 3020 3030 3040 3050 3060 3070 3080 3090 3100 3110 3120 3130 3140 3150 3160 3170 3180 3190 3200 3210 3220 3230

PRINT #I, USING "###.tX,";Xl(J%); PRINT #1, USING "f###.##,";T!(J%): PRINT 111, USING "#Y.t##,";VlI(J%); PRINT #l, USING '###,";HT%(J%); PRINT #l, USING "##.#***n":PPl!(J%) NEXT J% CLOSE LOCATE 1.64 PRINT SPC(15);

A$ = INXEY$ IF A$ = ltw THEN 2910

SCREEN0 END

CLS MCATE 1,4 PRINT olTimell; MCATE 1,16 PRINT lfTempq*: LOCATE 1.26 PRINT "Ideal TernpI'; MCATE 1,39 PRINT "Slopen*; LOCATE 1,49 PRINT HP.Press (l@;MASS%;*n)n; LOCATE 2.1 PRINT STRING$(70,205):

RETURW Wl% = N% MOD 21 + 3 W2% = Wl% + 1 IF Wlk = 23 THEN W2% = 4

LOCATE W2%,1 PRINT SPC(78) NSLOPEI = (TI(N%) - T!(N% - 1)) ,' (X!(N%) - X!(N% - 1)) LOCATE W1%,3 PRINT USING Ml$:Xl(N%): LOCATE W1%,15 PRINT USING MZ$;T!(N%); MCATE W1%,27 PRINT USING MI$;IT!; LOCATE W1%,39 PRINT USING M3$;NSLDPE!;

MCATE W1%,51 3240 PRINT USING M6$;PPl!(N%); 3250 RETURN 3260 OUT PITD00.255 3270 OUT PITDO%, 3280 OUT PITD2%,1 3290 X01 = TIMER 3300 XX! = 0 3310 WHILE (XXI < .4) 3320 Xl! = TIMER 3330 XXI = Xl! - XOI 3340 WEND 3350 - INP(PITDO%) 3352 :2' = INP (PITDO%) 3354 W1 =Wl •t 2561 * W2 3360 VOLTAGEI - (55534) - Wl) 3370 POLARITY% = INP(POL%) AND 1 3380 IF FOLkRITY% = 0 THEN VOLTAGEL = - VOLTAGE! 3390 v31 = 2048 + (VOLTAGE! / SCALE!) 3400 CJUT DACL%,V3! MOD 256 3410 OUT DACH%,V3! \ 256 3420 Vl!(N%) - VOLTAGE! / 1000 3430 TI(N%) - 0 3440 V! = VlI(N%) / 1000 3450 FOR 1% I ORDER% TO 0 STEP - 1 3460 T!(N%) = A#(I%) + V! * TI(N%) 3470 NEXT 1% 3480 RETURN 3490 DATA.STRINGS = "#2" + CHRS(48 + CHNL%) + "CL"

Page 11: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies 327

3500 3510 3520 3530 3540 3550 3560 3570 3580 3590 3600 3610 3620 3630 3640 3650 3660 3670 3680 3690 3700 3710 3720 3730 3740 3750 3720 3760 3770 3780 3790 3760 3800 3810 3820 3830 3840 3850

PAR-w - "NR.STR/19//EOI/" GOSUB 4530 PARAMS = ~RD.STR/19//EoI/" GOSUB 4530 - MT! - VAL(LEFTS(DATA.STRINGs.2)) / 10

EXX! = VAL(MIDS(DATA.STRING$,3,1)) + SEN% PPl!(N%) - MT1 + 10 A (- EXXI)

RETURN CLS XMINI - INT(T!(O) - TI(0) MOD 5) LOCATE 5,50 COLOR 8,7 PRINT I1 Present Temperature:": PRINT USING M25 + II ":T!(O) COLOR 7,8

LOCATE 10,s INPUT VJIfnimwn temperature (CR for present temp.)":X$ IF X$ C > "'+ THEN XMIN! = VAL(X$) : IF (XMIN! c T!(O) + 9) THEN 3650

LOCATE 13,lO INPUT ltMaximum temperature "iX$ XMAX! = VAL(X$) IF XMAX! < XNIN! THEN BEEP : LOCATE 13 : PRINT SPC(50) : GOT0 3680

LOCATE 16.10 INPUT "Exponent of Maximum P-Pressure "iX$ EX! = VAL(XS) - 1 IF EX! z - 6 OR EXI < - 12 THEN BEEP : LOCATE 16 : PRINT SPC(50) : GOT0

LOCATE 18,lO INPUT vlMantissa of Maximum P. Pressure "iX$ MA! = VAL(X$) * 10

IF MA! > 90 OR NAI < 0 THEN BEEP : LOCATE 18 : PRINT SPC(50) : GOT0

SCREEN 2 LOCATE l,ZO,O XLoW% = 39 XHIGH% = 639 YLoW% - 3 YHIGHO = 171

3860 KX% = 0 3870 XD% = INT(XMAX! - XMINl) 3880 XD% = XD% + 1 3890 FOR 1% = 50 TO 74 3900 IF XD% * 6 / 1% = INT(XD% * 8 / 1%) THEN KX% = 1% 3910 3920 3930 3940 3950 3960 3970 3980 3990 4000 4010 4020 4030 4040 4050 4060 4070 4080 4090 4100 4110 4120 4130 4140 4150 4160 4170 4180 4290 4200 4210 4220 4230 4240 4250 4260

NEXT 1% IF KX% = 0 THEN 3880

XP% = KX% * 8 XSCALBI = XP% / XD% YMINL = 0 YMAX! = INT(MA1) KY% = 0 YD% = YMAX! - YMIN!

YD% = YD% + 1 FOR I% = 16 TO 21 IF 2 * YD% ,' 1% = INT(2 * YD% ,' 1%) THEN KY% = 1%

NEXT 1% IF XY% = 0 THEN 3990

YP% = KY% * 8 YSCALE! = YP% / YD% RETURN

FOR 1% = 0 TO KX% STEP 8 Xl% = XI.DW% + 1% * 8 LINE (Xl%,YHIGH% - YP%) - (Xl%,YHIGH% + 3) LINE (Xl% + l,YHIGH%) - (Xl% + l,YHIGH% + 3) X2! = Xl4IN1 + I% * 8 / XSCALE! LOCATE 23,1% + 4 PRINT USING "###":X2! NEXT I% FOR I% = 0 TO KY% STEP 2 Yl% - YHIGH% - 1% * 8 LINE (XLOW% - 5,Yl%) - (XLOW%,Yl%)

YZ! = YMIN! + 1% * 8 / YSCALE! LOCATE 22 - X%,1 PRINT USING "###";Y21 FOR 12% = XMW% TO (XLOWS + XP%) STEP 4 PSET(I2%,Yl%) NEXT 12% NEXT 1% XHIGH% = XLQWO + XP% YLQW% = YHIGH% - YP%

Page 12: Microcomputer-assisted temperature programmed desorption studies

328 H. S. TAN et al.

.4270 4280 4290 4300 4310 4320 4330 4340 4350 4360 4370 4380 4390 4400 4410 4420 4430 4440 4450 4460 4470 4480 4490 4500 4510 4520 4530 4540

Yl = PPlJ(N%) * 10 h (- EX!) xs1 - (TJ (N%) - XMIN!) * XSCALEJ + XI.OW% YSJ = YHIGH% - (Yl - YMINl) * YSCALEJ IF XS! i XLOW% OR XSJ > XHIGH% THEN 4410

IF YSJ < YL'JW% OR YSI 5 YHIGH% THEN 4410 CIRCLE (XSI,YSI),3 REZWFZN PRINT PRINT "ERROR #"; ERR PRINT IF N% > 0 THEN RESUME 2710 ELSE RESUME 4460

PRINT w Resolve problem and strike any key to continue."

ASF=A?=Ys = nw THEN 4470 SCREEN0 CLEAR SYSTEM END

GOSIJB 9770 ON (ASC(FLDS(0)) - 64) GOT0 4550.4950,4950,4950.4350,4950,4590,4950,46~0,

4950,4950.4620,4640,435~,4950,4660,4950,4710,4790,484~,4880,4950,4900,4950, 4950,495o IF FLDS(0) = "ABORT" GOT0 4980 IF PLD$(O) = “ADC” GOT0 5090 IF FLDS(0) = "ADTL" GOT0 8930 __--- _~_~ ~_~ IF FLD$(O) = "ADTR" GOT0 9020 ELSE 4950 IF FLD$(O) = "GET" GOT0 5130 IF FLDS(0) = "GTSB" GOT0 6100 ELSE 4950 IF FLD$(O) = "INIT" GOT0 5300 ELSE 4950 IF FLDS(0) = "LISTEN" GOT0 9490 IF FLD$(O) = "LLO" GOT0 5260 ELSE 4950 IF FLDS(0) = "-1' GOT0 9340 ____ __~_ ~__~ IF FLD$(O) - "MTA" GOT0 9430 ELSE 4950 IF FLDS(0) = "PAR.WLL" GOT0 8190 IF FLDS(0) - "PAS.CNT" GOT0 10560

4550 4560 4570 4580 4590 4600 4610 4620 4630 4640 4650 4660 4670 4680 4690 4700 4710 4720 4730 4740 4750 4760 4770 4780 4790 4800 4810 4820 4830 4840 4850 4860 4870 4880 4890 4900 4910 4920 4930 4940 4950 4960 4970 4980 4990 5000 5010 5020 5030

LINE (XLOW% - 1,YHIGHZ) X1 = Zl- KY% IF X1 c 1 THEN XI - 1

LOCATE XL,1 PRINT "ex&'[";EXJ;")" LOCATE 1, INT(KX% / 2) - 16 PRINT "Partial Pressure (Torr) RETURN

- (XHIGH% + l,YLOW%), ,B

-vs- Temperature(K)"

IF FLD$(O) = IF FLD$(O) = IF FLDS(O) = IF FLDS(O) = IF FLDS(O) = IF FLDs(O) = IF FLDSCO) = IF FLDS(O) = IF FLDS(O) = IF FLDS(O) = IF FLDS(O) = IF FLDS(O) = IF FLD$(O) = IF FLDS(O) = IF FLDS(O) = IF FLDSCO) = IF FLD$(O) = IF FLDS(O) = IF FLDS(O) = IF FLD$(O) = IF FLDS(O) = IF FLDS(Ol = IF FLDS(O) = IF FLDS('J) = IF FLDS(O) = &F FLDs(O) =

"PPD" GOT0 8290 "PP.EN" GOT0 8880 "PPU" GOT0 8380 ELSE 4950 "RBST" GOT0 8420 "RD.ARRY" GOT0 10950 "RD.BYTE" GOT0 8010 "RD.STR" GOT0 6490 "RD.STR.D" GOT0 6690 "RD.TO.FILK'* MT0 6860 "RD.TO.FILE.D" GOT0 6950 "REC.CNT" GOT0 10380 ELSE 4950 "SDC" GOT0 8500 "SDL" GOT0 5210 "SDR" GOT0 8580 "SBR.POLL" GOT0 8660 "SET.EOI" GOT0 10690 ELSE 4950 "TALK" GOT0 9520 "TCASY" GOT0 9700 "TCSY" GOT0 9630 "TRANSFER" GOT0 9050 ELSE 4950 "UNLISTEN" GOT0 9550 "UNTALK" GOT0 9590 ELSE 4950 "WR.BYTE" GOT0 8140 "WR.STR" GOT0 7070 "WR.STR.D" GOT0 7270 "WR.FROH.FILE" GOT0 7630 ~'WR,FROM.FILE.D~~ GOTO 7840 IF FLDS(0) =

PRINT "Undefined command...execution terminated" PRINT PAEwM$ END

IEEE.FCTNS = "ABORT" IF CNTRLRZ = TRUE% THEN 5060

COMM% = &HF9 #SUB 10730 OUT PORT4%,hH80 OUT PORTB%,O

Page 13: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies 329

5040 CNTRLR% = TRUE% so50 RETURN 5060 IF (INP(WRTS%) AND 2) = 2 THEN 5060 5070 OUT (PORT9%),CHF9 5080 RETURN 5090 IEEE.FCZFN$ = “ADC - UNIVERSAL DEVICE CLEAR" 5100 GOSUB 10360 5110 OUT (PCRTO%),~H~~ 5120 RETURN 5130 IEEE. FCTN$ = "GET - GROUP EXECUTE TRIGGER" 5140 GOSUB 10360 5150 OUT PORTO%,&WF 5160 FUM% =1 5170 GOSUB 9860 5180 GOSUB 10360 5190 OUT WRTO%,B 5200 RETURN 5210 FUMO = 1 5220 GOSUB 9860 5230 GOSUB 10360 5240 OUT (PORTO%),~ 5250 RETURN 5260 IEEE.FCTN$ = "LLd - LOCAL LOCKOUT" 5270 GOSUB 10360 5280 OUT (PORTO%),&)I~~ 5290 RBTURN 5300 IEEE.FCTN$ = "INIT - INITIALIZAT1ON +I 5310 TRUE% = &HFF 5320 FALSE% = 0 5330 DIM REC$(30) 5340 MY-FLAG% = FALSE% 5350 MAX.TIME% = 1 5360 STROFF! = 0 5370 STROFF% = 0 5380 DSPTR! = 0 5390 MY.ADDR% - VAL(FLDS(1)) 5400 BD.ADDX% = VAL(FLD$(2)) 5410 PORTO% = BD.ADDR% 5420 PORTl% = BD.ADDR% + 1 5430 PORTS% = BD.ADDR% + 2 5440 PORT3% = BD.ADDR% + 3 5450 PORTI% = %D.ADDR% + 4 5460 PORT5% = BD.ADDR% + 5 5470 PORTB% = BD.ADDR% + 6 5480 PORT7% - BD.ADDR% + 7 5490 PORTB% = BD.ADDR% + 5 5500 PORTB% = BD.ADDR% + 9 5510 cliARs= LEFTS (FLD$ (3),1) 5520 IF CHARS = "P" THEN TCIMODEZ = 1 : GOT0 5530 IF CHARS < Z "T" THEN 5580 5540 TCIMODE% = 2 5550 MS% = VAL(MID$(FLD$(3),3, LRN(FLD$(3)) - 2)) 5560 IF MS% = 0 THEN MS% = 5 5570 GOT0 5650 5590 IF CHARS < > "I" THEN 6080 5590 TCIMODE% = 3 5600 INTRO = VAL(MID$(FLD$(3),3, LEN(FLDS(3)) - 2)) 5610 IF (INTRb < 2) OR (INTR+ > 7) THEN 6080 5620 INTVECTOR% - (INTR% + 8) * 4 5630 INTENABLE% = 2 * (INTR% - 2) 5640 INTMASKI = 255 - (2 * INTR%) 5650 SUBLIB% = bH72F 5660 TIMEOUT% = &HSOB 5670 INTSETUP% = PH821 5650 pOLLBYTE% = PH451 5690 NRSTR% - &H92D 5700 WRFIL% = &HSBD 5710 CB.FLAG% = PH429 5720 HCSR% = &H427 5730 VCSRI = &l-I428 5740 RDSTR% = &HBll 5750 RDFIL% = &HBFA 5760 DEF SEG = 0 5770 CSEG! = (256 * PEEK((&HFl * 4) + 3)) + 5780 DEF SEC 5790 SAVESTAT% = INP(PoRTO%) 5500 IF (INP(PORT9%) AND 2) = 2 THEN 5800 5810 OUT (PORT9%),&KF? 5920 OUT (PORT5%),2

5650

PEEK((&HFl * 4) + 2)

Page 14: Microcomputer-assisted temperature programmed desorption studies

330 H. S. TAN er al.

5830 5'840 5850 5860 5870 5880 5890 5900 5910 5920 5930 5940 5950 5960 5970 5980 5990 6000 6010 6020 6030 6040 6050 6060 6070 6080 6090 6100 6110 6120 6130 6140 6150 6160 6170 6180 6190 6200 6210 6220 6230 6240 6250 6260 6270 6280 6290 6300 6310 6320 6330 6340 6350 6360 6370 6380 6390 6400 6410 6420 6430 6440 6450 6460 6470 6480 6490 6500 6510 6520 6530 6540 6550 6560 6570 6580 6590 6600

OUT (WRT5%),&H25 OUT (FORTl%),&H93 OUT (PORTP%),O OUT (PORT3%),0 OUT (WRT5%),&W80 OUT (PORTS%),&HAl OUT (PORTB%),MY.ADDR% OUT (F'CRT6%),&HEO

IF (INP(PORT9%) AND 2) = 2 THEN 5910 OUT (PORT8%),0 IF (INP(PORT99) AND 2) = 2 THEN 5930 OUT (PORTB%),&HAO COMM% = &HE6 GOSUB 10730

IF (INP(PORTS%) AND 1) = 0 THEN 5970 SYC% = INP(PORTS%) AND 8 IF SYC% = 8 THEN CNTRlR% = TRUE% ELSE CNTRLR% = FALSE%

DUMMY$ = SPACES(255) IF CNTRLR% = FALSE% THEN 6050

OUT (PORTQ%),&HBO OUT (FORTS%),0 RETURN

OUT (PORT4%),1 OUT (PORTS%),0 RETURN

PRINT "UNEXPECTED CHARACTER IN PARAMS... FUNCTION ABORTED" RETURN

IEEE.FCTN$ = "GTSB - GO TO STAND BY" COMM% = &HF6 GOT0 10730

NEOS% = VAL(FLD$(Z)) IF NEOS% = 0 THEN NEOS% = 13

IF FLD$(3) = "EOI" OR FLD$(3) = llW THEN TERM% = 1 : GOTC 6180 IF FLD$(3) = "EOS" THEN TERM% = 2 : GOT0 6180 GOT0 10920 OUT PORT7%,NEOS% IF TERM% = 1 THEN Nl% = &II82 ELSE Nl% = &H86

OUT PORT5%,Nl% IF MY-FLAG% = TRUE% THEN 6270 IF CNTRLR% = TRUE% THEN 6250 ;;TFzP(PORT4%) AND 4) = 0 THEN 6230

GOSUB 10360 OUT PORTO%,&H3F

FUN% = 1 GOSUB 10180 GOSUB 10360 OUT PORTO%,MY.ADDR% + &Ii20 GOSUB 10360 OUT PCRT4%,&H40 OUT PORTS%,0 COMM% = &HF6 GOT0 10730

IF CNTRLRZ = TRUE% THEN 6420 OUT PORT5%,&HSO LAST.INTl% = INTlSTAT% OUT PORT5P.3 Nl% = INP(PORTO%) RETURN

COMM% = &HFD GOSUB 10730 OUT PORT4%,&H80 OUT PORT5%,3 OUT PORT5%,&H80 OUT PORTS%,0 RETURN

IEEE.FCTN$ = "RD.STR' GOSUB 6130 CTR% - 1

DATA. STRINGS = 1111 INTlSTAT% = INP(PORTl$) IF (INTlSTAT% AND 1) = 0 THEN 6570

DATA.STRING$ = DATA.STRINGS + CHRS(INP(PORTO%)) CTR% = CTR% f 1

IF (INTlSTAT% AND &HlO) = &HlO THEN 6360 IF CTR% < = 255 THEN 6530 PRINT

PRINT "Count overflow...data bytes received after DATA.STRING$ full: (hex)"

Page 15: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies 331

6610 PRINT 6620 INTlSTAT% = INP(PORTl%) 6630 IF (INTlSTAT% AND 1) = 0 THEN 6670 6640 CHAR% = INP(PORTO%) 6650 IF CHAR% < 16 THEN PRINT “0”: 6660 PRINT HEX$(CHAR%) ;I’ ‘*; 6670 IF (INTlSTAT% AND 6HlO) = LHlO THEN 6360 6680 GOT0 6620 6690 IEEE. FCTN$ = “RD. STR. D” 6700 GOSUB 6130 6710 DATA.STRING$ = DUMMY$ 6720 STRLEN% = 0 6730 DSPTR! = VARPTR(DATA.STRING$) 6740 STROFF! = (PEEK(DSPTR! + 3) * 256) + PEEK(DSPTR! + 2) 6750 IF STROFF! > 32767 THEN STROFFO = STRGFF! - 655361 ELSE STROFF% = STROFF! 6760 6770 6780 6790 6800 6810 6820 6830 6840 6850 6860 6870 6880 6890 6900 6910 6920 6930 6940 6950 6960 6970 6980

DEF SEG = CSEG! CALL ABSOLUTE!(STROFF%,STRLEN%,BD.ADDR%,TERM%,NEOS%,RDSTR%,SUBLIB%)

LOCATE PEEK(VCSR%) , PEEK(HCSR%) CB% = PEEK(CB.FLAG%)

DEF SEG IF CB% < > &?IFF THEN 6840

PRINT IEEE. FCTN$ ; ” TERMINATED” END

DATA.STRING$ = LEFT$(DATA.STRING$,STRLEN%) GOT0 6360

IEEE.FCTN$ = “RD.TO.FILR” OPEN FLD$ (4) FOR OUTPUT AS #l

GOSUB 6130 INTlSTAT% = INP (PORTl%)

IF (INTlSTAT% AND 1) = 0 THEN 6920 PRINT 111, CHR$ (INP(PORTO%) ) ; IF (INTlSTAT% AND &HlO) = 0 THEN 6890 CMSE #l

GOT0 6360 GOSUB 6130

DSPTR! = VARPTR(FLDS(4) ) STROFF! = (PEEK(DSPTR! + 3) * 256) + PEEK(DBPTR1 + 2)

IF STROFF! > 32767 THEN STROFF% = STROFFI - 65536! ELsE STROFF% = STROFF ! 6990 7000 7010 7020 7030 7040 705a 7060 7070 7080 7090 7100 7110 7120 7130 7140 7150 7160 7170 7180 7190 7200 7210 7220 7230 7240 7250 7260

DEF SEG = CSEG! CALL ABSOLUTE!(STROFF%,BD.ADDR%,TERM%,NEOS%jRDF~L%,SUBLIB%)

LOCATE PEEK(VCSR%) , PEEK(HCSR%) CB% = PEEK(CB.FLAG%)

DEF SEG IF CB% < > &HFF THEN 6360

PRINT IEEE. FCTN$ ; ” TERMINATED” END

IEEE. FCTN$ = “NR. STR” GOSUB 7440

FOR CTR% = 1 TO LKN(DATA.STRING$) - I CBAR$ = MID$(DATA.STRING$,CTR%,l)

OUT PORTO%, ASC(CHAR$) GOSUB 10360

NEXT CHAR% = ASC(MID$(DATA.STRING$, LEN(DATA.STRINGS)tl))

ON TERN% GOT0 7160,719O OUT PORT5%.6

OUT PORTUi,CHAR% GOT0 7230

IF CHAR% = NEOS% THEN 7220 OUT FORTO%, CHAR%

GOSUB 10360 OUT PORTO%,NEOS% LAST.INTl% = INTISTAT%

IF CNTRLR% = FALSE% THEN RETURN COMM% = &HFD

GOT0 10730 7270 IEEE,FCTN$ = ‘WR.STR.D” 7280 GOSUB 7440 7290 7300

D;TR2;,y VARPTR(DATA.STRING$) . - (PEEK(DSPTR! + 3) l 256) + PEEK(DSPTRI + 2)

7310 IF STROFF! > 32767 THEN STROFF% = STROFF! - 65536! ELSE STROFF% = STROFF ! 7320 STRLEN% = LEN(DATA.STRING$) 7330 DEF SEG = CSEG! 7340 CALL ABSOLUTE!(STROFF%,STR~N%,BD.ADDR%,TE~%,~OS%,~S~%,SUBLIB%) 7350 LOCATE PEEK(VCSR%) , PEEK(HCSR%) 7360 CB% = PEEK(CB.FLAG%)

Page 16: Microcomputer-assisted temperature programmed desorption studies

332 H. S. TAN et al.

7370 7380 7390 7400 7410 7420 7430 7440 7450 7460 7470 7480 7490 7500 7510 7520 7530 7540 7550 7560 7570 7580 7590 7600 7610 7620 7630 7640 7650 7660 7670 7680 7690 7700 7710 7720 7730 7740 7750 7760 7770 7780 7790 7800 7810 7820 7830 7840 7850 7860 7870 7880

DEF SEG IF CB& < > &HFF THEN 7410

PRINT IEEE.FCTN$;" TERMINATED" END

IF CNTRLR% = FALSEI THEN RETURN CONN% = &HFD GOT0 10730

NEOS% = VAL(FLDS (2) ) IF NEOS% = 0 THEN NEOS% = 13

IF FLD$(3) = "EOI" OR FLDS(~) = IF FLD$(3) = "EOS" THEN TERM% = GOT0 10920

It" THEN TERM% = 1 : GOT0 7490 2, : GOT0 7490

IF CNTRLR% = TRUE% THEN 7540 IF (INP(PORT4%) AND 2) = 0 THEN 7500 IF (LAST.INTl% AND 2) = 2 THEN 7530 GOSUB 10360 RETURN GOSUB 10360 OUT WRTO%,MY.ADDR% + &H40 GOSUB 10360 OUT PCRTO%,CH3F

FuM% = 1 GOSUB 9860 GOSUB 10360 corn% = &HF6

GOT0 10730 IEEE.FCTNS = "NR. FROM.FILE" OPEN FLDS(4) FOR INPUT AS #l GOSUB 7440

CHARS = INPUT$(l,#l) IF EOF(l) THEN 7710

OUT PORTO%, ASC(CHAR$) GOSUB 10360 GOT0 7660

ON TERM% #TO 7720,775O GUT PORT5%,6 OUT PORTO%, ASC(CHARS) GOT0 7790

IF CHARS = CHRS(NEOS%) THEN 7780 OUT PORTO%, ASC(CHARs) GOSUB 10360

OUT WRTO%.NEOS% CLOSE #l LAST.INTl% = INTlSTATO IF CNTRLR% = FALSE% THEN RETURN

COHM% = &HFD GOT0 10730

IEEE.FCTN$ = "WR.FR0M.FILE.D" GOSUB 7440

DSPTRI = VARPTR(FLDS(4) ) STROFFI = (PEEK(DSFTR! + 3) * 256) + PEEK(DSPTH! -c 2)

IF STROFF! > 32767 THEN STROFF% = STROFF! - 65536! ELSE STRDFF% = STROFF! 7890 7900 7910 7920 7930 7940 7950 7960 7970 7980 7990 8000 8010 8020 8030 8040 8050 8060 8070 8080 8090 8100 8110 8120 8130 8140

DEF SEC = CSEGI CALL ABSOLaTE!(STROFF%,BD.ADDR%,TERM%,NEOS%,WRFIL%,SUBLIB%) LOCATE PEEK(VCSR%), PEEK(HCSR%) CB% = PEEK(CB.FLAG%) DEF SEG IF CB% -Z > &HFF THEN 7970

PRINT IEEE.FCTN$;" TERMINATED'* END

LAST.INTl% = INTlSTAT% IF CNTRLR% = FALSE% THEN RETURN

COMM% = &HFD GOT0 10730

IEEE.FCTN$ = "RD.BYTE - READ 1 BYTE FROM TALKER" INTlSTATS = INP(PORTl%) IF (INTlSTAT% AND &HlO) = &HlO THEN 8070

IF (INTlSTAT% AND 1) = 0 THEN 8020 DAT% = INP(PORTO%) RETURN

IF (INTlSTAT% AND 1) = 1 THEN 8110 DAT% = 256 LAST% = TRUE%

DAg=NP(PORTO%) LAST% = TRUE% RETURN

IEEE.FCTN$ - "NR.BYTE - DATA BYTE TO LISTENER(S)"

Page 17: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies 333

8150 OUT (PORTOO) ,DAT% 8160 IF LAST% - TRUE% THEN RETURN 8170 GOSUB 10360 8180 RETURN 8190 IEEE.FCTN$ = “FAR-POLL - PARALLEL WtL* 8200 OUT (PORT4%),&H40 8210 OUT (FORTS%),0 8220 IF (INP(PORTP%) AND 2) = 2 THEN 8220 d230 OUT (PDRTS%),&HF5 8240 IF IINP(FGRTl%b AND 11 = O! THEN 8240 8250 8260 8270 8280 8290 8300 8310 8320 8330 8340 8350 8360 5370 8380

POLi.RB~P% - Ii?P(PORTiJ%) OUT (WRT4%) , &HBO

OUT (PGRT5%), 0 RETURN

IEEE. FCTN$ = “PPD - PARALLEL POLL DISABLE” GOSUB 103 60

OUT PORTO%,&H3F FUN% = I.

GOSUB 9860 GOSUB 10360

OUT (PORTO%) ,5 GOSUB 10360

OUT (PORTO%) , btH70 IEEE. FCTN$ = “PPU - PARALLEL POLL UNCONFIGURE”

0390 GOSUB 10360 8400 OUT (PGRTO%) , &HE4 8410 RETURN 8420 8430

IEgCTN$ = “RBST - READ BUS STATUS” = &HE7

8440 GOSUB 10730 8450 OUT <PORT9%),LHE7 8460 IF (INP(PORTS%) AND 1) = 0 THEN 8460 8470 STATUS% = INP(PORT8%) 8480 SRQ% = STATUS% AND 1 8490 RETURH 8500 IEEE. FCTN$ = “SDC - SELECTED DEVICE CLEAR” 8510 GOSUB 10360 8520 OUT PORTO%,&H3F 8530 FUM% = 1 8540 GCSUB 9860 8550 GOSUB 10360 8560 OUT (PORTO%) ,4 8570 RETURN 8580 IEEE.FCTN$ = “SDR - SELECTED DEVICES SET TO REMOTE” 6590 GOSUB 10360 9600 OUT pORTO%, &H3F 8610 COMM% = &HFS 8620 GOSUB 10730 8630 FUN% - 1 8640 GOSUB 9860 8650 8660 IEEE. FC$rlISER. POLL - SERIAL POLL” 8670 GOSUB 10360 8680 OUT PORTO%,&H3F 8690 GOSUB 10360 8700 OUT PORTOP &H18 , 8710 FUM% = 1 8720 GOSUB lo180 8730 GOSUB 10360 8740 OUT (PCRT4%) ,&H40 8750 OUT (~0~95%)~ 0 8760 COMMZ = &HF6 8770 GOSUB 10730 8780 SYS% = INPCPORTl%) 8790 IF (SYS% AND 1) i 0 THEN 8780 8800 POLL.RESP% = INP(WRTD%) 8810 OUT PORT4%,&HSO 8820 OUT PORTS%,0 8530 COMMO = &HFD 8840 GOSUB 10730 8850 GOSUB 10360 8860 OUT (PORTO%) , &HI_9 8870 RETURN 88430 GOSUB 10360 8890 OUT PORTO%,&H3F 8900 FUN% = 1 8910 GOSUB 9860 8920 BIT% = VAL(LEFT$(FLU$I2),1)) 8930 SENSE% = (VAL(RIGHT$ (FLD$(2) ,1) 1) * 8

Page 18: Microcomputer-assisted temperature programmed desorption studies

334 H. S. TAN et al.

8940 8950 8960 8970 8980 8990 9000 9010 9020 9030 9040

GOSUB 10360 OUT (PGRTO%),S GOSUB 10360 OUT FGRTO%, (&H60 + BIT% + SENSE%) RETURN

IEEE.FCTN$ - "ADTL - SET ALL DEVICE5 TO LDCAL't COMM% = hHF7 GOTG 10730

IEEE.FCTN$ = "ADTR - SET ALL DEVICES TO REMOTE" COMM% = &HF8 GOT0 10730

9050 IEEE.FCTN$ = "TRANSFER - TRANSFER DATA FROM TALKER TO LISTENER(S)" 9060 GOSUB 10360 9070 OUT PORTO%,&HSF 9050 FUN%=1 9090 GOSUB 9860 9100 IF MV.FIAG% = TRUE% THEN RETURN 9110 FUM% - 2 9120 GOSUB 10180 9130 NEOS% = VAL(FLD$(3)) 9140 IF NEOS% = 0 THEN NEOS% = 13 9150 IF FLD$(Q) - "EOI" OR FLD$(4) = It" THEN TERN% = 1 : GOT0 9150 9160 IF FLD$(Q) = "EOS" THEN TERM% = 2 : GOT0 9180 9170 GOT0 10920 9180 IF TERN% = 1 THEN Nl% = &HE3 ELSE Nl% = &H87 9190 OUT FORT7%,NEOS% 9200 OUT PORT5%,Nl% 9210 OUT PORT4%,&H40 9220 OUT PORT5%,0 9230 COMM% = LHF6 9240 GOSUB 10730 9250 INTlSTAT% = INP(PORTl%) 9260 IF (INT~STAT% AND 5~10) = 0 THEN 9250 9270 COMM% = &HFD 9250 GOSUB 10730 9290 OUT PORT5%,&HSO 9300 OUT PORT4%,&H50 9310 OUT PORTS%,3 9320 OUT PCRT53.0 9330 RETURN 9340 IEEE.FCTN$ = "MLA - OUTPUT MY LISTEN ADDRESS" 9350 GOSUB 10360 9360 OUT PORTO%,MY.ADDR% + &HZ0 9370 GOSUB 10360 9350 OUT (FCRT52),&H52 9390 OUT (PORT4%),&H40 9400 OUT (PORTS%),0 9410 LAST% = FALSE% 9420 RETURN 9430 IEEE.FCTN$ = “MTA - OUTPUT MY TALK ADDRESS” 9440 GOSUB 10360 9450 OUT PORTO%.MY.ADDR% + &H40 9460 GOSUB 10360 9470 LAST% = FALSE% 9480 RETURN 9490 IEEE.FCTN$ - "LISTEN" 9500 FUM%=l 9510 GOT0 9560 9520 IEEE.FCTN$ = "TALK" 9530 FUMB = 1 9540 GOT0 10180 9550 IEEE.FCTN$ = "UNLISTEN" 9560 GOSUB 10360 9570 OUT (PORTO%) ,&H3F 9550 RETURN 9590 IEEE.FCTN$ = "UNTALK" 9600 GOSUB 10360 9610 OUT (PORTOt) ,&H5F 9620 RETURN 9630 COMM% = &HFD 9640 GOSUB 10730 9650 OUT PORTS%, &H80 9660 OUT PORTS%,3 9670 OUT PORT4%, &HSO 9680 OUT PORT5%,0 9690 RETURN 9700 COMM% = &HFC 9710 GOSUB 10730

: 9720 OUT PORT5%,&H80

Page 19: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies

9730 OUT PORT5%,3 9740 OUT PORT4%.PH80

335

9750 OUT PORT5%,0 9760 RETURN 9770 X% = 0 9780 FOR Nl% = 1 TO LEN(PARAM$) 9790 9800 9810 9820 9830 9840 9850 9860 9870 9880 9890 9900

N2% = INSTR(Nl%, PriRAM$, “i”, FLD$(X%) = HID$(PARAN$,Nl%,N2% - Nl%) X% = xt + 1 Nl% = N2% NEXT FELD) - "DONE"

Y% = 1 Nl% = 1 N2% - INSTR(FLD$(FUH%),",") MY-FLAG% = FALSE% WHILEN2% < > 0

9910 =a=$(~%) = MLD$(PLD$(~%) ,Nl%,N2% - Nl%) 9920 Y% =Y%+l 9930 Nl% = N2% + 1 9940 N2% = INSTR(Nl%,FLD$(FUM%),",") 9950 WEND 9960 FtE;: ‘?t?c)%=_R~“~~~~“D~ Cm%) r (LEN(FLD$(FUN%)) + 1) - Nl%) 9970 9980 N2% = INSTR(l,REC$(CTR%),".") 9990 IF N2% = 0 THEN 10130 10000 GOSUB 10360 10010 OUT (pORTO%), VAL(LBFT$(RECS(CTR%),N2% - 1)) + &H2O 10020 10030 10040 10050 10060 10070 10080 10090 10100 10110 10120 10130 10140 10150 10160 10170 10180 10190 10200 10210 10220 10230 10240 10250 10260 10270 10280 10290 10300 1033.a 10320 10330 10340 3.0350 10360 10370 10380 10390 10400 10410 10420 10430 10440 I.0450 10460 10470 10480 10490 50500 10510

Nl% = N2% + 1 N2% = INSTR(Nl%,RHC$(CTR%),".") WHILB N2% .Z > 0 GOSUB 10360 OUT (PORTO%), VAL(MID$(REC$(CTR%),NL%,N2% - Nl%)) + &H6o Nl% = N2% + 1 N2% I TNSTR(Nl%,REC$(CTR%).".") WEND GOSUB 10360

OUT (WRTO%), VAL(RIGHT$(REC$(CTR%), (LMN(REC$('=TR%)) + 1) - Nl%)) + K-I60 GOT0 10160

IF VAL(REC$(CTR%)) = HY.ADDR% THEN MY-FLAG% = TRUE% : GOT0 10160 GOSUB 10360 OUT (WRTOS), VAL(REC$(CTR%)) + &HZ0

NEXT RETURN

NO% = INSTR(l,FLD$(FUM%),".") IF N2% = 0 THEN 10330

GOSUB 10360 OUT (P0RTO%), VAL(LBFT$(FLD$(FUM%),N2% - 1)) + CH40 NT% = N2% + 1 N2% = INSTR(Nl%,FLD$(FUM%),".") WHILEN2% -Z > 0 GOSUE 10360 OUT (PORTO%), VAL(MID$(FLD$(FUH%),Nl%,N2% - Nl%)) + &HBO Nl% = N2% + 1 N2% = INSTR(Nl%,FLD$(FUM%),".") WEND GOSUB 10360

OUT (FORTO%), VAL(RIGHT$(FLD$(F'UM%), (LEN(FLDS(FUH%)) + 1) - Nl%)) + &H60 RETURN

GOSUB 10360 OUT (PORTO%), VAL(FLD$(FUN%)) + &H40 RETURN

INTlSTATO = INP(WRTl%) IF (INTlSTATO AND 2) = 2 THEN RETURN ELSE 10360

IF CNTRLR% = TRUE% THEN RETURN IF LAST.INTl% AND 128 = 128 THEN lo420 INTlSTAT% = INP(WRTl%) IF (INTlSTAT% AND 128) = 0 THEN 10400

AMTAT% = INP(PORTQ%) IF ;ADSTAT% AND 2) = 0 THEN lo420

COMM% = INP(PORT5%) OUT (PORT5%),LHF CONHO = COMHO AND 127 IF COMtX% = 9 THEN 10510

CLS PRINT "Undefined command received...function aborted." END

OUT PORTt%, &Ii80

Page 20: Microcomputer-assisted temperature programmed desorption studies

336 H. S. TAN et ol.

10520 OUT PORTS%,0 10530 CNTRLR% = TRUE% 10540 CONM% = &HFA 10550 GOT0 16730 10560 IF CNTRLRO - FALSE% THEN RETURN 10570 FUM%=l SO580 COSUB 10180 10590 GCSUB 10360 10600 OUT (PDRTO%),D 10610 GOSUB 10360 10620 OUT (PORT4%),1 10630 OUT PORT5%,LHAl 10640 OUT PORTS%,0 10650 LAST.INTl% = 0 10660 CNTRLR% = FALSE% 10670 CONM% = &HFl 10680 GOT0 10730 10690 IEEE.FCTN$ = "SET.EOI" 10700 OUT (PORT5%),6 10710 LAST% = TRUE% 10720 RETURN 10730 IF (INP(PORTS%) AND 2) = 2 THEN 10730 10740 ON TCIMODE% GOT0 10750,10780,10830 10750 OUT (BD.ADDR% + lO),O 10760 OUT (PORT9%),COMM% 10770 IF (INP(BD.ADDR% + 12) AND 1) = 0 THEN 10770 ELSE RETURN 10780 OUT (PORT9%),COMM% 10790 DEF SEG = CSEG! 10800 CALL ABSOLUTEI(MS%,TIMEOUT%,SUBLIB%) 10810 DEF SEG 10820 RETURN 10830 DEF SEG = CSEG! 10840 POKE PCLLBYTEI.0 10850 DEF SEG = CSEGl 10860 POKE WLLBYTE%,O 10870 CALL ABSOLUTE1 (BD.ADDR%,INTENABLE%, INTVECTOR%,INTMASK%,INTSETUP%

OUT (PORTP%),COMM% IF PEEK(WLLBYTE%) c > &HFF THEN 10890 DEF SEG

SzBad parameter in PARAMS; execution tenninated.11 PRINT PARAM$ END

,SUBLIB%) iO880 10890 10900 10910 10920 10930 10940 10950 END.SEQ$ = II'* 10960 Nl% = 1 10970 10980 10990 11000 11010 11020 11030 - Nl%))l

LAST.CHAR$ = RIGHT$(END.SEQS,l) SEP$ = CHRS(VAL(FLDS(2)))

NZ% = INSTR(FLD$(3),",") WHILRN20 < > 0 END.SEQ$ m END.SEQ$ + CHR$(VAL(MID$(FLD$(~) .Nl%.N2% - N1%)b) Nl% = N2% + 1 N2% = INSTR(Nl%,FLD$(3),",") WEND

END_SEQ$ = RND.SEQ$ + cHRS(VAL(RIGHTS(FLD$(3), (mN(FLDS(3)) + l)

11040 11050 11060 11070 11080 11090 11100 11110 11120 11130 11140 11150 11160 11170 11180 11190 11200 11210 11220 11230 11240 11250 11260 11270 11280

OUT PORTS%;hHBl GOSUB 6210 CTR% = 0 GOT0 11110

CIR% = CTR% + 1 SAR$(CTR%) = ww IF (INP(PORTl%) AND 1) = 0 THEN 11126 CHARS = CHR$(INP(PORTO%)) SARS ( CTR% ) = SARS ( CTR%) + CHARS

IF CHARS = LAST.CHAR$ THEN 11180 OUT PORTS%,3 IF CHARS = SEPS THEN 11100 ELSE 11120 IF ((LAST.CHAR$ = SEP$) OR (INSTR(END.SEQ$,SEP$) = 0)) THEN 11230 TEMP$ = SAR$(CTR% - 1) + SAR$(CTR%) IF RIGHT$(TEl@$, LBN(END.SEQ$)) - END.SEQ$ THEN 11266

OUT PORT5%,3 GOT0 11120

IF RIGHT9 (SAR$ (CCR%) , LEN(END.SEQ$)) = END.SEQS THEN 6420 OUT PORT5%,3 GOT0 11170

CTR% = CTR% - 1 SAR$(CTR%) = TEMPS GOT0 6420

Page 21: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies

Supporthg Program: GRAPH

5 C!LS:KEY OFF:FLRGL%=O 10 REN.program:GRAPEl July 7 '86 40 AA$=-"### ##W.### ###.##I ###.#I# W##.###" 4.5 D$="##.#X##" 50 CS=” ##.###I# ##*###*A”” ##‘I 60 DIM X(6OO),Y(600),HASS%(4) ,DAT(8),DAT$(S),MASK$(8),AREA(600) 70 DIM Z(4) ,A(4,4) ,C1(4),U(600,4),E2(4) 80 DIM W(4,1),B(4,4),12%(4,3),Y2(6OO),D(5)

CLS:OPBN OOb:i~aramsgl FOR INPUT AS 11 SCFtliEN 0 -

188 105 110 120 130 140 150 170 180 200 240 260 280 300 320 340 350 360 361 362 363 365 366 367 369 370 371 375 376 377 380 390 400 410 420 430 440 460 470 490 500 510 520 530 540 550 600 610 620 630 650 660 680 690 700 705 710 715 720 730 735 740 750 755 760 770 785 800 820

337

COLOR 8,7:LOCATE 1,4O:PRINT w GRAPH "::COLOR 7,8 INPUT#l,X$:INPUT#l,DkTF$ CL0SE PRINT * FILES "b:*.*":PRINT :PRINT INPUT "ENTER NAME OF DATA FILE (CR for mOSt recent)": X$ IF X!$="" THEN 240 IF LEFT$(X$,Z)=“b:” OR LEFT$(X!$,2)="B:" THEN DATF$=X.$ ELSE DATF.$="B:"+XS OPEN DATP$ FOR INPUT AS #l INPUT#l,X% FOR I%=1 TO ABS(X%) INPUT#l,NASS%(I%) NEXT 1% INPUT#l,DAT$:INPUT#l,SANPLFk$:INPUT#l,DATF$ IF X%<O THEN GOSUB 12000:GOT0 361 INPUT#l,SMPE,CONST,MCURR%,A,TD DAT$(l)="Time (~)~*:DAT$(2)="Tamperature (K)" DAT$(3)="Voltage (mV)":DAT$(4)="HEAT" FOR I%=1 TO ABS(X%):DATS(I%+4)="P.Press "+STR$(NASS%(I%)):NEXT CLS:INPUT w Temperature -vs- Time (Y/CR)";R$ IF R$="Y" OR R$-"y" THEN 10000 MCATE 1,l:PRINT SPC(40); FOR I%=1 TO 4+ABS(X%):LQCATE 4+2*1%,20:PRINT 1%;") ";DATS(I%):NEXT McATE 22,20:INPUT "choice for x-axis ":Xx$ XX%=VAL(XX$):IF XX%<1 OR XX%>4+ABS(X%) THEN 370 LOCATE 23,20:INPUT "Choice for y-axis lv;YYS YY%=VAL(YY$):IF YY%<l OR YY%>4+ABS(X%) THEN 375 IF YY%=XX% THEN 370 CLS:LOCATE 13,2O:PRINT " READING DATA If N%=O N%=N%+l FOR I%=1 TO ABS(X%)+4 INPUT#l,DAT(I%):NEXT X(N%)-DAT(XX%) :Y(N%)-DAT(YY0) IF EOF(l) THEN 470 GOT0 400 CLOSE :Nl%=N%::end of data ColleCtiCn XMAX=-1E-37:~IN=1E+37:YMAX=-lE+37:?fMIN=1E437 FOR I%=1 TO N% IF X(I%)<XNIN THEN XMIN=X(I%) IF X(I%)>XMAX THEN xMAX=X(I%) IF Y(I%)<YMIN THEN YMIN=Y(I%) IF Y(I%)>YMAX THEN YMAX=Y(I%) NEXT MASKS(l)=" ##W.#'*:N&SK$(2)=" #I#" NASK$(3)==" ##.###":NASK$(4)=' #I#" MASK$(S)=".#P~n""'*:~SK$(6)=".##""""" ~K$(7)=~.##A^AA":MASK$(8)=".##""""" CLS:RAD%=3 XLOW%=63:XHIGH%=639:KX%-70 YLOW%=ll:YHIGA%-171:KY%=20 XD-XNAX-XMIN:YD=YNAX-YMIN CL.9 :REM ****** Main Screen ******* LOCATE 4.25,O:PRINT "1) x min. :l* LOCATE 5,25:PRINT “2) X max. :" LOCATE 6,29:PRINT "delta x =I* LOCATE 8,25:PRINT "3) y min. :I* LOCATE 9,25:PRINT "4),y max. :I* L0CATE 10,29:PRINT "delta y ='I LOCATE 4,38:PRINT XNIN LQCATE 5,JS:PRINT XMAX K)cATE 6,40:PRINT XD LoCilTE 8,38:PRINT YMIN MCATE 9,38:PRINT YMAX MCATE 10,4O:PRINT YD MCATE 12,17:PRINT "5) x plotting distance (50-71): ":Ex% LQCATE 13,17: PRINT "6) y plotting distance (16-21): ";KY%

Page 22: Microcomputer-assisted temperature programmed desorption studies

338 H. S. TAN et al.

825 UCATE 15,ZS:PRINT "7) Circle Radius (l-10): ";RAD% 826 LOCATE 16,25:PRINT "8) Linear Regression" 830 LOCATE 17,2S:PRINT ll9) Continue" 835 LOCATE 18,25:PRINT "10) Integration" 840 LOCATE 19,25:PRINT "11) New Data" 850 LOCATE 20,25:PRINT "12) New Pile" 870 LM!ATE 21,25:PRINT "13) Quit" 900 MCATE 23,ZS:INPUT "<choice>";R$ 905 LOCATE 23,ZS:PRINT SPC(20); 910 R%=VAL(R$):IF Rtcl OR R%>13 THEN BEEP:GOTO 900 920 ON R% GOT0 1~0~,1100,1200,1300,1400,1500,1600,7000,3000,9000,6000,100,9999 1000 1005 1010 1100 1105 1150 1160 1170 1200 1205 1210 1300 1305 1350 1360 1370 1400 1405 1410 1420 1500 1505 1510 1520 1600 1605 1610 3000 3100 3160 3180 3200 3420 3440 3460 3480 3500 3520 3540 3560 3580 3600 3620 3640 3660 3680 3700 3720 3740 3760 3770 3780 3785 3790 3800 3820 3840 3860 3870 3880 3890 3900 3920 3930 3950 3960 3970 3980

LOCATE 4,39:PRINT SPC(15) LOCATE 4,39:INPUT "",XMIN GOT0 1150 LOCATE 5,39:PRINT SPC(15) LOCATE 5,39:INPlJT "",XMAX LOCATE 6,40:PRINT SPC(15) XD=XMAX-XMIN:LOCATE 6,40:PRINT XD GOT0 900 LOCATE 8,39:PRINT SPC(15) LOCATE 8,39:INPUT "",YMIN GOT0 1350 LOCATE 9,39:PRINT SPC(15) LOCATE 9,39:INPUT "",YMAX LOCATE 10,40:PRINT SPC(15) YD=YMAX-YMIN:Ik)CATE 10,40:PRINT YD GOT0 900 LOCATE 12,5O:PRINT SPC(10) LOCATE 12,50:INPUT "",KX% IF KX%<SO OR KX%>71 THEN BEEP:GOTO 1400 GOT0 900 LOCATE 13,50rPRINT SPC(10) LOCATE 13,SO:INPUT "",KY% IF KY%<16 OR KY%>21 THEN BEEP:GOTO 1500 GOT0 900 LOCATE 15,50rPRINT SPC(10) LOCATE 15,50:INPUT *"',RAD% GOT0 900 CLStSCREEN 2 REM get x-scale XP%=KK%*8 XSCALE= XP%/XD REM get y-scale YP~=KY%*~ YSCALE-YP%/YD FOR I%=0 TO KX% STEP 8 Xl%= XLOW% + I%*8 LINE (Xl%,YHIGH%-YP%)-(Xl%,YHIGH%+3) LINE (Xl%+l,YHIGH%)-(Xl%+l,YHIGH%+3) XZ=XMIN + I%*B/XSCALE LOCATE 23,1%+5:PRINT USING MnSK$(XX%):X2 NEXT 1% FOR I%=0 TO KY% STEP 2 Yl%=YHIGH%-I%*8 LINE (XLOWO-5,Yl%)-(XLOW%,Yl%) YZ=YMIN + I%*B/YSCALE LOCATE 22-I%,l:PRINT USING MASKS(YY%);Y2 FOR IZ%=XLOW% TO (XLOW% +XP%) STEP 4 PSET (IZ%,Yl%) NEXT 12% NEXT 1% XIiIGH%=XLOW%+XP%:YLOW%=YHIGH%-YP% LINE (XLUW%-l,YHIGH%)-(XHIGH%+l,YLOW%),,B LINE (XHIGH%,YHIGH%)-(XHIGH%,YLOW%) TITLR$=DAT$(YY%)+" -vs- "+DAT$(XX%) LX%=INT(KX%/Z)-INT(LN(TIT~$)/2]+5:LY%==21-KY%:IF LY%<l THEN LY%=l LOCATE LY%,LX%:PRINT TITLES FOR I%=1 TO N% XS%=INT((X(I%)-XMIN) *XSCALE+XLOW%) IF XS%<XLOW% OR XS%>XHIGH% THEN 3920 YS%-XNT(YHIGH%-(Y(I%)-YMIN)*YSCALE) IF YS%<YLOW% OR YS%>YHIGH% THEN 3920 CIRCLE (XS%,YS%),RAD% NEXT 1% IF NOT FLAGLI THEN 4100 FOR I%=1 TO 8*KX% Y=O FOR J%=NZ% TO 1 STEP -1 Y = Cl(J%) + (I%/XSCALE+XMIN)*Y

Page 23: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies 339

3985 NEXT J% 3992 Y%=YHIGH%-CINT((Y-YMIN)*YSCALE) 3995 IF Y%>YHIGA% OR Y%<YLoW% THEN 4010 4000 PSET (I%+XLOW%,Y%) 4010 NEXT 1% 4100 A$=INXEY$:IF A$="" THEN 4100 4120 CLS:SCREEN 0:GOTO 700 6000 OPEN DATF$ FOR INPUT AS 111 6010 INPUT#l,X% 6020 FOR I%=1 TO ABS(X%) 6030 INPUT#l,MASS%(I%) 6040 NEXT 1% 6050 INPUT#l,DAT$:INPUT#l,SAMPLE$:INPUT#l,DATF$ 6060 IF X%<O THEN GOSUB 12000:GOT0 6100 6070 INF+UT#l,SMPE,CONST,MCURR%,A,TD 6100 GOT0 365 7000 GOSUB 8880 7010 GOSUB 7070 7020 GOSUB 7200 7030 GOSIJB 7750 7040 GOSUB 7900 7050 GOSUB 7280 7055 IF FLRGL% THEN 700 7060 GOT0 7010 7070 REM - set order of equation 7080 CLS 7090 PRINT "EQUATIONS MAY BE OF ORDERS 1,2 OR 3. '+ 7100 PRINT *' 1. STRAIGHT LINE (Y=A+BX)" 7110 PRINT n 2. QUADRATZC (Y=A+BX+CX-2) ” 7120 PRINT w 3. CUBIC (Y=A+BX+CX"2+DX"3)" 7130 REM -Transformations 7140 PRINT :INPUT O'Polynomial Order (0 to end)*';ORDER% 7150 IF (ORDER%>31 THEN 7140 7160 IF (ORDER%<l) THEN FLRGL%=O:GOTO 700 7170 N2%=ORDER%+l:L3%=(Nl%-1)*2+1 7180 IF (N4%=1) THEN 700 7190 RETURN 7200 REM -Set up the data matrix 7210 FOR I%=N3% TO N4% 7220 U(I%,l)=l 7230 FOR J%=2 TO N2% 7240 U(I%,J%)=U(I%,J%-1)*X(1%) 7250 NEXT J% 7260 NEXT 1% 7270 RETURN 7280 REM -CALCULATE RESIDUALS & PRINT RESULTS 7290 S7=0:S8=0:T6=0:SCREEN 0 7300 FOR I=1 TO I:D(I)=O:NEXT I 7310 FOR I%=N3% TO N4% 7320 Y2=0 7330 FOR J%=l TO N2% 7340 Y2=Y2+Cl(J%)*u(I%,J%) 7350 NEXT J% 7360 R3=Y2-Y(I%) 7370 YZ(f%)=Y2 7380 T6=T6+R3*R3 7390 S7=S7+Y(I%) 7400 si3=sB+Y(I%)*Y(I%) 7410 NEXT 1% 7420 C3=SQR(l-T6/(S8-S7*S7/Nl%)) 7430 IF(Nl%=NZ%)THEN ES=SQR(T6) 7440 IF(Nl%I>N2%)THEN E5=SQR(Tfi/(Nl%-N2%)) 7450 FOR J%=l TO N2% 7460 EZ(J%)=ES*SQR(ABS(B(J%,J%))) 7470 NEXT J% 7480 CLS:GOSUB 772O:L%=O 7490 FOR I%=N3% TO N4% 7500 R3=Y2(1%)-Y(I%): L&-L%+1 7510 PRINT USING AA$;I%,x(I%),Y(~%),Y~~~%),R~ 7520 IF L% MOD 22 =21 THEN GOSUB 7730: CLS:GOSUB 7720 7530 NEXT 7540 GOSUB 773O:CLS 7550 PRINT "COEFFICIENTS ERRORS POWER OF X 7560 PRINT USING C$;Cl(l),EZ(l),O; 7570 PRINT w CONSTANT TERM" 7580 FOR I%=2 TO N2% 7590 PRINT USING C$:Cl(I%),E2(I%),I%-1 7600 NEXT 1% 7610 PRINT

Page 24: Microcomputer-assisted temperature programmed desorption studies

340 H. S. TAN et al.

7620 PRINT Vorrelation coefficient ism:c3 7630 FOR I=1 TO NZ%:D(I)=Cl(I):NEXT I 7640 PRINT:PRINT "EQUATION IS: Y=":D(l);" + ";D(4);"*X"3"

";D(Z);'*X + ";D(3);"*X"2 +

7670 LOCATE 16,24:INWT *wisplay Eqn. on Graph (Y/N)";R$ 7680 IF R$=-"lV OR R$=lblV THEN FLAGL%=O:GOTO 7710 7690 IF R$<>"Y" AND R$<>"y" THEN 7670 7700 PLAGL%=-1 7710 RETUm 7720 PRINT " X Y YCALC RESID":RETURN 7730 A$=INKEY$:IF A$="" THEN 7730 7740 RETURN 7750 REM =U and Y converted to A and 2 7760 FOR X%=1 TO N2% 7770 FOR L%=l TO K% 7780 A(K%,L%)-0 7790 FOR I%=N3% TO N4% 7800 A(K%,L%)=A(K%,L%)+U(I%,L%)*U(I%,K%) 7810 IP(K%<>L%) THEN A(L%,K%)=A(K%,L%) 7820 NEXT 1% 7830 NEXT L% 7840 Z(K%)=O 7850 FOR I%=N3% TO N4% 7860 Z(K%)=Z(K%)+Y(I%)*U(I%,K%) 7870 NEXT 1% 7880 NEXT K% 7890 RETURN 7900 REM - Gauss jordan matrix inversion 7910 El%=0 7920 X5%=1 7930 N5%=1 7940 FOR I%=1 TO N2% 7950 FOR J%=l TO N2% 7960 B(I%,J%)=A(I%,J%) 7970 NEXT J% 7980 W(I%,l)=Z(I%) 7990 12%(1%,3)=0 8000 NEXT 1% 8010 D3=1 8020 FOE I%=1 TO N2% 8030 Bl=0 8040 FOR J&=1 TO N2% 8050 IF (12%(5%,3)=1) THEN 8140 8060 FOR K%=l TO N2% 8070 IF(IZ%(K%,3)>1) THEN 8850 8080 IF(IZ%(K%,3)==1)THEN 8130 a090 IP(Ell>=ABS(B(J%,K%))) THEN 8130 8100 I3%=J% 8110 14%-X% 8120 Bl=ABS(B(J%,K%)) 8130 NEXT K% 8140 NEXT J% 8150 12%(14%,3)=12%(14%,3)+1 8160 12%(1%,1)=13% a170 12%(1%,2)=14% ala0 IF(I3%=14%) THEN 8310 8190 D3=-D3 8200 FOR L% =l TO N2% 8210 Hl=B(I3%,L%) 8220 B(I3%,L%)=B(IQ%,L%) 8230 B(II%,L%)=Hl 8240 NEXT L% 8250 IF(NS%<l) THEN 8310 8260 FOR L%=1 TO N58 8270 Hl=W(I3%,L%) 8280 W(I3%,L%)=W(I4%,L%) 8290 W(I4%,L%)=Hl 8300 NEXT L% 8310 Pl=B(I4%,14%) a320 D3=D3*Pl 8330 B(I4%,14%)=1 8340 FOR L%=l TO N2% 8350 B;(I4%,L%)=B(I4%,L%)/Pl 8360 NEXT L% 8370 IF (N3%<1) THEN 8420 8380 FQR L%=l TO N5% 8390 W(I4%,L%)=W(I4%,L%)/Pl 8400 NEXT L% 8410 REM

Page 25: Microcomputer-assisted temperature programmed desorption studies

Temperature programmed desorption studies 341

8420 8430 8440 8450 8460 8470 8480 8490 8500 8510 8520 8530 8540 8550 8560 a570 8580 8590 8600 8610 8620 8630 8640 0650 8660 8670 8680 8690 8700 8710 8720 8730 8740 8750 8760 8770 8780 8790 8800 8810 8820 8830 8840 8850 8860 8870 8880 8890 8900 8910 8920 8930 8940 8950 8960 9000 9010 9020 9030 9040 9050 9060 9070 9075 9080 9100 9110 9120 9130 9150 9160 9200 9999

FOR Ll%=l TO HZ% IF(Ll%=I4%) THEN 8530 T=B(Ll%,I4%) B(L1%,14%)=0 FOR L%=l TO N2% B(Ll%,L%) = B(Ll%,L%)-B(I4%,L%)*T NEXT L% IF(N3%<1) THEN 8530 FOR L%=l TO N5% W(Ll%,L%)-W(Ll%,L%)-W(I4%,L%)*T NEXT L% NEXT Ll% NEXT I% FOR I%-1 TO N2% L%=NZ%-I%+1 IF(IZ%(L%,l)-IZ%(L%,Z)) THEN 8650 13%=12%(L%,l) 14%=12%(L%,Z) FOR K%= 1 TO N2% Hl=B(K%,I3%) B(K%,I3%)=B(K%,I4%) B(K%,I4%)=Hl NEXT KF NEXT 1% FOR K%=l TO NZ% IF (IZ%(K%,3)<>1) THEN 8850 NEXT K% El%=0 FOR I%=1 TO N2% c!l(I%)=W~I%,l) NEXT I% IF(I5%-1) THEN 8870 PRINT PRINT *' Matrix inverse" FOR I%= 1 TO N2% FOR J%=l TO N2% PRINT USING A$;B(I%,J%); NEXT J% PRINT NEXT 1% PRINT PRINT "Determinant = ";D3 RETURN El%=1 PRINT "ERROR -matrix singular@* RETURN N3%=1: REM ******* find data set ** WHILE X(N3%)eXMIN N3%=N3%+1 WEND N4%=N% WHILE X(NQ%)>XMAX N4%=N4%-1 WEND RETURN REM**** Integration *** CLB:M$=" ### ###.## .##***^ . GOSUB 888O:SA=O FOR I%=N3% TO N4%-1 AREA(I%+1)=(Y(I%)-YMIN+.5*(Y(I%+l)-Y(I%)))*(X(I%+1)-X(I%)) SA=SA+ARBA(I%+l) NEXT:AREA(N3%)==0 CLS:LOCATE 10,lO:INPUT "Name of data file (add 'b:' to the beginning)@*:A$ OPEN A$ FOR OUTPUT AS #l PRINT#l,N4%-N3%,YMIN:CLS:MCATE 2 FOR f%=N3% TO N4%'SA=SA-ARKA PRINT#l,USING M$;I%:X(I%);Y(I%);SA PRINT USING M$;I%;X(I%);Y(I%);SA NEXT:CLOSE LOCATE 25,20:PRINT " Press any key to continue *; A$=INKEY$:IF A$='*" THBN 9160 GOT0 700 END

10000 RBM **** TEMP TIME ****** lOOlO SCREEN 2 10020 CLS:LOCATE 13,20:PRINT w READING DATA w 10050 N%=O 10070 N%=N%+l 10080 INPUT#l,X(N%),Y(N%),Zl,Z2

Page 26: Microcomputer-assisted temperature programmed desorption studies

342 H. S. TAN et ai.

10090 10100 10110 10120 10130 10140 10150 10160 10170 10180 10190 10200 10210 10220 10230 10240 10250 10260 10270 10280 10290 10300 10310 10320 10330 10340 10350 10360 10370 10380 10390 10400 10410 10420 10430 10440 10450 10460 10470 10480 10490 10500 10510 10520 10530 10540 10550 10560 10570 10580 10590 10600 10610 10620 10630 10640 10650 10660 10670 10680 10690 10700 10705 10710 10711

FOR I%=1 TO ABS(X%):INPUT#l,Z:NEXT 1% IF EOF(1) THEN 10120 GOT0 10070 CLOSE 'end of data collection CLS Xu)W%=39 : XHIGH%=639 YLOW%=ll:YHIGH%=171 REM get x-scale XMAX-INT(X(N%)):XMIN-0 KX%=O:XD%=INT(XMAX-XMIN) XD%=XD%+l FOR I%=50 TO 74 IF XD%*8/I%=INT(XD%*8/1%) THEN KX%=I% NEXT 1% IF KX%=O THEN 10190 XP%=KX%*B XSCALR= XP%/XD% REM get y-scale YMIN=INT(Y(l)- Y(1) MOD 5) YMAX-0 FOR I%='1 TO N%:IF Y(I%)>YMAX THEN YMAX=Y(I%) NEXT 1% KY%=O:YD%=YMAX-YMIN YD%=YD%+l FOR IO-16 TO 21 IF 2*YD%/I%=INT(2*YD%/I%) THEN KY%=I% NEXT 1% IF KY%=0 THEN 10320 YP%=KY%*8 YSCALE=YP%/YD% FOR I%=0 TO KX% STEP 8 Xl%= XLoW% + I%*8 LINE (X~%,YHIGH%-YP%)-(X~%,YHIGH%+~) LINE (Xl%+l,YHIGH%)-(Xl%+l,YHIGH%+3) X2=XMIN + I%*B/XSCALE LOCATE 23,1%+4:PRINT USING "###":X2 NEXT 1% FOR I%=0 TO KY% STEP 2 Yl%=YHIGH%-I%*8 LINE (XMW%-5,Yl%)-_(XLOW%,Yl%) Y2=YMIN + I%*B/YSCALE tiCATE 22-1%,1_PRINT USING "###";YZ FOR IZ%=XLoW% TO fXLOW% +XP%I STEP 4 PSET (IZ%,Yl%) .- NEXT 12% NEXT I% LINE (XLQW%-l,YHIGH%)-(XLOW%+XP%+l,YHIGH%-YP%),,B LX%=INT(KX%/2)-15:LY%=21-KY%:IF LY%Cl THEN LY%=l LOCATE LY%,LX%:PRINT ,, Temperature(K) -vs- Time (s) *, FOR I%=1 TO N% XS=X(I%)*XSCALE+XLOW% YS=YHIGU%-(Y(I%)-YMIN)*YSCALE CIRCLE (XS,YS),S NEXT I% XSl=XLoW% XS2=X(N%)*XSCALE+XLOW% YSl=YHIGH%-(Y(l)-YMIN) *YSCALE YSZ-YHIGH%-(X(N%)*SLOPE+Y(l)-yMIN)*YSCALE ss=(Ysl-Ys2)/(xs2-xsl) IF YS2<(YHI&H%-YPO) THEN YS%=YHIGH%-YP%:XSZ=YP%/SS4XLOW% IF XS2>XHIGH% THEN XS2=XHIGH%:YS2=YHIGH%-XP%*SS LINE (XSl,YSl)-(XS2,YSZ) B%=LEN(DATF$)-2:DT$=RIGHT$(DATF$,B%) LOCATE 25,2:IF X%CO THEN 10713 PRINT "File Name:,,:DT$:*' Slope=,,;SLOPE;,, Rest Curr.=,,iCONSTi',

AttaCK=" ; A ; ” T.Delay=,,;TD;:GOTO 10720 10713 PRINT "FN:";DT$;" SI" ;SLQPE;" TD=";TD;" P.Coefs=~;a(o);,,,";~(l) : ","D(2)"',";D(3); I 10720 10730 10740 10750 10760 10770 12000 12030 12100

A$=INKEY$:IF A$="" THEN 10720 MCATE 25,l:PRINT SPC(78); LOCATE 25,20:INPUT "Graph Another (Y/N) ":Y$ X$="":CLS:SCREEN 0 IF Y$="Y" OR Y$="y" THEN 100 GOT0 9999 INPUT#l,SLOPE,TD,O% FOR I%=0 TO O%:INPUT#l,D(I%):NEXT RETURN