r

Reference^ pu^bl^

NAT L INST. OF STAND & TECH R.I.C. ‘StlOHS

Allies flsne? R 81-2229

Auto: A Real Time Diffractometer

Control System

Robert L. Snyder

Alfred University

Alfred, NY 14802

Camden R. Hubbard

Center for Materials Science

U.S. Department of Commerce

National Bureau of Standards

Washington, DC 20234

and

Nicolous C. Panagiotopoulos

JCPDS-International Centre for Diffraction Data Research Associateship at National Bureau of Standards

Washington, DC 20234

February 1981

J.S. DEPARTMENT OF COMMERCE

^JATIONAL BUREAU OF STANDARDS

hQC

100

.U56

81-2229

1981
|2

U‘ c T3 cu to

•r- QJ CU • £ r—

O) +-> S- -!-> C75 cu r—

X J= 3 lO C cu ITJ £ rt £ 4-> +-> to

4->

O CU CU +-> E •r“ •r— 3 •f— 3 3 z:

S- V) .E S- c+- to o +J r— LlJ z 4-> CD.

O

(U JD (U 2 3 O E E •r~ T5 _J •—1 3 £ E O ZJ C71 to to M- C £ t/D <C o •1- X C\J C lO E •a to cu CD. •r— to CD s: E 3 CM

<a <a cu to -O CU

C

X COX to <t

x: oix: o CO

O CU o 3 X CEO r— >> E r- X5 cu CO +J to - o w\ CU -I- to cu O 4-> to +J a 1— cu O x: +j -(-> U >> •r— Q. £ £ E O T3 -C 1— .c CU to <+- X o CU to £ to • 4-> C t— CU cn E I— E O CD. +-> E X ^ (T3 s- •r— CU 1— E 3 E *> 3 X CO TO JZ to • CU •o o 4-> O to O O E -M 3 CM

0) T? x: SO •r— 4- +->

X 05 05 Z O

O Q) 0> x: cu o • CO CO CO E CM C r— E o s- ^ to -M 1— to 0) I— 3 • •r- *r— *r— 3 to C -M to Z cu £ r— o T3 (DC • +-> 4- >> x: to CU •I— to x: ct £ •I— to 4-> CU £ O o CZ fO 2 to o. -o +-> ZD •r- -l-> O X to • 1— O CU I— CU z O' 4-> 3 E +-> o • ZD o s- s- (/) E cu ear <u o 3 O -O CU Q

<c o cu cu .E 35 > to E O E CU -o 4- -»-> E

cu E > c cu -(-> CZ5-'|-

O E X T3 E O T- o » o > o •I— JD • Z +J —« E X 3 -O o > E £

+-> ta s. 4-> c c (d; to _1 <+- 3 CO <C -O

X o ^ cu +-> 3 O -r- o +J 1—1

to £ CU +J

X U) ’f- O -)-> •r- -a -r- Ll_ M_ E •r— +-> CJ T3 CD5 -M cu E s- T3 +-> C 4-> Z O LlJ O • CO to CU £ c 2 (O t X3 CU CU CJ to c 35 t/5 E ^ CO cu £ •!- 0) cu 3 i~ -a cu to q; t5 O 4- CO • CU 3 4-> •1- X E »>T3 CD. CO to s- r— Z 3 to _J CU O £ CD" £ to CO <u 4-> CU o 1

<C cr cu cu C_5 CD.

U 1— •r- 05 CU

X to o S- -O o CO CO (j o ZD E O £ O +-> E E X 3 c O T3 +-> t cu cu o C5' E to CO T3 CD. CU CD 3 E O

fO CD. ro in •I- E CJ3

O £ £ £ E o to 3

CU CU h- +-> to CO *+- •1

— to

O S- -O E +J

O CU CO c S- O S- s: •I- CO +-> • 2 +-> 3 cu X 3 X T3

LlJ t>0 CO •!— to o c r— cu £ z CJ +J 3 Cl cu E

CO (— +J c T3 +-> o o £ O UJ to

O 3 CO £ X £ to

•t- fO

O T3 cu E C •!- E ^ ^ *r— a. 1—

O CD. •r- +-> to -o

x: o C +-> 3 E •1- +J +-> +-> o — E <C

O £

+J cu s- to _E

O to

C _J CD. to 00 o 1— 05 CU to > 4-> •r- 1— N o •—1 O CJ I— CJ C X 4-> CD5X

C(- to CO

a

X CT> Z •!- o Li- LlJQX to £ t/5 o ^ z +-> to CU Ct Q 1— 1— 1— cu £ •1— cu t—*

x: E E :3 to 1 1—

O LlJ I— • E C_5 4- -rX

X CO <u x: • u_ C3 cy-r- n3 t/5 CO _l to O O O O E to o

SZ 3 -l-> 2 • 1- cu T3 +-> 3 £ LlJ +-> 4-X E •1

—

•r“ o D_ CU .c CU -o -r- +-> CU o Q o CU (U CO >1 CU • 1— 3

+-> -O r— x: +J +-> cu c CJ +j

a cuX £ X Q. to

•1- . (U cu T3 o -O •!- to o T3 > •> TD • to

X 05 CU

J- o •>- JD CU J«c +-> cu •r— E to CU

O

X +j CU 1— E r- DCX E 2 1-*+- TO to to r— > cu CU 2 TD E C to T5 •—«

1— to 3

ZD •>- -a -o cu jc CU •r- x: x: cu >1 T3 cu

X 3 TO Z £ *1- Z -O CO

cu

C «— cu cC CD.+J CO CZ5 4-5 Ctl XI < Dc: O-r-5 <C •—I O 2 (

1 1 x: CD. N O r-

-M E E •rX to to •>- s- • • • • • • • 1 £

cu S- CO fO CL

O

O O) E 3 T- C O -O £ X •r- S- E 3 £ to

C/) CD. to CO <t z
National lureau of Standards

Library* E*01 Admin. Bldg.

APR 1 1981

NBSIR 81-2229

AUTO: A REAL TIME DIFFRACTOMETER

CONTROL SYSTEM

A-

/ \

1 ^:/

Robert L. Snyder

Alfred University

Alfred, NY 14802

Camden R. Hubbard

Center for Materials Science

U.S. Department of Commerce

National Bureau of Standards

Washington, DC 20234

and

Nicolous C. Panagiotopoulos

JCPDS-International Centre for Diffraction Data Research Associateship at National Bureau of Standards

Washington, DC 20234

February 1 981

U.S. DEPARTMENT OF COMMERCE, Malcolm Baldrige, Secretary

NATIONAL BUREAU OF STANDARDS. Ernest Ambler. Director
•Sbia jilnsbA iW

fser I «qA

• ,t'i

ti-. 'V • %

*

t

,i I^T

-'•'*

3i i'/ , . ,-• 4 "--*

', i

yf,*3 Si'i';.*U '-i * W't .

P

.'"'

‘>^•*'1 tC^

a:',^"innt'.^'l. t;->, j ’ “ ;'-Ht,. U

':b .'.^ 4 Ifl-'T’'.' '

,*i (»•• •

‘

'-i- *. '. J ‘loipBm- j .j ktn^h'.i. : i ;''i

^ ^riv, '. >'' ’•{•• f|l;'..K>'

f4»"i-v ?'“

. .' - .r kftiB

fo:> T'- »# “J

•ic, OA3?H*a
TABLE OF CONTENTS

INTRODUCTION 1

HARDWARE 1

INTERRUPTS 1

SYSTEM DESIGN 2

FILE NAMING 3

PROGRAM DESCRIPTION 3

Initialization 3

Console Options 4

Powder Pattern Collection 5

Step Scan 6

Quantitative Analysis 7

Counting Modes 9

Step Scan 10

Peak Scan 11

Slewing 11

Run Termination 11

File Transfer 12

TABLES 13

1 - Integer Address Codes Used on the LIFO Stack 13

2 - Flow Chart of Program AUTO 14

3 - System and NBS Bus Routines 15

4 - Input/Output Units 16

5 - Output Data File Format For Pattern Collection 17

6 - Run File and Output Data File Format For Quantiative Analysis 19

EXAMPLES 22

1 - Initiation and Slewing 22

2 - Powder Pattern Collection (QUAL option) 23

3 - Status 24

4 - Selected Profile Measurement (QUANT option) 25

Appendix 1 - Listings of Program AUTO 27

Appendix 2 - Listings of Program CONFIG 96
t *m' “ tJSi

"<

.... amiTiitu ^ %mr

% • $ t • « . i * •• < •. * k . . .... XQinuaosmii 4

f , . • • « • • * * * . . . •, . , • *. 3SAWQJUK

ivfi'

, If'l •

' J < •- «« ^

•' • ^

*’*'' ” •* • • * ^ • • V '* "• Q

^0183CT

.gr, *1

, T •„ . ”l

* ••#•••• •' • • • • »' • «'TM» » • t) ^ i ». <»,

'• . (}M 1N/^

. 2T‘WJW3mt

.

' .. j:js!

» I

.ll^ • • i <

n « • • • b •

t . »

c .

t . .

t . .

» , .

® . .

a . .

^ .

p . .

or . .

fi . ,

rr . . rr# 144 »'** 4 ^*- m • •

Sf

if , * , ^ .

•fd

• • T r

M0IT9lilD23(l

VI

'i »••»'**#« » r Ar^ f (it ^ \

* ^ '''

. . , , , . ^ , , « . , . k ; 2ii(>r^0 afo*ix)3^

,

' IE.

.ffi

. '• *' * 4 TOf j»(foO

'' 4AI ^ 1

-r #; • ••»••» k ,» • • « , « • • 'rtAjjZ

• . <? • ^ • * -f^*! A

• « » «

- fr . '. “Si-'

/’

‘1

. ;^l.. .B’ -

'*

k'.. « >

* .» • • /iA>? qat

» » •

• » « A • • • A tVi'* * .4 « .V A . gn

• # . A ^J.'f . A A * t A-' A**'" aAaa a aaaAaa. ' a

notSBfitmvt m4

'A •> A A , . ‘tAYAnfinT str'

» • f • A A At 'A. ,; -

•tvtf

• {9 “li / Jta<Al2 03U (w baeO t^rtbbA *t«pAi«lv* ta

df

u

ff

IS

ss

AS

OrUA 'Ta i:tiAO waTI

2Anrjjl«a» ft« 28M AAA fAAl«Y2 tri £

• i » • ji, - . » >«»>, lKqiu01?uqttI - A j A'.

• . . . A«rtAsrfoO arn aiAO iAQJuO - 8

i , . » * . er»xf*rt^ AVtiAllniuO 103 Jatm»3 >il3 ^vqjuo boA »r^J <tu« - a

4i «•<! '•• A t

. . , i* .*23Ll8AT

.'Bi ’ • .

• ,

" » > f • ^ 1*4 • ’ A A

» « I ^

A^a,. A « • • • A A M

'•:

. 'It, V. -,'

^ <•'•. » >-- ^t'wU OfiA noriib'trti *• f ' ' Jr

• ' • V’

• . , • b. -- r - f • < * a • • . . . . . ( fwt tqo iAUt>j floasiffttO iTifliAq 7A»#toi V S ^ »*•*•*.¥ 4 A A 'V '4 ‘ 1^ • « • * • ’ «»'

- y 4

• • . k * . , , uaM - i

, „1

r.-. ^

(norjqo^niAiK)) 4n®n»Tru«*M 4fl’^(«‘l bMyvi^ • • 4

'

< - • • • » • •S • * • • j^' * ^ ‘ t'.'

> «' • • • W A . . . %

. ..

* OruA fwignnd aq ignr^lfJ - f j ^

Sf

' onnOP H ffgnMfifJ - %

/ •'

• ^*^A.
INTRODUCTION

The purpose of this system is to control simultaneously two powder diffractometers

mounted on the same x-ray generator. The controlling computer provides the user with the

ability to perform all conventional diffraction analyses from the scanning of an entire

spectrum to the careful measurement of the intensities of individual lines for quantitative

analysis.

HARDWARE

• The hardware consists of an Interdata 7/16 minicomputer^ with 64K bytes of memory.

Other hardware features include power fail interrupt generation, integer multiply and divide, precision interval clock, and selector channel. The operating system is FLOXOS, an

NBS derivative of the Interdata DOS operating system. The minicomputer peripherals consist

of two floppy disk drives (200K bytes each disk), two hard disk drives (5 M bytes each disk),

a high speed lineprinter/pl otter, CRT console, and the NBS Bus instrument interface. The

NBS Bus interface contains two timer/stepping motor driver cards. Each card is capable of a

variety of functions including operation as a scaler and operation as a pulse generator for

input to the stepping motor power supply. The scaler completes a cycle on either preset

time or preset counts. The pulse generator features include a tracking counter which maintains a representation of the current angle and the ability to send out a preselected number

of pulses to the stepping motor power supply. The minicomputer is connected to the NBS NET

via an RS232 serial interface port. This connection permits file transfer to other computers

attached to the net.

Each goniometer is capable of stepping in increments of 0.005° 2e. The high and low

angle limit switches, if tripped, terminate output in the same direction from the motor

power supply and signal the NBS Bus interface card. The card then terminates operation and

puts a flag in the card status register.

INTERRUPTS

The Interdata 7/16 allows for a variety of interrupts such as power fail, clock and

console escape. Each interrupt, if enabled, stores a two character ASCII string on a stack.

^Identification of the minicomputer in this paper is given in order to adequately specify

the equipment for which this program was written. In no case does such identification

imply recommendation or endorsement by NBS, nor does it imply that the equipment identified

is necessarily the best available for the purpose.

1
The contents of the top of this stack are obtained with the Interdata FORTRAN function

IFLAG(0). Completion of an activity by the NBS Bus could have been handled by an interrupt

and a string on the interrupt stack. Instead, we chose to poll each card in the NBS Bus in

sequence using the FORTRAN function ISTAT. This informs the program which interface card,

and thus which unit, has completed an operation.

Because, in general, one is not following changes in real time in x-ray powder diffraction, an interrupt signaling instrument completion of a task does not need to be handled

immediately. For example, at the completion of a counting cycle neither the scaler nor

goniometer will change state until it is directed by the computer. Thus, in program AUTO,

the testing of the interrupt stack and the NBS Bus polling performed in subroutine INTRUP

may be suspended without consequence other than slowing down data collection. However,

other than when entering run parameters or during a file transfer, the program AUTO returns

to the subroutine INTRUP within a fraction of a second.

SYSTEM DESIGN

Since two diffractometers need to be controlled simultaneously, a conventional, dedicated type of program design could not be employed. Instead, we adopted an event-driven

approach where most of the computer time is spent in a loop waiting for an interrupt from

the console or the diffractometer interface. For this reason, program AUTO is better

thought of as a real-time executive computer-control system. The flow of logic which follows an interrupt, is controlled by a last-in-first-out (LIFO) stack of addresses as is done

in most modern computer system software. However, as our system is written exclusively in

FORTRAN, the LIFO stack contains integers which are used as the arguments of a FORTRAN

computed GO TO statement. These arguments (or address pointers) are listed in Table 1. The

contents of the LIFO stack are modifidd by subroutines PUSH and POP. Subroutine PUSH inserts

an address at the top of the stack and moves all the previously stacked addresses down one.

Subroutine POP removes the top address and moves all others up.

The main program controls the flow of logic by a master computed GO TO statement which

allows access to the subroutines shown in Table 2. The subroutines listed in parentheses in

Table 2 are called as secondary subroutines by the routine listed at the left. Operating

system and NBS Bus servicing functions and subroutines are listed in Table 3. The principal

options of the system allow for powder diffraction pattern collection (referred to as qualitative analysis), intensity data collection for specified peaks (referred to as quantitative

2
analysis), the moving of the detector to any specified 2e angle at maximum speed (referred

to as slewing) and the termination of any active operation.

In order to eliminate gear backlash in slewing, the goniometer is always driven to

0.

05° below the target angle and then moved up to the target angle. Data collection then

proceeds with stepping in the increasing 2e direction.

FILE NAMING

In a multiuser environment, certain naming conventions must be adhered to in order to

minimize confusion. The system uses two types of files: an output data file from either

pattern collection or quantitative analysis; and a run file directing a quantitative analysis or relative intensity measurement run. The first rule is that an output data file must

end in "D" and that a run file must end in "R". The naming and allocation of all data files

is handled by three subroutines. Subroutine FILEUP first reads the date and time from the

system clock by calling subroutine DATE and then requests the file name from the user. It

also requests the user to enter the title of the run and the operator's name. Subroutine

FILNAM is then called to check the legality of the file name. The full rules are:

characters 1 & 2 = The operators initials

characters 3, 4 & 5 = any three letters or numbers

character 6

= "R" or "D"

The name must have six characters and not contain any blanks or special symbols. The last

subroutine involved in file control is ALOT which allocates the data or run file on disk

number Dj3 and writes the first five records, as described in Table 5 or 6, depending on the

type of run.

PROGRAM DESCRIPTION

The following section gives a sketch of the flow and logic of the automation program

AUTO. Each of the major options is discussed. The flow of this sketch is representive of a

plausible sequence; however, for purposes of clarity of presentation, all options and possible branches are not presented. The source language listings (Appendix 1) serve as the

complete program description.

1. INITIALIZATION : Program AUTO first calls subroutine INIT to initialize the run parameters, the interface, and the two diffractometers. This subroutine sets all Input and

Output (I/O) logical units (Table 4) and attaches the required physical devices (NBS Bus,

precision interval clock, date and time clock, console terminal and printer) to the I/O

3
units via the FLOXOS subroutine SYSTEM. It then requests the user to enter the current 2e

position of both diffractometers. Both angles are required in order for software collision

protection logic to be used. Subroutine INIT then calls SETANG, which clears each interface, checks the legality of the input angle (by calling CKANG) and setting the angle into

the interface tracking counter.

Subroutine INIT also attaches the instrument configuration file called DACONF written

by program CONFIG (Appendix 2). This file contains the values of all instrument parameters

for the x-ray generator and goniometer and the coefficients of the external calibration

polynomial for each goniometer. The configuration parameters are not used to control data

collection. They are, however, available for use in data analysis routines. Subroutine

INIT is called only once when the AUTO system is initially executed.

2. CONSOLE OPTIONS : On completing the initialization section, subroutine CONSOL is called.

After the initial entry, CONSOL can also be called by hitting the "escape" key on the console

CRT. When "ESCAPE" is pushed the operating system places an interrupt flag on the flag

table. Subroutine INTRUP detects this flag and sets the first address of the LIFO stack

(which is a variable called ITRANS) to a 1 and returns to MAIN. MAIN uses the 1 as an

argument in the master computed GO TO to branch to the call to CONSOL. On entering CONSOL,

the 1 on the LIFO stack is removed (popped off) by subroutine POP. Subroutine POP is called

by most of the subroutines in the AUTO system and works in conjunction with a MODE flag. In

general if the MODE flag, associated with a subroutine, is set to 0 it means that the subroutine was called by another subroutine (i.e., not by MAIN using the LIFO stack) and,

therefore, the LIFO stack should not be popped. If the MODE flag is set to 1, the subroutine

was called by MAIN via the LIFO stack and, therefore, the subroutine's GO TO address should

be popped off of the stack. Not all subroutines make use of the MODE flag. Subroutine

CONSOL offers the following options to the user (certain option codes are reserved for

future expansion):

0: Print the current status of each unit (activity, file name, estimated completion time,

current 2e) and return to the interrupt detection subroutine INTRUP by pushing its

GO TO address (12) onto the LIFO stack and returning to MAIN.

1: Perform a powder diffraction pattern data collection by calling subroutine QUAl via the

the LIFO stack.

4
2 : Perform a quantitative analysis, relative intensity or instrument calibration run.

This is done by calling subroutine QUANT via the LIFO stack.

4: Reset the tracking counter of either interface by calling subroutine SETANG. This

option also resets the units' activity flag (variable lACT). This flag is 0 when the

interface is inactive, 1 when counting, 2 when stepping, 3 when slewing, and -1 when any

type of interface error has been detected. In the last case, option 4 is the only way

of resetting an interface error and reinitializing the unit.

5: Slew to a user input 2e value by calling SLEW, INTRUP, ENSLEW, and INTRUP via the LIFO

stack.

6: Kill the job on one of the diffractometers in either of two modes. The first mode

causes an immediate halt of the Unit by calling FINIS in reset mode. This option

causes the tracking counter to drop one or two pulses (if a move was halted) and,

therefore, option 4 above must be used to reinitialize the unit. The second mode kills

the current job after the next interface completion occurs. This normal termination

leaves the unit ready for a new run. It should be noted that both terminations will

write any remaining data to the output file and close it with an endfile mark, so that

the data collected so far during the run can be read without error. The reset sequence

involves calling SLEW, INTRUP, ENSLEW, and INTRUP to reset the 2e angle to 80®. This

call sequence is made by MAIN via the LIFO stack.

7: Panic stop of both units by immediately clearing the NBS Bus and calling EXIT. Any

buffered data will be lost.

C: List contents of a disk on the console.

D: Turn the debug flag for each diffractometer on or off. When the flag is on a tracing

of the subroutine calls is produced on the printer.

E: Delete a file name from a disk.

F: Transfer files from hard disk to a floppy disk, to the printer, or to another computer

via the NBS NET by calling subroutine TRANS via the LIFO stack.

3. POWDER PATTERN COLLECTION : Subroutine QUAL is called from MAIN via the LIFO stack,

which was set by subroutine CONSOL at the user's request. It first requests the starting

angle for the pattern to be determined. It then sets the LIFO stack to call SLEW in order

to drive to this target angle (set into variable TANG). It further sets the QUAL mode flag

5
so that when subroutine QUAL is reentered, after the SLEW is initiated, it branches to the

logic after the SLEW command. This is one of the best examples of the advantages of a LIFO

stack in controlling logic flow.

While the SLEW motion is occurring, subroutine QUAL calls FILEUP which asks the user to

input the six letter name of the disk output file, into which the data for the pattern will

be written. In addition, FILEUP, which is also called by subroutine QUANT, requests the

input of the run title and operator's name. It then reads the date and time from the system

clock via subroutine DATE and returns to QUAL.

Subroutine QUAL next requests the parameters for the run: Starting angle, ending

angle, step size in degrees, count time per point, counting method, codes for the internal

standards being used, and the maximum number of counts to be collected at any point (default

= 32700). The subroutine allows for reentry of these numbers, each time outputting the

length of time the run would take, until the user is satisfied with a set of run parameters.

At this point, the necessary size of the output data file is computed, the file is allocated

on disk and five header records are written on it by subroutine ALOT. The format of the

output file is given in Table 5.

Record 6, containing the run parameters, is written by subroutine QUAL just before it

sets up the LIFO stack with the address of the step scan (STPSCN) subroutine which carries

out the entire data collection procedure.

4. STEP SCAN : Subroutine STPSCN carries out a move and count procedure. When 16 data

points have been collected it writes them to the output data file by calling subroutine

WRFILE which also resets the array. The independent step-then-count process (signaled by

variable MVCNT = 0) continues via LIFO stack calls to the begin move (BGMOVE), end move

(ENMOVE), begin count (BGCNT) and end count (ENDCNT) subroutines until a count has been

completed at the end angle as entered by the user in subroutine QUAL. A call is then issued

to subroutine WRFILE which writes any remaining data points to the output file, and then to

subroutine FINIS which clears the interface and resets run parameters, freeing the unit for

a new run. If during the course of data collection the maximum number of counts (variable

LIMCNT) were recorded before the requested count time elapsed, then the number recorded in

the output data record will be ten times the number of seconds spent counting to reach

LIMCNT number of counts. A negative sign is attached to this number as a flag to processing

6
programs. The alternate data collection method which simultaneously steps and counts (varible MVCNT = 1) proceeds via LIFO stack calls to B6M0VE and ENMOVE. This mode reduces the

computer overhead. It integrates over the two theta range given by the input step size.

The count time is equally divided between each 0.005° increment of the total step width.

4. QUANTITATIVE ANALYSIS ; Subroutine QUANT is called from MAIN via the LIFO address stack

as set up by CONSOL at the users request. It initially asks the user for the approximate

starting 2e for the run and begins the slew to this angle. While the slew is in progress it

asks the user if the run file, which contains the run parameters on each standard, unknown

or reference line to be run, exists. If this is the first time this particular quantitative

analysis has been run then the run file does not exist and subroutine STDFIL is called to

create it.

The file of run parameters created by subroutine STDFIL is compatible in format to the

output data file produced by either QUAL or QUANT. The format of this file is given in

Table 6. The information concerning the standard intensities (or slope of the calibration

curve) is not entered by the user but is computed at a later time and written by the off

line, host computer, processing program.

The intent here is that a quantitative analysis data file will contain all of the

information necessary to completely process that file. The first step is to run the samples

necessary to produce the calibration curve. Data collection for each mounting of a standard

can be automatically repeated several times (Default = 3). The standard may also be remounted several times and data collection repeated. These numbers are input by the user for

a particular run of the standard. Each phase to be analyzed requires a separate calibration

run of QUANT and, as with each standard determination for a phase, produces a separate

output data file. If we have four phases to be determined, we make four standards measurement runs with QUANT, Up to 20 different lines can be measured in each standard and unknown.

The four output data files will be read by the off line computer processing program which in

turn will output a new Run file which will be used to direct the quantitative analysis of

samples containing the four phases in unknown amounts.

QUANT allows for three types of quantitative analysis: the internal standard method

with or without the use of reference intensity ratios, the intensity ratio method, and the

spiking method. For a detailed description of how to use these methods, see the write-up

7
(in preparation as an NBS internal report) for the offline Quantitative Analysis program

which actually carries out the quantitative analysis. The program is very general, allowing

for chemical composition constraints and the presence of overlapped lines for phases which

are to be determined.

Subroutine STDFIL writes the complete run file of information for a single standard and

returns to QUANT. The file is rewound and then read by QUANT to calculate the required size

of the quantitative analysis output file as described in Table 6 and to make a maximum run

time estimate. The data file is allocated by a call to subroutine ALOT. Next the user

selects which lines in the Run File, unknown and reference, that are actually to be measured

on the sample currently under study. ENSLEW is called to ensure that the slew to the approximate starting angle has completed. A loop is now initiated which performs the following sequence:

A. Request the user to enter the number of repetitions, IFLAG(IUNIT, 5) and number of

mountings, IFLAG(IUNIT, 6) to be run for this sample.

B. Rewind the run file, skip the first five records and, if required, request that a

new sample be placed on the diffractometer.

C. Request the user to enter the chemical analysis for each new sample if it is an

unknown run and if chemical constraints have been requested. If entered it is written to

the output file.

D. Read line parameter records (records 7 and 8 of Table 6) and check if the last

line has been read. If so skip to step I below.

E. Check with the previously input list to see if this line is to be analyzed. If not

skip to step D above.

F. Write the line parameter records to the output data file.

G. Call ESTIM in order to optimize the time to spend counting the peak and background.

See the description of ESTIM below for details.

H. Call either STPSCN for an integrated intensity measurement (variable IPK=0) or

PKSCN for a peak height determination (IPK=1). These routines are called via the LIFO

stack. When they have completed data collection for a line and WRFILE has written the last

data points to the output file, QUANT is reentered at point D above.

I. Test if the last repetition and last mounting of the sample has been run. If not,

branch to step B. When all data is collected FINIS is called in reset mode to free the unit

8
for a new run.

4a. COUNTING MODES : There are four modes of data collection allowed by subroutine QUANT

and all four optimize the peak and background count time by a call to subroutine ESTIM.

This subroutine uses three input parameters in its optimization: TIMLIM - the total number

of minutes the user wishes to spend counting a line, a count mode flag (IPK) which sets the

program into peak count or integrate scan mode and lastly a count type flag (FIXERR) which

requests a fixed time counting mode or a fixed error counting mode. The optimization of all

four counting modes requires a knowledge of the peak and background counts in a line. For

this reason subroutine ESTIM first issues a one second count at the low angle background

then, for IPK = 0, integrates while driving at high speed to the high angle background 2e.

If IPK = 1, ESTIM drives to the peak maximum position (as input by the user on the run file)

and then counts for one second. It then slew backs to the low angle background and optimizes

the counting procedure in the following manner:

A. Fixed Time Count Mode: The number of background points to measure on each side of

the peak in either peak count or integrate mode is input as NBG and therefore 2*NBG background points will be measured (if two backgrounds are requested). In integrate scan mode

the number of points to be measured on the peak is NPK = (EANG-BANG)/DANG-2*NBG. In peak

count mode NPK points, as input by the user, will be measured at the top of the peak. The

total count time for the line (TIMLIM) is divided into TIME seconds to be spent at each peak

point and TIMBKG seconds to be spent at each background point according to:

jI|v|E = LIMTIM * 1 (1+1/R)

and

RKCim - NPK*TIME

BKGTIM - 2*nbG*R

where: I = the average count rate at each point in the peak scan,

B = the average count rate at each point in background, and

R =

J5

This division of time will result in the lowest estimated standard deviation for the net

9
counts (i.e., it optimizes the choice of TIME and BKGTIM). In the integrated count (scan)

mode, I is estimated from the rapid integration of the peak made by ESTIM. In the peak

count mode, I is simply the observed peak count rate in cps.

B. Fixed Error Count Mode: This type of count mode has traditionally been accomplished by counting to a fixed number of counts. For example, to achieve a 1% counting

error, 10000 counts above background must be collected. The difficulty with this type of

counting is that extremely long count times will be encountered on weak peaks. To improve

this method we require two input parameters. The first is FIXERR, the desired percent error

in the measurement, and the second is TIMLIM which, in this mode of counting, is the upper

limit on the total count time. The time to spend on peak in fixed error mode is computed

as follows:

TIME = IfR*B

FIXERR^*NPK*[I-B]^

The background time is determined by the same equation used in fixed time mode:

RvrTTM - NPK*TIME BKGTIM -

2 *nbG*R

This division of time between peak and background regions minimizes the total count time.

If the estimates of I and B made by ESTIM are such as to require a total time greater than

TIMLIM, then the program switches to fixed time counting for this peak.

4b. STEP SCAN : Subroutine STPSCN is also called by QUANT. The only difference in the

activity initiated by QUANT from that directed by QUAL (see page 6) is that the first and

last NBG points are counted for BKGTIM seconds. All points in between are counted for TIME

seconds. The offline summing of these peak and background counts will produce an integrated

intensity. It should be noted that the input parameter NPT, (number of peak data points),

is used in this mode only by the processing program. The NPT points about the observed

maximum in the step scan data will be averaged to give an estimate of the line peak height.

When STPSCN completes measurement of a peak as directed by QUANT it first calls WRFILE and

then returns to QUANT.

10
4c. PEAK SCAN; Subroutine PKSCAN carries out a peak counting procedure. NB6 points are

measured for BK6TIM seconds each at the low angle background. The step width between

points is DANG which defaults to the minimum step width of 0.005°. NPK points are measured

at the peak by collecting (NPK)/2 points on each side of the peak. Again the points are

separated by DANG degrees. Since we would like the division of points to be symmetric about

the peak, NPK must be an odd number. If it is even, 1 will be subtracted from it to make it odd.

odd. The 2e of the peak maximum is input by the user and stored in variable PANG. If the

high angle background (variable EANG) is input as zero, only one background will be measured.

5. SLEWING : Subroutine SLEW is called by MAIN via the LIFO stack. The subroutine initiates

a maximum rate scan (30 degrees per minute) by calling the begin move subroutine (BGMOVE).

Slew always checks the legality of the target angle by calling CKANG before attempting to

move. Subroutine CKANG forces the target angle to be a multiple of .005° (a single motor

step) and determines if a movement to this angle will cause a collision; it also computes

the number of motor steps required to get to the target angle. The slew motion always moves

10 steps too many toward low angle.

On completion of the slew subroutine ENSLEW is called, usually via the LIFO stack.

This subroutine in turn calls ENMOVE to ensure that the requested number of steps were

actually executed and that the tracking counter agrees. If all went well, ENSLEW then calls

BGMOVE to move 10 steps toward high angle and again calls ENMOVE to check that the request

was successfully executed. This logic ensures that the diffractometer gear backlash is

always tight in the high angle direction before any run is made. Any failure detected by

ENSLEW or ENMOVE (or for that matter ENDCNT) results in an abort sequence which ends the run

by calling FINIS.

6. RUN TERMINATION : Subroutine FINIS handles the completion of any run using the interface. It handles both normal and abnormal exits. For exits arising from an interface error

the unit activity is set to -1 which forces a user to reinitialize the interface (CONSOL

option 4) before any further use can be made of it. All exits will write any remaining

data in the 16 point data array out to the data file and then put an endfile mark on this

file.

After zeroing run parameters for the Unit, FINIS directs a slew operation to return the

11
29 arm to 80° where it is unlikely to be bumped by users. The last action of FINIS is to

print the time the job ended, the number of records in the file, and a message stating that

the unit is available for another run.

7. FILE TRANSFER : This option is selected by the user in subroutine CONSOL and directs a

LIFO stack call to subroutine TRANS. Subroutine TRANS allows file transfer from hard disk

to a floppy, disk to the printer or to another computer via the NBS NET.

12
TABLE 1.

INTEGER ADDRESS CODES USED ON THE LIFO STACK

ADDRESS OPERATION

1 CALL CONSOL

2 CALL QUANT

3 CALL QUAL

4 CALL STPSCN

5 CALL PKSCN

6 CALL SLEW

7 CALL ENSLEW

8 CALL BGiMOVE

a CALL BGCNT

IQ CALL FINIS

n CALL TRANS

12 CALL INTRUP

13 CALL ESTIM

13
TABLE 2.

FLOW CHART OF PROGRAM AUTO

MAIN

— INIT (SETANG-CKANG) — CONSOL (SETANG-CKANG, POP, PUSH, FILNAM, DATE) — QUAL (FILEUP, ALOT, ENSLEW-ENMOVE-FINIS, BGMOVE, ENTIM, POP, PUSH) — QUANT (SLEW-CKANG-BGMOVE, FILEUP, STDFIL, ALOT, ENSLEW-ENMOVE,

ENTIM, FINIS, BGMOVE, POP, PUSH) — STPSCN (BGCNT, ENDCNT, ENMOVE-FINIS, CKANG, POP, PUSH) — PKSCN (ENDCNT, ENMOVE-FINIS, CKANG, POP, PUSH)

SLEW (CKANG, BGMOVE, POP, PUSH) — ENSLEW (ENMOVE-FINIS, BGMOVE, POP, PUSH) — BGMOVE (POP) — ENMOVE (POP, FINIS-POP, PUSH) — BGCNT (POP) — ENDCNT (FINIS-POP, PUSH)

FINIS (POP, PUSH) — TRANS — INTRUP (POP, PUSH) — ESTIM (OPTIM)

Note: A dash indicates that the subroutine is called by the routine to the left. A comma indicates that the subroutine is called by the routine outside the parentheses.

System and NBS Bus calls are omitted from this flow chart.

14
TABLE 3.

SYSTEM AND NBS BUS ROUTINES

SYSTEM ROUTINES

IFLAG (0) A function that returns the value on top of the Interdata 7/16 's flag

table. It is used to detect a consol escape key input by the user.

SYSTEM (STRING, NUMBER) A subroutine that sends a FLOXOS (operating system) command to

the computer. STRING is an array or a quoted literal that forms the

command and NUMBER is the number of characters and blanks in the STRING.

NBS BUS ROUTINES

ISTAT (LU, NBSADD) An integer function that returns the status of the interface card

with the NBS Bus subaddress NBSADD.

INBUS (LU) An integer function that returns the contents of a subaddress that has

been previously selected with the routines ISTAT or CLEAR.

OUTBUS (LU, IDATA) A subroutine that sends data (the integer IDATA) to a previously

selected subaddress.

CLEAR (LU, NBSADD) A subroutine that selects the subaddress NBSADD and clears it.

COMAND (LU, STRING) A subroutine that sends commands to an NBS Bus card at a previously

selected subaddress. STRING is an array of quoted literals formed of

one or more of the following letters; A (address mode), I (increment

mode), D (decrement mode), S (start), C (clear).

Where NBSADD is the subaddress of the selected interface and LU is the logical unit

attached to the NBS Bus.

Note: All integer variables in the program are stored in two bytes except the variables

used in referring to the NBS Bus (e.g. LU, NBSADD, IDATA, etc) which are stored as four byte integers.

15
TABLE 4.

INPUT/OUTPUT UNITS

Logical

Unit Number

Variable

Name

Physical

Device Use

1 NBS NBS Bus All I/O to interfaces

2 IDT Date-Time Clock To read date and time

from system clock

3 ICLOCK Real Time Clock Not currently used

4 ISPEC Disk File-DACONF To read instrument

specifications

5 IRD Terminal input For user option input

6 IPRT Line Printer For listing the run file and debugging

7 ITYP Terminal output For instruction listing

8 IDISK(1,1) Run file for Unit #1

9 IDISK(2,1) Run file for Unit #2

10(A)* IDISK(1,2) Output data file

for Unit #1

n(B) IDISK(2,2) Output data file

for Unit #2

12(C) IFIN Input file for TRANS

13(D) IFOUT Output file for TRANS

^Values in parentheses are the hexidecimal values of the logical unit numbers used by the

operating system.

16
TABLE 5.

OUTPUT DATA FILE FORMAT FOR PAHERN COLLECTION

Record 1: Problem Specification

Col 1-80 Title of run

Col 81-100 Operators name

Col 101-106 Date of run

Col 107-112 Time of beginning of run

Record 2; Col 1-4

Col 5-10

Col 11-12

C(d1 13-14

Col 15-16

Col 17-22

Col 23-24

Col 25-28

Col 29-30

Col 31-36

Col 37-42

Col 43-46

Col 47-50

Col 51-54

Col 55-56

Col 57-58

Col 59-62

Col 63-66

Col 67-128

rd 3: Instrur

Col 1 Col 2 Col 3

Col 7-16

Col 17-32

Col 33-48

Col 49-64

Col 65-80

Col 81-96

Instrument Specification Parameters

The name of the diffractometer used for the run (e.g., AM-1)

The date the instrument specification (IS) file was created (e.g., 073080)

Initials of person who created the IS file (e.g., CH)

Element symbol of X-ray Tube Target (e.g., CU)

Characteristic X-ray line used (e.g., KA = Ka)

X-ray wavelength (e.g., 1.5406)

Focal spot type (e.g., FF = fine focus, SF = standard focus)

Take off angle in degrees (e.g., 5.50)

Divergent slit type (e.g., TC = Theta Compensating, FX = Fixed)

Divergent slit angle if Fixed slit or irradiated length in nm if Theta com- pensating (e.g., 12.500)

Goniometer circle radius in mm (e.g., 172.00)

Incident Seller Slit divergence angle in degrees (e.g., 4.00)

Receiving Seller slit divergence in degrees (e.g., 0.00)

Receiving slit divergence in degrees (e.g., 0.10)

Monochromator code (e.g., GR = graphite, LF = lathi urn fieri de, blank = none)

Detector Code (e.g., SC = scintillation)

Dead time in microseconds (e.g., 2.00)

Instrument Intensity stability factor in % (e.g., 0.10)

Not Used

lent Calibration information

Flat specimen correction (0 - not applied, 1 - applied)

Axial divergence correction (0 - not applied, 1 - applied)

Lorentz correction (0 - not applied, 1 - applied)

2e offset to be subtracted from the 2e values before applying the polynomial

correction (F10.3)

aQ Y intercept of calibration polynomial (El 6. 8)

ai first order polynomial coefficient

a£ second order polynomial coefficient

as third order polynomial coefficient

ai+ fourth order polynomial coefficient

Record 4 and 5: Record 4:

Record 5:

Inverse Matrix from Instrument Calibration Run (8E16.6).

(1,1). (1,2), (1,3), (1,4), (1,5), (2,2), (2,3), (2,4)

(2,5), (3,3), (3,4), (3,5), (4,4), (4,5), (5,5)

The order is

Record 6:

Col

Col

Col

Col

Col

Col

Col

Col

Col

Col

Col

Run Parameters

1-7 Beginning angle of scan (BANG-F7.3)

8-14 (Reserved)

15-21 Ending angle of scan (EANG-F7.3)

22-28 Step width in degrees (DANG-F7.3)

29-32 Rate of movement between points in degrees per minute (RATE-F4.1)

33 Method: 0 = independent/1 = simultaneous move and count

46-50 Maximum count allowed for scaler-defaults to 32700 (LIMCNT-I5)

51-52 Code for internal standard number 1 (if one is present)

53-54 Code for internal standard number 2 if needed

55-56 Code for internal standard number 3 if needed

105-111 Count time for each point in seconds (TIME-F7.2)

17
Table 5. (cont.)

Record 7: Intensity Data in (F8.3, 2X, 312, 1617)

Col 1-8 The angle of the last point in the record (CANG-F8.3)

Col 9-16 The time the record was written (ITIM-3I2)

Col 17-23 Counts at first point (CNT(1)-I7)

Col 24-30 Counts at second point (CNT(2)-I7)

Col 122-128 Counts at sixteenth point (CNT(16)-I7)

As many of these records as needed are included to record the number of counts observed

at each point. A negative data point indicates that LIMCNT counts were detected and the

data point is the negative of ten times the number of seconds spent counting.

18
Table 6.

RUN FILE AND OUTPUT DATA FILE FORMAT FOR QUANTITATIVE ANALYSIS

Record 1 Col

Col

Cel

Col

Col

Problem specification - compatible with record 1 in Table 5. 1-80 Title of Run (ITITLE (1-40) - 40A2)

operator (ITITLE (41-50)-10A2)

File Creation YYMMDD (IDAT-3I2)

File Creation HHMMSS (ITIM-3I2)

0 This is an output data file from

1 This is an output data file from

= 2 This is a run file directing the

for quantitative analysis

= 3 This is a run file output

81-100 Name of

101-106 Date of

107-112 Time of

113 IFLAG (1) =

Col 114 IFLA6(2)

Col 115 IFLAG(3)

Col 116 IFLAG(4)

Col 117 IFLAG(5)

Col 118 IFLAG(6)

pattern collection

quantitative analysis

determination of a standard

or calibration

from the data reduction program on the

off line computer, directing the quantitative analysis of an unknown

4 This is an output data file for a calibration run

0 Qualitative analysis run

1 Run to analyze an unknown

2 Run to measure standards

3 Run to measure relative intensities

0 Qualitative analysis

1 Internal Standard Method of Analysis

2 Intensity Ratio Method of Analysis

3 Spiking method of analysis

4 Relative Intensity Measurement

5 Profile measurement

0 Elemental percent composition is not on the file

1 Elemental percent composition is included in Record 6

0 Qualitative analysis

N the number of repetitive runs for this sample for quantitative

analysis (all to be output in the same data file) only needed

when I FLAG (1) =2. (Default = 3).

N the number of mountings of each sample to be run

*Record 2: Instrument specification - identical with record 2 of Table 5.

*Record 3-5 : Calibration parameters - identical with records 3-5 of Table 5.

*Record 6: Elemental Composition. This record will be blank if IFLAG(4)=0. (10(A2, 2F5.2))

Col 1- 2 Element symbol (A2)

Col 3- 7 Percent of element in unknown (F5.2)

Col 8-12 Standard deviation of percentage (F5.2)

Col 13-14 Element symbol number 2 Col 15-19 Percent of element 2 Col 20-24 Standard deviation of percentage

Col 109-110 Element Symbol number 10

Col 111-115 Percent of element 10

Col 116-120 Standard deviation of percentage

RECORD 7: Line parameters - This record is compatible with record 6 of Table 5 but contains

additional information needed for quantitative analysis.

Col 1- 7 2e of Low angle background of peak to be recorded (BANG-F7.3)

Col 8-14 2e of peak maximum - used in peak count mode (PANG-F7.3)

Col 15-21 20 of high angle background of peak to be recorded (EANG-F7.3)

count mode this may be zero if only one background is desired.

. In peak

Col 22-28 Step width to be used in moving over the peak. This defaults

(DANG-F7.3)

to .005°.

Col 29-32 Rate of movement between points in degrees per minute (RATE-F4 .1)

19
Table 6. (cont.

)

Col 33

Col 34-40

Col 41-45

Col 46-50

Col 51-56

Col 57-62

Col 63

Col 64

Col 65

Col 66-67

Col 68-69

Col 70-75

Col 76-79

Col 80-88

Col 89-96

Col 97-104

Col 105-111

Col 112-118

RD 8: Line ( Col 1- 6

Col 7-12

Col 13-18

Col 19-22

Col 23-28

Col 29-34

Col 35-40

Col 41-44

The fol lowii

required if

Col 49-50

Col 51-58

Col 59-60

Col 61-68

Method: 0 = independent/1 = simultaneous step and count

The maximum time in minutes to be spent counting a peak. In fixed time

mode this value will be optimally divided between background time and peak

time. In fixed error count mode this will be treated as an upper limit on the count time. (TIMLIM-F7.3)

The percent error to which a peak should be counted. If zero, fixed time

count mode will be used. (FIXERR-F5.2)

The maximum number of counts allowed in the scaler-usually 32700 (LIMCNT15)

Name of the phase (3A2)

hki of the line (312)

KODE (II) =

= 4

this line belongs to the unknown phase being analyzed

this line belongs to the internal standard

this line is an intensity reference belonging to a special narrow slotted sample holder

this area is from an amorphous halo (NBG=0)

lOVLP(Il) = 0 this is a fully resolved line

= N there are N more lines overlapped with this line whose phase

name, hkA and 1^^^ values will supplied on Record 8.

IPK (II) - 0 Integrated step scan of the peak

= N peak counting mode

The number of points to be measured at the top of a peak in peak count mode

or the number of points to be used in averaging at the peak to estimate

peak intensity in peak scan mode (NPK-I2).

The number of points to count for BKGTIM seconds at the beginning and end

of a peak. Equals zero if KODE = 4. (NBG-I2).

Relative intensity of the line (FREL-F6.1)

Standard deviation of the relative intensity (SIGREL-F4.1

)

The standard intensity to be used in analyzing an unknown line. This will

’pure ’pure^’ref ’unk^’std

t’’® analysis "»thod.

This value will be computed by the analysis program when run to measure the

standards (STD-F9.4).

ESD of standard intensity (SIGSTD-F8.4)

The concentration of the added phase if IFLAG(3)=3. The weight fraction of

the internal standard if IFLAG(3)=1. The mass absorption coefficient of

this sample if IFLAG(3)=2. (C0NC-F8.3)

Count time at each peak point in seconds (TIME - F7.2)

Count time at each background point in seconds (BKGTIM - F7.2)

Name of second phase overlapping this line (3A2)

hkJi of overlapping line (312)

Vel overlapping line (F6.1)

Standard deviation of I^^-j of second overlapping line (F4.1)

Name of third overlapping phase

hkt of third overlapping line

I^ei of overlapping line

Standard deviation of I^^-j of third overlapping line

Symbol of element 1 of phase (A2)

Percentage of element 1 in phase (F.8.4)

Symbol of element 2 of phase

Percentage of element 2 in phase

20
Table 6. (cont.)

Col 119-120 Symbol of element 8 of phase

Col 121-128 Percentage of element 8 in phase

Note: Record 8 will always be present but usually blank.

RECORD 9: Intensity data (F8.3, 2X, 312, 1617)

Col 1- 8 The angle of the last data point in the record (CANG - F8.3)

Col 9-16 The time the record was written (ITIM - 312)

Col 17-23 Counts at first point

Col 24-30 Counts at second point

l|

I Col 1*22-128 Counts at sixteenth point

j!

j As many of these records as needed are included to record the number of counts observed

at each point. A negative data point indicates that LIMCNT counts were detected and the

data point is the negative of ten times the number of seconds spent counting.

*Record 2, 3, 4, and 6 are not contained in the Run File.

21
EXAMPLE

!''

This example shows the initiation of program AUTO. The current 2e for each unit is

entered by the user. AUTO then lists the option menu. Here, the user chooses to slew to

25.0° 2e on unit #2.

ENTER

•7 0 _ 00<-

THE CURRENT •THETA OF UNIT ti (

F

1 0 . 3

)

ENTER

2 4 . i 3

THE CURRENT 2-•THETA OF UNIT *2 <F10 .3)

)KX^ AUTO CONITROL XoK

ENTER ONE OF THE FOLLOWING OPTIONS (Zi):

0 - STATUS

1 - POWDER PATTERN C01..LECTI0N

2 - QUANTITATIUE ANALYSIS

4 -- GET :? -THETA

5 - SLEW TO 2- THETA

6 - TERMINATE RUN OM A UNIT

7 - PANIC STOP ON BOTH UNITS

C LIST DISK CONTENTS

D - DEBUG

E -- DELETE A FILE

F -- TRANSFER- FILE

c'^NTER UNIT NUMBER <Ii)

p

“^CURRENT 2-THETA= 24.130 ENTER TARGET 2-THETA <F7.3)

1 A . 0

^User entries are underlined. Each entry is terminated by hitting RETURN.

22
EXAMPLE 2

When the ESC key is pressed the program AUTO responds by listing the option menu. A

powder pattern collection was initiated on Unit #2 beginning at 3.0°. File name, run title

and operator name were then input. Next the ending angle, step size, count time, and MVCNT

method code were entered. Since the max count was not entered the default value was used.

No internal standards were present so the user hit the return key after the inquiry. After

the program echoes the input and estimates the run time the user can indicate if corrections

and/or printing of these parameters is desired. At completion of the data collection, a termination message is printed which includes the file name and number or records written to

the disk.

(ESC)

AUTO CONTROL **

ENTER

0

12

45

t>7

C

D

E

F

1

ENTER

2

ONE OF THE FOLLOWING OPTIONS <Zi):

- STATUS

- POWDER PATTERN COLLECTION

- QUANTITATIVE ANALYSIS

- SET 2-THF.TA

- SLEW TO 2-THETA

- TERMINATE RUN ON A UNIT

- PANIC STOP ON BOTH UNITS

- LIST DISK CONTENTS

- DEBUG

- DELETE A FILE

- TRANSFER FILE

UNIT NUMBER (11)

POWDER PATTERN DATA COLLECTION ON UNIT *2 ON 80/11/13 AT 11)31:47

ENTER STARTING ANGLE FOR THE RUN-F7.3-(DEFAULT=S. 0)

3.0

ENTER FILE NAME- 6 CHARACTERS ENDING WITH D CH053D

ENTER RUN TITLE

SAMPLE POWDER PATTERN DATA COLLECTION FOR SILICON

"ENTER Your HAHE: —

CAMDEN HUBBARD

ENTERsEND ANGLE ,STEPSI2E , COUNT TIME(SEC) ,METHOD,MAXCOUNTS UNDER DEFAULT VALUES

90.000 O.OPO i.O 0 32700

60.0 0.03S 0.2 1 ENTER 2 LETTER CODES FOR UP TO 3 INTERNAL STANDARDS

POWDER PATTERN DATA COLLECTION ON UNIT *2 ON 80/11/13 AT 11:31:47

SAMPLE POWDER PATTERN DATA COLLECTION FOR SILICON

CAMDEN HUBBARD . OUTPUT FILE: CH0S3D

STANDARDS:

BEGIN ANGLE = 3.000

END ANGLE(DEG)= 60.000

STEP SI2E(DEG>= 0.025

CNT TIME(SEC) = 0.200

MVCNT METHOD » 1 MAX COUNTS = 32700

RUN TIME (HRS) » 0.266

CORRECTIONS? Y/N

PRINT INPUT? Y/N

END OF RUN: UNIT 2, FILE; CH0S3D,REC= 149 ON 80/11/13 AT 11:31:47

23
EXAMPLE 3

During the course of data collection the user can interrupt by pressing the ESC key.

In this example, the status of both units was requested.

t r.iJTO COilTPOL

one of the follooino options <zi. >:

0 - STATUS

1 -• POUDEIR PATTERN COLLECT TOM

2 - OUAMTITATIME ANALYSIS

SET 2-THETA

5 - SLEW TO 2-THETA

6 ~ TERMINATE RUN ON A UNIT

7 - PANIC STOP ON BOTH UNITS

C -• LIST DISK CONTENTS

D -- DEBUO

E - DELETE A FILE

F - TRANSFER FILE

tt STATUS tt ON B0/li./2i AT 9!2i!26

0

UNI T

1

FII..E; RUN

TO END AT:

2-THETA:

CH0S3D

INACTM 0 POWDER 1 0/ 0 0:0 li/2i 9:22

79.99S 16.140

24
EXAMPLE 4

The QUANT option was requested for Unit #2 beginning data collection near 25.0°.

Because the user indicated that a run file does not exist the subroutine STDFIL requested

the needed information. In this example a single reflection profile measurement is requested.

The net integrated intensity is to be measured with a relative error of approximately 0.5%

unless the total data collection time would exceed 10 mintues. The angle range choosen was 27.2 to 29.4° in steps of 0.005°. Twenty points on each side were selected as background

points. '

(ESC)

*t. AUTO CONTROL **

ENTER

0

12

A5

6

7

C

DE

F

ENTER

2

ONE OF THE FOLLOWING OPTIONS <Zl);

- STATUS

- POWDER PATTERN COLLECTION

- QUANTITATIVE ANALYSIS

- SET 2-THETA

- SLEW TO 2-THETA

- TF:.RMINATE RUN ON A UNIT

- PANIC STOP ON DOTH UNITS

- LIST DISK CONTENTS

- DEBUG

- DELETE A FILE

- TRANSFER FILE

UNIT number (ID

QUANT ANALYSIS DATA COLLECTION ON UNIT *2

ENTER APPROXIMATE STARTING 2-THETA (F7.3)

25.0

RUN FILE ALREADY EXIST? Y/N

NENTER FILE NAME- t> CHARACTERS ENDING WITH R CH054R

ENTER RUN TITLE

COLLECTION OF A SELECTED PEAK PROFILE BY QUANT OPTION

“THTER YQUIV HAKE i CAMDEN HUBBARD

METHOD OF ANALYSIS ? (ID

1 - INTERNAL STANDARD

2 - INTENSITY RATIO

3 - SPIKING

A - REL. INT. (DEFAULT)

5 - PROFILE

5

FOR LINE 1 ENTER UNDER DEFAULT VALUES

1 -6 NAME OF LINE(BLANK TERMINATES INPUT)

7- 8, 9-10, 11-12 H K AND L 13-14 =0 INTEGRATE, =1 PEAK COUNT

15-16 =>1 UNKNOWN, =2 STD, =3 REF, =4 AMORPH LINE

17-22 =X.X THE DESIRED % ERROR (0=FIXED TIME)

23-30 TIME(MIN) TO COUNT PK + BKG

31-38 REL. INT. 39-46 SIGMA(REL. INT.)

NNNNNN H K L 0 1 1.000 10.000 *«*.«* *.**

SILICN 111 0,5

SILICN 11101 0.500 10.006 0.00 0.00

OK? TYPE Y/N

Y

25
EXAMPLE 4 (continued)

ENTER THE

COL i -10

COL ii-20

COL 21-30

COL 31-40

-COL 41-46

COL 47-50

COL 51-55

COL 60

FOLLOWING UNDER THE DEFAULT

BACKGROUND LOU 2-THETA

PEAK 2-THETA

BACKGROUND HIGH 2-THETA

STEP WIDTH

HAX.- COUNTS

* OF PEAK POINTS

* OF BACKGROUND POINTS

MVCNT METHOD

VALUES!

LLL.LLL PPP.PPP HHH.HHH 0.005 32700 5 10 0 27.2 28 . 443 39.4 20 1 27.200 28.443 .29.400 0.005 32700 5 20 1 OK? TYPE Y/N

I

FOR LINE =8= 2 ENTER UNDER DEFAULT VALUES

1 -6 NAME OF LINE(BLANK TERMINATES INPUT)

7- 8, 9-10, 11-12 H K AND L 13-14 -0 INTEGRATE, =1 PEAK COUNT

15-16 =1 UNKNOWN, =2 STD, =3 REF, =4 AMORPH LINE

17-22 =X.X THE DESIRED '/. ERROR (0=FIXED TIME)

23-30 TIME(MIN) TO COUNT PK + BKG

31-38 REL. INT. 39-46 SIGMA(REL. INT.)

NNNNNN H K L 0 1 1.000 10.000 ***.** *.**

ENTER! * OF REPETIONS, OF MOUNTINGS <2I1)

11

ENTER FILE NAME- 6 CHARACTERS ENDING WITH D CH054D

ENTER RUN TITLE

PEAK PROFILE DATA COLLECTION FOR THE 1 11 REFLECTION OF SILICON

ENTER YOUR NAME: ^ ^ CAMDEN HUBBARD

PLACE SAMPLE 1 ON UNIT 2 WHEN READY HIT RETURN. ENTER 1 TO STOP

END OF RUN! UNIT 2, FILE! CH054D,REC= 36 ON 80/11/13 AT lli3i!47

26
123

45

6

76

9

10

1112

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

4.8 49

SO

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74

n

.on

n APPENDIX 1 PROGRAM AUTO - TUS IS THE MAIN PROGRAM FOR THE XRAV POWDER

DIFFRACTION DATA COLLECTION SYSTEM.

C UPDATE 11/10/80/

C444 444 4444 4444444* 44 4444444444«4444 4444444444444 44444444444444444 444444 44

Cc

c

c

cc

c

c

c

c

c

c

c

c

c

c

cc

c

cc

c

cc

c

ccc

c

c

cc

c

c

PROGRAMMED BY R. L« SNYDER* C.R* HUBBARD AND N.C. PANAGI OTOPOULOS

COMMON DECLARATIONS FOR ALL SUBROUTINES

IMPLICIT INTE6ER42 <I-N)

INTEGER** NBS. INTR

COMMON /ANG/ BANG( 2)

CANG(2)

DANG(2)«

1 EANG<2), 1RATE(2)

PANG(2), RATE(2),

2 TANG(2)* IZRST(2)NPTPKC2)

COMMON /BUFF/ IALPH(66)

NAME(15)

COMMON /CNTL/ I ACT(2)

IDBUG(2), INTR.

1 IRUN(2), ITRANS(2*20)

MODE (2, 20)

MVCNT(2)

COMMON /COUN/ ICNT< 2,16)

IPT(2)

,

IT0T(2).

1 LIMCNT(2). 1SAVE(2)

COMMON /lO/ NBS* IDT, ICLOCK,

1 ISPEC, IRD* IPRT, ITYP,

2 1DISK(2,2), IFIN, IFOUT

COMMON /PROB/ I0AT(3)IFLAG(2,10), ITIM(3),

1 ITITLE(SO)

COMMON /QUAN/ CONC* FREL* lOVLP,

1 KOBE, LOOP(2)

,

LPK(2)NUM(2.20)

2 SIGSTD* STD, STDREL, IREPT(2)

COMMON /RNDT/ NREC(2). NMF1L(2*6)

ITRC2)

1 IENRN(2.4)

COMMON /TIM/ BKGTIM(2), FIXERR(2), IPK(2),

1 NBG(2), NPK(2), TIME(2), T1MLIM<2)

COMMON BLOCK GLOSSORY'

I/O DEFINITIONS

NBS = 1 IDT = 2 ICLOCK = 3

ISPEC = 4

IRD = 5

IPRT = 6

ITYP = 7

IDISK(l.l) = 1DISK(2*1) s IDISK(1*2) = IDISKC2.2) = IFIN = IFOUT =

- COMMON /lO/ - THE LOGICAL UNIT NUMBER OF THE NBS BOS

- THE UNIT FOR READING THE DATE AND TIME

- THE UNIT FOR THE REAL TIME CLOCK

- THE UNIT FOR READING THE CONFI IGURATION ) FILE

- TERMINAL INPUT - LINE PRINTER OUTPUT

- TERMINAL OUTPUT

8 - STANDARD INPUT FILE FOR DIFFRACTOMETER 41

9 - STANDARD INPUT FILE FOR DIFFRACTOMETER 42

10“ OUTPUT DATA FILE FOR DIFFRACTOMETER 41

11“ OUTPUT DATA FILE FOR DIFFRACTOMETER 42

12 INPUT FOR TRANS ROUTINE

13 OUTPUT FOR TRANS ROUTINE

JUNE 1980

C GENERAL PARAMETER DEFINITIONS-COMMONS /ANG/ ./BUFF/, /CNTL/ . /COUN/ . /PROS/

BANG

BKGTIM

CANG

DANG

EANG

FIXERR

lACT

THE BEGINNING 2-THETA FOR RUN CN UNIT 41 OR 42

BACKGROUND COUNT TIME IN SECONDS

THE CURRENT 2-THETA OF THE DIFFRACTOMETER

THE DELTA 2-THETA OR STEP JIOTF

THE ENDING 2-THETA FOR THE RUN

0 - FIXED TIME COUNT MODE (WITH OPTIMIZATION)

XX - FIXED ERROR COUNT MODE, CCUNT TO XX PERCENT ERROR

A CURRENT ACTIVITY CODE FOR A UNIT

=“1 LIMIT SWITCH HIT OR INTERFACE ERROR 2THETA LOST

= 0 UNIT NOT ACTIVE

27
75 C 76 C 77 c 78 c lALPH

79 c ICNT

80 c IDAT

81 c IDBUG

82 c 83 c IFLAG

84 c IFLAG(1,1)

85 c 86 c 87 c 88 c 89 c 90 c IFLAG( 1,2)

91 c 92 c 93 c 94 c 95 c IFLAG(1,3)

96 c 97 c 98 c 99 c 100 c

101 c

.102 c 1FLAG( 1,4)

103 c 104 c 105 c 106 c IFLAG(1,5)

107 c IFLAG(1,6)

108 c IFLAG( 1,7-

109 c INTR

110 c IPK

111 c 112 c 113 c IPT

114 c 115 c IRATE

116 c IRUN

117 c 118 c

1 19 c 120 c 121 c 122 c 123 c (SAVE

124 c 125 c 126 c ITOT

127 c

1 28 c 129 c ITIM

130 c ITITLE(SO)

131 c 132 c 133 c I TRANS

134 c 135 c 136 c

1 37 c 138 c

1 39 c 140 c

141 c 142 c 143 c 144 c 145 c 146 c 147 c 148 c

- 1 UNIT IS COUNTING

= 2 UNIT IS STEPPING

= 3 UNIT IS SLEWING

A SCRATCH ARRAY USED IN VARIOUS PLACES

THE ARRAY FOR RECENTLY CCLLECTED INTENSITY VALUES

THE DATE OF THE START OF THE RUN

0-00 NOT PRINT DEBUG INFORMATION

I - PRINT DEBUG MESSAGES AND LOGIC TRACE

RUN CONTROL FLAGS READ FROM QUANT RUN FILE

FILE TYPE DISCRIPTOR

= 0 DATA FILE FROM PATTERN COLLECTION

= 1 OUTPUT DATA FILE FROM QUANT = 2 QUANT RUN FILE FOR STANDARD DETERMINATION

= 3 QUANT RUN FILE FOR UNKNOWN DETERMINATION

= 4 OUTPUT FILE FRCM CALIBRATION RUN

RUN TYPE DESCRIPTOR

= O PATTERN COLLECTION

= I QUANT ANALYSIS FOR WTX

= 2 DETERMINE CONSTANTS FROM STANDARDS

(QUANT, I-REL, OR CALIBRATION)

QUANTITATIVE ANALYSIS TYPE

= 0 QUAL

35 1 INTERNAL STANDARD METHOD

= 2 INTENSITY RATIO METHOD

= 3 SPIKING METHOD

* 3 RELATIVE INTENSITY RUN

35 4 CALIBRATION RUN

ELEMENTAL ANALYSIS FLAG = 0 QUAL

= O ELEMENTAL COMPOSITION WILL NOT BE ENTERED

= 1 ELEMENTAL COMPOSITION WILL BE USED

NUMBER OF REPET IONS FOR EACH SAMPLE MOUNT

NUMBER OF MOUNTINGS FOR THIS COMPOUND OR MIXTURE

: AVAILABLE FOR FUTURE EXPANSION

THE STATUS WORD FROM THE INTERFACE WHICH JUST COMPLETED

= DATA COLLECTION MODE FLAG = 0 STEP SCAN (IE TO BE LATER INTEGRATED) = 1 PEAK COUNT MODE

THE NUMBER OF THE CURRENT GROUP OF 16 DATA POINTS

WHICH IS BEING COLLECTED OR WAS JUST COLLECTED

INTERFACE RATE CODE = 30/RATE

A STATUS FLAG FOR EACH DIFFRACTOMETER

s 0 NOT IN USE

55 1 QUANTITATIVE ANALYSIS RUN

= 2 QUALITATIVE ANALYSIS RUN

5= 3 INTENSITY MEASURING RUN

* 4 CALIBRATION RUN

= 5 ALIGNMENT RUN

1 ENMOVE SAVES COUNTS ACCUMULATED DURING 2-THETA

DRIVE

0 DO NOT SAVE COUNTS

THE TOTAL NUMBER OF DATA POINTS COLLECTED SO FAR

GOAL ALL POINTS, QUANT POINTS IN THE PEAK

CURRENTLY MEASURED

TIME WHEN SUBRTN DATE WAS CALLED

THE RUN TITLES

- CHAR 1-80 = TITLE

- CHAR 81-100 = THE OPERATORS NAME

A LIFO (LAST IN FIRST OUT) ARRAY OF TRANSFER FLAGS

THESE FLAGS, WHICH ARE SET BY VARIOUS SUBROUTINES,

CONTROL THE FLOW OF THE PROGRAM BY DETERMINING WHICH

SUBROUTINES ARE TO BE CALLED NEXT

= 1 CALL SUBROUTINE CONSOL

= 2 CALL QUANT

= 3 CALL QUAL

= 4 CALL STSCAN (IE STEP SCAN)

= 5 CALL PKSCAN (IE PEAK SCAN)

= 6 CALL BGSLEW

* 7 CALL ENSLEW

* 8 CALL BCMOVE (IE BEGIN MOVE)

=5 9 CALL BGCNT (IE BEGIN COUNTING)

* 10 CALL FINIS - END THE RUN

=11 CALL TRANS - TO TRANSFER A FILE TO THE 1108

= 12 CALL INTRUP - THE EVENT DRIVEN SUBROUTINE

28
149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

1 89

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

C

c

cc

ccc

c

cc

ccc

cc

c

c

cc

cc

cc

cc

c

c

c

c

c

cc

c

c

cc

c

cc

c

cc

c

cc

c

c

c

ccc

c

cc

c

c

c

cc

c

cc

c

c

cc

c

c

cc

c

c

c

c

IZRST

LIMCNT

MODE

M0DE( IUN1T«1

)

MODE( IUN1T«2)

MODE( lUNIT, 31 MCOE< 1UN1T.4)

MODE! lUNIT *5)

MOOE( IUNIT«6)

MOOE( IUNIT#7)

MODE( IUN1T«8)

MODE( 1UNIT.9)

MOOE( lUNIT.lO

MOOE( lUNlT* 11)

HOOE( lUNIT* 12)

HODE( lUNITt 13)

MOOE< lUNIT, 14-

MVCNT

NAME

NBG

NPK

NPTPK

PANG

RATE

TANG

TIME

TIMLIM

= 13 CALL ESTIM - TO OPTIMIZE PEAK COUNTING

= 14-20 AVAILABLE FOR FUTURE EXPANSION

= A FLAG TO INDICATE A ZERO STEP REQUEST TO SLEW

= O (FALSE) - NON ZERO STEP REQUEST

s 1 (TRUE) - A ZERO STEP REQUEST. WE ARE AT

THE DESIRED ANGLE. INTERFACE WILL NOT SHOW

A COMPLETION.

= THE MAXIMUM COUNTS ALLOWED AT A POINT (DEFAULTS TO 32700)

* AN INTERNAL TRANSFER FLAG FOR THOSE SUBROUTINES WHICH

NEED TO INITIATE AN ACTIVITY AND AWAIT A COMPLETION

= CONSOL TRANSFER FLAG

= QUANT FLAG

= QUAL FLAG

= ST SCAN FLAG

= PKSCAN FLAG

= END COUNT FLAG (ENOCNT)

= END SLEW FLAG (ENSLEW)

= END MOVE FLAG (ENMOVE)

= BEGIN COUNT FLAG (BGCNT)

) = FINIS FLAG

(NOT USED BY TRANS)

(NOT USED BY INTRUP)

= ESTIM FLAG

20) AVAILABLE FOR FUTURE EXPANSION

= A FLAG TO ESTABLISH STEP AND COUNT METHOD

- 1 FOR SIMULTANEOUS STEP AND COUNT

= 0 FOR INDEPENDENT STEP THEN COUNT

a A SCRATCH ARRAY AVAILABLE FOR USE

a THE NUMBER OF BACKGROUND POINTS TO MEASURE ON

ON EACH SIDE OF THE PEAK

a THE NUMBER OF POINTS TO MEASURE AT THE PEAK IN PEAK

COUNT MODE OR THE NUMBER OF POINTS TO AVERAGE OVER

AT THE MAXIMUM IN INTEGRATE MODE TO ESTIMATE THE

THE PEAK INTENSITY

NUMBER OF POINTS IN PEAK REGION (QUANT RUN)

a NPK IF IPKal

a (EANG-BANG)/DANG-fl-NPTBG WHERE NPTBGaNBG OR 24NBG

a THE 2 THETA OF THE PEAK MAXIMUM

a THE MOVE RATE IN DEGREES PER MINUTE

a THE TARGET ANGLE OF THE CURRENT OR NEXT MOVE

a THE COUNT TIME PER POINT (IN SECONDS)

a THE MAXIMUM TIME TO COUNT A LINE IN MINUTES

(IE THE SUM OF THE TOTAL BACKGROUND AND PEAK TIMES)

QUANTITATIVE ANALYSIS PARAMETERS - COMMON /QUAN/

CONC

FREL

lOVLP

IREPT

KOBE

LOOP

LPK

NUM

SIGSTD

STD

STOREL

a CONCENTRATION OF ADDED STANDARD FOR SPIKING METHOD

OR CONCENTRATION OF INTERNAL STANDARD,

a THE RELATIVE INTENSITY OF THE LINE

a THE NUMBER OF ADDITIONAL LINES OVERLAPPED WITH THIS ONE a THE CURRENT REPITION NUMBER FOR THE PRESENT MOUNT

C<-IFLAG( .5)1

a THE TYPE OF LINE BEING ANALYSED a O UNKNOWN LINE (IE OF PHASE TO BE ANALYSED) a I INTERNAL STANDARD LINE

a 2 REFERENCE LINE (IE FRCM SAMPLE HOLDER)

a THE CURRENT NUMBER OF TIMES A SAMPLE HAS BEEN

MOUNTED IN THE PRESENT RUN. C<aIFLAG< .6)]

a THE SEQUENTIAL NUMBER OF THE PEAK FROM THE RUN

FILE CURRENTLY BEING DETERMINED

a THE SEQUENCE NUMBERS OF THE LIKES FROM THE

RUN FILE TO BE DETERMINED FOR THIS UNKNOWN SAMPLE

a THE STANDARD DEVIATION OF THE STANDARD I MEASURMENT

a THE STANDARD INTENSITY MEASURMENT. IF IFLAG(1«3):

aO THEN STD IS I ( UNK ) / I ( INT. STD.

)

a 1 THEN STD IS I ( UNK ) / I ( PURE ) OR I (PUREI/I ( REF

)

a 2 THEN STD IS I (PURE)

a THE STANDARD DEVIATION OF THE RELATIVE LINE INTENSITY

RUN.DATE-TIME PARAMETERS - COMMON /RNDT/

NMFIL( IUNIT.6)

NREC( ILNIT)

ITR( lUNIT)

NAME OF THE OUTPUT FILE

NUMBER OF RECORDS WRITTEN ON THE OUTPUT FILE

ACTIVITY OF THE UNIT

29
223

22A

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

,260

261

262

263

264

265

266

267’

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

266

287

288

289

C 1 INACTIVE

C 2 POWDER DATA COLLECTION

C 3 QUANT ANALYSIS

C 4 SLEW

C ITRUN(3#3) DESCRIPTOR OF RUN ARRAY

C lENRNI IUNIT.4 ) ESTIMATED TIME OF END OF RUN

Cc

c

C INITIALIZE VARIABLES COMMON TO ALL PROGRAM FUNCTIONS

CALL IMT

lUNIT = 1 CC CONSOL HAS INTERRUPTED - SERVICE IT C10 CALL CCNSOLI lUNIT)

GO TO 990

C

C QUANTITATIVE ANALYSIS REQUESTED

C20 CALL QUANT(IUNIT)

GO TO 990

C

C QUALITATIVE ANALYSIS REQUESTED

C30 CALL QUAL(IUNIT)

GO TO 990

C

C INTERFACE HAS INTERRUPTED - FROM STEP SCAN

C40 CALL STPSCN< lUNIT.NSTEP)

GO TO 990

C

C THE INTERFACE HAS COMPLETED A REQUEST FROM PEAK COUNT

C50 CALL PKSCANI IUNIT«NSTEP)

GO TO 990

CC BEFORE CALLING SLEW CHECK IF WE ARE 10 STEPS BELOW TARGET ANGLE

C60 CALL CKANGI lUMT.NSTEPt lERROR ) IZRST( lUNIT) = O

IF (NSTEP «EQ« 10) GOTO 66

C

C INITIATE A MAXIMUM RATE MOVE TO ANGLE BANG

C CALL BGSLEWI lUNIT)

GO TO 990

C

C NO INTERRUP COMPLETION EXPECTED. COMPLETE SLEW BY DRIVING UP 10 STEPS

C TO REMOVE THE BACKLASH IN THE GONIOMETER. REMOVE SLEW FLAG AND IF PRESENT

C REMOVE INTERUP FLAG FROM I TRANS. THEN BRANCH TO NEXT ROUTINE ON

C THE LIFO STACK

C66 MODE! IUNIT.7) = 3

IZRST(IUNIT) = I lERROR = 1 CALL PCP( lUNIT.IERROR)

C

C IF INTRUP IS ON THE STACK REMOVE IT C

IF( ITRANSI lUNIT.l ).EQ. 12) CALL POP( lUNl T. I ERROR

)

GOTO 990

C

C CHECK FOR NORMAL SLEW COMPLETION

C 290

291

292

293

294

295

296

70 CALL ENSLEWC lUNIT.IERROR)

GO TO 990

C

C BEGIN MOVING 2— THETA AT A RATE OF RATE(IUNIT) DEGREES PER MINUTE

C80 CALL BGMGVEI lUNIT.NSTEP)

GO TO 990

30
297

298

299

300

301

302

303

304

305

306

307

306

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

C

C BEGIN COUNTING AT THE CURRENT ANGLE

C90 CALL BGCNT(IUMT)

GO TO 990

CC THE LAST DATA POINT HAS BEEN COLLECTED - CLEAN UP

C100 CALL FINIS! lUNIT)

60 TO 990

CC TRANSFER FILE

C110 CALL TRANS! lUNlT)

60 TO 990

CC OPTIMIZE COUNTING TIME FOR A SELECTED PEAK REGION

C

130 CALL ESTIM! lUMT.lERROR)

GOTO 990

C

C ENTER THE EVENT DETECTION SUBROUTINE AND MAIT FCR SOMETHING TO HAPPEN

C

900 CALL INTRUP! lUNIT)

C

C GET THE ADDRESS HE THE GO TO CODE) FROM THE LIFO TRANSFER TABLE

C CALLED ITRANS AND BRANCH WHEREVER IT SAYS

C990 I60T0 - ITRANS! lUNIT.l

IF! IDBUG! IUNIT)«NE«1)G0 TO 995

JPT = IPT! lUNIT)

WRITE! IPRTt 1234) I UN IT. I ACT! lUN IT) • ! ITRANS! IUNIT.3 ) . J=1 .10)

1 !MODE! lUNIT. J) .J=l .20) .JPT.NREC! lUNIT ) • MVCNT ! lUN IT)

2 CANG! lUNIT) (TANG! lUNlT ) t DANG ! 1 UNIT )• NSTEPt TI ME! lUNIT )

3 BKGTIM!1UNIT).1CNT!IUNIT. JPT)

1234 F0RMAT!1H . • UNI T» » • 1 1 # » IACT=*.I2.» ITRANS^ • • 1012 . • M0DE=».2012.

1 • IPT=*.I2.* NRECs* .I5/7X. • MVCNT=*.I1.» CANG=*#F7.3»

2 • TANG=**F7« 3. • DANG=* .F7. 3» • NSTEP=*.15#» T1ME=*#F6«2»

3 • BKGTIM=*#F6« 2. • CNT=*.I5)

995 GO TO! 10.20.30.40.50.60.70.80.90.100.110.900.130) .IGOTO

999 CALL EXIT

END

31
123

56

7

8

9

10

1112

13

14. IS

16

17

18

19

20

2122

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

50

5152

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74

C ^ SUBROUTINE ALOT ( I UN I T . I D. I S IZE

)

C.c

c

ccc

THIS SUBROUTINE ALLOCATES THE OUTPUT DATA FILE AND WRITES

THE FIRST FIVE RECORDS TO IT

C

C

IMPLICIT INTEGER+2 (I-N)

INTEGER44 NBS

COMMON /BUFF/ IALPH(66>*

COMMON /lO/ NBS*

1 I SPEC* IRD*

2 I0ISK(2*2>* IFIN*

COMMON /PROB/ I0AT(3>*

1 ITITLE(SO)

NAME! 15)

IDT* ICLOCK*

IPRT* ITYP*

IFOUT

IFLAG(2*10)* 1TIM(3)*

C DIMENSION XLEN(2)

DATA XLEN/*.128*. *.80 •/

DATA IDO/‘DO*/« IFO/'FO*/

CC STANDARD DEVICE ALLOCATION

C IDEV=IOO

RECL=XLENC1)

IF( ID. NE. IFOUT) GOTO 10

C OUTPUT DEVICE IS TO FLOPPY FO WITH RECORD LENGTH OF 80

IDEV=IFO

RECL=XLEN(2>

C

C DETERMINE THE NUMBER OF DIGITS IN ISIZE

C

10 IF( ISIZE. GT*9)G0 TO 100

C

C ALLOCATE A FILE OF LESS THAN 10 CYLINDERS

C ENCODE! I ALPH, 1000) (NAME! I ) * 1=1 *6) * I D. I DEV « I S 1 ZE*RECL

1000 FORMATI'AL • * 6 A 1 * • *

• *Z1 . A2 ,• .• * 1 1 * A4)

ISIZE = 19

GO TO 200

CC ALLOCATE A FILE OF GREATER THAN 9 CYLINDERS (BUT LESS THAN 1001)

C100 ENCODE! lALPH. 1010) !NAME! I ) . 1=1 .6) . ID* I DEV . I S I ZE »RECL

1010 FORMATI'AL • * 6A 1

.

•

. • * Z1 . A2 .

• *• * 1 2 . A4)

ISIZE = 20

C

C ALLOCATE IT

C200 CALL SYSTEM! I ALPH. ISIZE)

C

C IF THIS IS A FILE TRANSFER RUN SKIP TO END

C

IF! ID .EQ* IFOUT) GOTO 900

C

C WRITE THE FIRST 5 RECORDS

C WR ITE! ID* 1020) ! ITITLE! I ) .1 =1 .50) » ! IDAT! I) * 1=1 *3).

1 ! 1 TIM! I ), 1=1 .3) , IIFLAG! lUNIT* I )* 1 = 1* 10)

1020 FORMATI50A2.6I2* 1011)

C

c

C WHICH UNIT REQUESTED 7 C IFIIUNIT *EQ* 1) GOTO 300

CC SKIP THE FIRST 4 INSTRUMENT RECORDS WHICH BELONG TO UNIT 0 1 C DO 220 J=l*4

220 READ! I SPEC* 1030 ) ! I ALPH ! I ) * 1 = 1 . 64

)

C

32
75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

C READ THE INSTUMENT SPECIFICATION AND CALIBRATION FILE

C COPY TO OUTPUT FILE

C

300 00 400 J=lt4

READ! I SPEC* 1030) (lALPHl I ) .1 = 1 .64)

MRITE( ID. 1030) ( 1 ALPH( I ) • 1 = 1* 64

)

1030 F0RMAT(64A2)

400 CONTINUE

C

C REWIND SPECIFICATION FILE

C

REWIND ISPEC

C

900 RETURN

END

33
SUBROUTINE BGCNTIXUNIT)

123

4

5

6

78

9

.10

1112

13

14

15

16

17

18

19

20

2122

23

24

25

53

54

55

56

57

58

59

60

6162

63

64

65

66

67

68

69

70

7172

73

74

THIS SUBROUTINE STARTS THE COUNTER IN FIXED TIME/FIXEO COUNT MODE

THE CALLING ROUTINE MUST SET UP T1ME( ) AND LI MCNT{ ) THE INTERFACE WILL STOP COUNTING WHENEVER EITHER IS REACHED.

A MAX TIME OF 3270 SEC IS ASSUMED DUE TO 16 BIT WORD SIZE AND USE

OF A 0.1 SEC TIME BASE (6.5K IF TIME =0).

MAXIMUM OF 32700 COUNT LIMIT OCCURS DUE TO 16 BIT WORDSIZE

( 65K IF LIMCNT = 0)

MOOES OF ACTION BASED ON THE BGCNT STATUS FLAG!

MODE! 1UNIT.9) = 0 DO NOT POP THE TRANSFER ADDRESS STACK

THIS USED WHEN ANOTHER SUBROUTINE CALLS BGCNT

MQOE( IUNIT.9) = 1 POP THE BGCNT ADDRESS OFF OF THE STACK - THIS IS USED WHEN MAIN CALLS BGCNT.

IN ADDITION MODES 0 AND 1 WILL COUNT BASE ON

TIME IN TIME(IUNIT) OR THE VALUE IN KOUNTIIUNIT)

MODE! lUNIT. 9) = 2 POP THE STACK AND DO A FIXED TIME COUNT ON BACKGROUND

THE NUMBER OF SECONDS FOR THIS COUNT ARE FOUND

26 C IN BK6TIM NOT IN TIME.

27 C

28 IMPLICIT INTEGER42 (I-N)

29 INTEGER44 NBS.INTR . NBSADD. NBSSUB . ICNTL.ICP.KONT

30 c 31 COMMON /CNTL/ lACTC 2)

IDBUGI2)

INTR.

32 1 IRUN(2)» ITRANS(2.20 )

M00E(2.20)

MVCNTC 2)

33 c 34 COMMON /COUN/ ICNTI2. 16). IPTC2). IT0T(2).

35 1 LJMCNT(2). ISAVE(2)

36 c 37 COMMON /lO/ NBSf IDTt ICLOCK*

38 1 ISPEC. IRD* IPRT. ITYP.

39 2 IDISK(2t2). IFIN. IFOUT

40 c

41 COMMON /TIM/ BKGTIM(2)FIXERR(2)IPK(2)

42 1 NBG(2). NPK(2)TIMEC2). T1MLIM(2)

43 c 44 c 45 c* ***************

46 c 47 c SET THE FIRST 3 BITS OF . THE CONTROL WORD TO 101 IN ORDER

43 c TO ESTABLISH A TIME BASE OF 0.1 SECONDS.

49 c (THE FIRST 3 BITS = THE POWER OF TEN WHICH MUST BE DIVIDED

50 c INTO 104*6 TO GET THE DESIRED TIME BASE)

51 c 52 DATA ICNTL/X* A9F2* /

C

cc

cc

c

SET INTERFACE ADDRESS

NBSADD = lUNIT * 4

SET THE ACTIVITY FLAG AND TEST MODE

lACT(IUNIT) = 1 IF(M00E(IUNIT.9).EQ.0)G0 TO 200

POP FINIS ADDRESS OFF TRANSFER TABLE

I ERROR = 1 CALL POP( lUNlT. lERROR)

C

C

Cc

c200

THIS SECTION STARTS THE COUNTER IN FIXED TIME MODE TO

COUNT FOR THE NUMBER OF SECONDS STORED IN TIME(IUNIT)

OR IF MODE! lUNIT .9) = 2 THEN USE NUMBER OF SECONDS IN BK GT IM ( lUN IT

)

KONT = LIMCNT ( lUNITI

TM = TIME! lUNITI

IF( MODE! IUNIT.9) .NE.21G0 TO 300

34
75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

1 10

111

1 12

1 13

114

115

116

1 17

118

C

C THIS SECTION SETS UP FOR A BACKGROUND COUNT

C

TM = BKGTIHI lUNIT)

CC WE ARE NOta READY TO SET THE INTERFACE

C FIRST SELECT A NCN ZERO ADDRESS

C300 NBSSUB = NBSAOD * 1 INTR = ISTAT(NBStNBSSUB)

C

C NOW SELECT THE FIRST ZERO REGISTER

C INTR = ISTAT(NBStNBSADO)

C

C SEND THE CONTROL WORD

C CALL OUTBUS(NES.ICNTL)

C

C SET INTERFACE FOR THE NUMBER OF CLOCK PULSES DESIRED

C <BY PLACING THE NUMBER INTO THE SECOND ZERO REGISTER)

C ICP = IFIX2ITM 10. .5)

C MINIMUM TIME IS 0.1 SEC COUNT TIME

IF( ICP.LT. 1 ) ICP = 1 CALL OUTBUS(NeS.ICP)

c

C SET THE MAXIMUM NUMBER OF COUNTS INTO THE THIRD REGISTER

C ON THE INTERFACE

C NBSSUB = NBSAOD 3

INTR = I STAT( KBS* NBSSUB)

CALL OUTBUSINEStKONT)

CC RESET THE INTERFACE TO ZERO REGISTER

C INTR = ISTAT(NBS.NBSADO)

C

C START THE COUNTER

C CALL CCMAND(NBS.*S*

)

CALL CCMANDCNBS* • A*

)

999 RETURN

END
123

45

67

8

9

10

1112

13

1415

16

17

18

19

20

2122

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

€5

66

67

68

69

70

71

72

73

74

75

C SUBROUTINE BGMO VE ( I UNI T* NixEP

)

c ; c

C SUBROUTINE TO ST/iRT THE MOTOR MOVING NSTEPS

C IF NSTEPS IS NEGATIVE MOTION IS TOWARD LOW ANGLE

C IF NSTEPS IS POSITIVE MOTION IS TOWARD HIGH ANGLE

C

C IF lACT = 3 (IE SLEW) THEN MOTION WILL BE SET AT MAXIMUM RATE

C (IE 30 DEGREES PER MINUTE)

C

C IF I ACT < 3 THE RATE CODE STORED IN IRATE(IUNIT) WILL BE USED

C THE VARIABLE IRATE(IUNIT) IN COMMON/ANG/ IS USED TO STORE AN

C INTEGER RATE CODE = 30 . /R A TE( I UN I T

)

C

C note: BGMOVE does not have a mode flag ASSOCIATED WITH IT

C IN THAT IT ALWAYS POP'S THE ADDRESS STACK

C IMPLICIT INTEGER+2 (I-N)

INTEGER44 NBS» I NTR. NBSADD* NBSSUBt ICNTL.KRATE

C COMMON /ANG/ BANG( 2)

.

CANG(2). 0ANG(2).

1 EANG(2). IRATE(2)

PANG(2)# RATE! 2)#

2 TANG(2)t IZRST(2)

COMMON /CNTL/ IACT(2)

.

IDBUG(2)

.

INTR#

1 IRUN(2)t ITRANS(2.20 )

.

M0DE(2.20)MVCNT(2)

COMMON /lO/ NBS. IDT, ICLOCK#

1 I SPEC# IRO* IPRT. ITYP#

2 IDISK(2.2). IFIN. IFOUT

c

c

c 4 44 444 4* 44:4c 444 itc**^# :!!**  4 44 4 444*4 44*44444 444*4444 444 444444 444 44444

DATA lCNTLP/X'82FC'/» I CNTLN/X • 820C •

/

C

C SET THE ACTIVITY FLAG

C IF( IACT(IUNIT).NE.3)IACT( lUNIT) = 2

C

C POP BGMOVE ADDRESS OFF TRANSFER TABLE

C50 1 ERROR = 0

CALL PCP( lUNIT.IERROR)

C

C SET TIME EASE BASED ON RATE OF 30 OEG/MIN IF IN SLEW MODE

C IF( IACT< lUNIT ) .LT. 3) GOTO 80

KRATE = 1 GOTO 90

C

C SET TIME BASE FOR A RATE = RATE(IUNIT) SET UP BY CALLING ROUTINE

C INTO RATE CODE IRATE(IUNIT)

C80 KRATE = IRATE(IUNIT)

C

C ESTABLISH THE BUS ADDRESS OF THE INTERFACE DESIRED

C90 NBSADD = lUNIT * A C

C SET THE CONTROL WORD WITH A TIME BASE OF 0,01 SEC FOR POSITIVE

C (IE TOWARD HIGH ANGLE) MOTION

C

I F( NSTEP.lt. 0)G0 TO TOO

ICNTL = ICNTLP

GO TO 200

C

C SET THE SAME CONTROL WORD EXCEPT FOR NEGATIVE DIRECTION

C100 ICNTL = ICNTLN

NSTEP = -NSTEP

C

C SET THE INTERFACE ADDRESS TO NON ZERO

C200 NBSSUB = NBSADD 2 36
76

77

78

79

80

8182

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

r»nr>

r>nrt

nn

r>

nrvn

nnr>

non

INTR = ISTAT(^BS•NaSSUB)

NOW SET BACK TO THE FIRST ZERO ADDRESS

INTR = ISTAT( NBS.NBSADD)

LOAD THE CONTROL WORD INTO THE INTERFACE REGISTER • 1 ST ZERO*

CALL OLTBOS(NBS«1CNTL)

LOAD THE RATE CODE INTO THE INTERFACE REGISTER • 2ND ZERO*

CALL OUTBUSINBS.KRATEI

LOAD THE RATE CODE INTO THE INTERFACE REGISTER *ONE*

NBSSUB = NBSADD * 1 INTR = ISTAT< NBStNSSSUB)

KRATE=NSTEP

CALL OUTBUS(NEStKRATE)

RESET TO THE FIRST ZERO INTERFACE ADDRESS

INTR = I ST AT< NBS.NBSADD)

START THE MOTOR DRIVING

CALL CCMANO(NBS.*S*

CALL CCMANO(NBS.*A*

999 RETURN

END

37
12

34

5

6

7

8

9

10

1112

13

1415

16

17

18

19

20

2122

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

uuu

UUU

U

SJ

c SUBROUTINE 6GSUEM ( lUN IT

)

C

C THIS SUBROUTINE MOVES AT MAXIMUM RATE TO BANG

C CHECKING THAT COLLISSIONS WILL NOT OCCUR

C

C INITIALLY SETS TO 0.05 DEG. BELOW TARGET ANGLE

C AFTER COMPLETION, ENSLEW WILL DRIVE UP 0.05 TO REMOVE BACKLASH

IMPLICIT INTEGER42 ( I-N

)

INTEGER44 NBS, INTR

C COMMON /ANG/ BANG! 2)

.

CANG(2)

.

DANG(2 )

•

1 EANG(2),

2 TANG(2)t

IRATE(2)

•

IZRST(2)

PANG(2). RATE(2)«

COMMON /CNTL/ IACT(2)

.

I0BUG(2). INTR.

1 IRUN(2)t ITRANSI 2.20)

.

MODE(2,10)

.

MVCNT(2)

COMMON /lO/ NBS. IDT, I CLOCK.

1 ISPECf IRD. IPRT. ITYP.

2 I0ISK(2.2), IFIN. IFOUT

cc****************** **************************************** ***************

c

C POP SLEW ADDRESS OFF THE TRANSFER TABLE

C50 I ERROR = 1 CALL PCP( lUNIT. lERROR)

C

c

C DRIVE TO 10 STEPS (0.05 DEGREES) LOWER THAN THE TARGET ANGLE

C ENSLEW WILL MOVE UP THE LAST 10 STEPS TO REMOVE BACKLASH

C TANG( lUNIT) = TANG(IUNIT)-0.05

CHECK THE LEGALITY OF THE TARGET ANGLE

I ERROR = 0

CALL CKANG( lUNIT.NSTEP, lERROR)

IF( lERROR.EQ.O) GO TO 100

CANCEL RUN - CALL FINIS

MODE( lUNIT, 10) = 1 ITRANSdUNIT* 1) = 10

GO TO 999

SET ACTIVITY CODE FOR SLEWING

100 I ACT( lUNIT) s 3

C

C PUSH A DUMMY ADDRESS ONTO THE TRANSFER STACK TO BE POPED BY BGMOVE

C CALL PLSHC IUNIT.8)

CALL BGMOVE( lUNIT.NSTEP)

999 RETURN

END

38
SUBROUTINE CKANGI lUNITt NSTEP* lERROR)

123

4

5

6

7

8

9

10

1112

13

14

15

16

17

18

19

20

2122

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

C.

C.CC

c

c

c

c

c

c

c

THIS SU0RCUTINE CHECKS FOR THE LEGALITY OF A TARGET ANGLE ANO

COMPUTES THE NUMBER OF MOTER STEPS REQUIRED

IMPLICIT 1NTEGER42 ( I-N

I

INTEGER«4 NBStINTR

COMMON /ANG/ BANG! 2)

t

1 EANG(2)» IRATE(2)»

2 TANG(2)» IZRST(2)

CANG(2).

PANG(2)«

COMMON /CNTL/

1 IRUN(2)«

IACT(2)t I0BUG(2).

ITRANS(2«20 ) • MOOE<2t20).

COMMON /lO/ NBS.

1 ISPEC* IRQ*

2 I0ISK(2.2)t IFIN.

IDT.

IPRT.

IFOUT

DIMENSION ANGHI (2) «ANGL0(2)

DANG( 2).

RATE(2).

INTR.

MVCNT( 2> ICLOCK.

ITYP.

C*************************************************************************

C

Cc

c

c

cc

SET THE UPPER AND LOWER ANGLE LIMITS FOR THE DIFFRACTOMETERS

DATA ANGHI/155.0. 95.0/. ANGLO/2.94.2.94/

IF lERROR IS -1 SKIP THE COLLISION PROTECT SECTION - THIS IS AN INITIALIZATION CALL FROM SETANG

IF( IERROR.lt. 0)G0 TO 200

C

c

cc

c

cc

c200

COLLISSICN PROTECTION LOGIC GOES HERE WHEN WE HAVE FIGURED IT OUT

TARGET ANGLE WILL NOT CAUSE A COLLISION - CHECK IF IT IS WITHIN

LIMITS

IF(TANG( lUNlT).LT.ANGLO(lUNIT) .OR.TANGI lUNIT) .GT. ANGHI ( lUNITM

1 GOTO 900

C

C ANGLE IS CK - CHECK IF IT IS A MULTIPLE OF .005 ANO MAKE IT SO

C

TANG(IUNIT) = FIXANGC TANG(IUNIT) ) NSTEP = IFIX2< TANGUUNIT) * 200. .5 ) C

C IF CALL WAS FROM INIT RETURN NSTEP AS 200 TANG (WHICH IS CANG)

C

IF( lERROR. LT.OIGO TO 999

C

C IF ANY OTHER CALL RETURN NSTEP AS THE DIFFERENTIAL NUMBER

C OF STEPS NEEDED TO MOVE TO TANG

C NSTEP = NSTEP - IFl X2( CANG( lUN IT) 4200. 0.5)

C

c

C ALL CHECKS PASSED - RETURN

C lERROR = 0

GO TO 999

CC ERROR DETECTED

C

900 lERROR = 1 WRITE! ITYP, 1100 ) TANG( lUNIT) . I UNIT. ANGLO ( I UN IT) .ANGHI ( lUNIT)

1100 FORMAT! IHO •• TARGET ANGLE* « F8. 3 .

' FOR UNITW.I2.* IS OUTSIDE*.

1 * LIMITS OF*,F10.3,* AND*.F10.3)

999 RETURN

END

39
1z3

456

7

Q

9

10

1112

13

1415

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

3132

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

SUBROUTINE CCNSOLI lUNIT

)

C

CC THIS SUBROUTINE PROCESSES CONSOLE INTERRUPTS

C IMPLICIT INTEGER42 (I-N)

INTEGER44 NBSt INT8

COMMON /ANG/

1 EANG!2).

2 TANG!2),

BANG! 2)

IRATE!2) . IZRST(2)

CANG!2).

PANG! 2),

DANG! 2),

RATE!2),

COMMON /BUFF/ IALPH!66)NAME(IS)

COMMON /CNTL/

1 IRUN!2),

IACT!2)

ITRANS!2.20) . I0BUG!2)

M0DE!2 .20)

INTR.

MVCNT!2)

COMMON /lO/

1 ISPEC,

2 IDISK!2.2).

NBS..

IRO.

IFIN.

IDT. IPRT,

IFOUT

I CLOCK.

ITYP,

COMMON /PROB/

1 IT1TLE!50)

I0AT!3)

IFLAG! 2. 10) . ITIM!3),

COMMON /RNOT/ NRECI2)

NMFIL!2. 6) . ITR!2)

1 IENRN<2.4)

DIMENSION ITRUN(4»3)

DATA ITRUN/* IN* . • PO* « *QU* .

• SL • . • AC* ,* WO* . • AN* . * EW * .

* TV * # * ER*

1 *T * , • */

c

cc

c POP THE CONSOL ADDRESS OFF OF THE TRANSFER STACK

lERROR = 0

CALL PCP( lUNITtlERRORJ

CC WRITE TO THE CCNSCL CRT THE OPTION MENU

C10 WRITE! ITYP, 1000)

1000 FORMAT! 1H0#9X. *44 AUTO CONTROL 44*//

1 IH ,

• ENTER ONE OF THE FOLLOWING OPT

2 5X, *0 - STATUS'/

3 5X. * 1 - POWDER PATTERN COLLECTION*/

4 5X.*2 - QUANTITATIVE ANALYSIS*/

5 5X, *4 - SET 2-THETA*/

6 5X, *5 - SLEW TO 2-THETA*/

7 SX. *6 - TERMINATE RUN ON A UNIT*/

8 5X,»7 - PANIC STOP ON BOTH UNITS*/

9 5X. *C - LIST DISK CONTENTS*/

9 5X. *D - DEBUG*/

9 5X. *E - DELETE A FILE*/

8 5X,»F - TRANSFER FILE*

)

READ!

20 RO .1010 .ERR = 10)1C0DE

1010 F0RMAT!Z1)

C

C WAS A LEGAL CODE ENTERED?

C IF!ICODE.GE.O.AND.ICODE*LT«16)GO TO 30

22 WRITE(ITYP«1020) ICODE

1020 F0RMAT!1H »* ILLEGAL OPTION*, 12)

GO TO 10

C

C READ THE UNIT NUMBER IF NEEDED

C30 IF! ICODE. EQ« 13)G0 TO 35

IF! ICODE. LT.l .OR. ICODE. GT.6)G0 TO 60

35 WRITE! ITYP. 1030)

1030 FORMATCIH . *ENTER UNIT NUMBER !I1)*)

40
74

75

76

77

78

79

80

81

83

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

1 10

111

112

1 13

1 14

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

READ! 1RD.1032 ) lUNIT

1032 FORMAT(Il)

C

C WAS A LEGAL UNIT NUMBER ENTERED?

1F( lUN IT»EQ« 1 •OR. IUNIT»EQ» 2) 60 TO 50

WRITE! ITYP.1040) lUNIT

1040 FORMATdH . • UNIT* • . 1 2 .

* OOESNT EXIST'I

60 TO 10

C

C IF KILL UNIT* BRANCH DIRECTLY TO 200

C

50 IF< ICOOE.EQ.6) GOTO 200

C DEBUG FLAG OPTION CAN BE SET WHILE A UNIT IS ACTIVE. SKIP ACTIVE TEST

C IF( IC00E.EQ.13) GOTO 80

C

C IS THE UNIT REQUESTED FREE?

IF( IRUN( lUNITl.EQ.O. AND.I ACT! lUNIT) .EQ.OIGO TO 60

IF! lACT! lUNIT) .LT.OIGO TO 55

WRITE! ITYP.IOSO) lUNIT

1050 F0RMAT!1H . • UN 1 T* • » 1 2

» • IS ACTIVE*)

GO TO 10 C

C THE INTERFACE FOR THIS UNIT IS NOT OPERABLE

C55 IF! IC00E.EQ.4 )G0 TO 80

WRITE! ITYP»1055)IUNIT

1055 FORMAT! IHO. • INTERFACE FOR UNIT*. 12.* IS NOT WORKING*.

1 '-RESET 2-THETA*/)

GO TO 10

C

C GET DISK PACK CODE FOR OPTIONS C & E

60 IF! ICODE.NE. 12 .AND. 1C0DE.NE.14) GOTO 80

WRITE! ITYP.62)

62 FORMAT! IH .'ENTER DISK PACK CA2)*)

READ!IRD.64) IPACK

64 F0RMATIA2)

C

C NOW BRANCH TO SERVICE THE REQUEST MADE

C80 I CODE = ICOOE 1 C TRANSFERS TO LABEL 22 ARE RESERVED OPTIONS NOT CURRENTLY IMPLEMENTED

GOTO! 970.400. 300. 22.950 • 500. 20 0. 600. 22. 22. 22. 22.750.900.800.

* 700). ICOOE

C

C KILL THE JCB ON lUNIT AS FOLLOWS!

C FIRST CLEAR THE TRANSFER TABLE

C

200 IF! lACT! IUNIT).GT.O) GOTO 208

WR ITE! ITYP.202) lUNIT

202 FORMAT!lH .'UNIT **.12.' IS INACTIVE*)

GOTO 998

208 DO 210 1=1.10

210 ITRANS! lUNIT. I) = 0

C

C IS THIS A PANIC STOP OR AN "I'VE HAD ENOUGH" STOP

C WRITE! ITYP. 1060)

1060 FORMAT! IHO. 'ENTER 0 - PANIC STOP ! 2THETA WILL BE LOST)*.

1 /7X.'l - KILL JOB AFTER THE NEXT COMPLETION*)

READ! I RD. 1032) I CODE

C

C PANIC STOP OF lUNIT - TRACKING COUNTER WILL BE OFF BY 1 OR 2 STEPS

C MODE! lUNIT. 10) = 5

C CALL FINIS

ITRANS! lUNIT. 1)=I0

IF! ICOOE. EQ.O)GO TO 999

CC TO DO A SOFT ABORT WE WAIT FOR THE NEXT COMPLETION DETECTED BY INTUP

41
148

149

150

151

152

153

154

155

156

157

158

159

1 60

161

162

163

1 64

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

160

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

C AND THEN CALL FINIS IN NORMAL TERMINATION MODE

C MODE( lUNIT. 10 ) = 2 GO TO 998

C

C QUANTITATIVE ANALYSIS REQUESTED

C

C IF THIS REQUEST WAS AFTER A NEW SAMPLE MOUNT SAVE THE MODE FLAG

C300 IF(MODE< IUN1T,2).EQ.0)M0DE( IUNIT.2I = 1 ITRANSI lUNIT. 1) = 2 GO TO 999

C

C POWDER PATTERN COLLECTION REQUESTED

C400 MODE! IUNIT.3) = 1 ITRANSdUNIT* 1) = 3

GO TO 999

C

C ABSOLUTE SLEW REQUESTED - GET TARGET ANGLE

C

500 WRITE! ITYP. 1070) CANG(IUNIT)

1070 FORMAT! IH • 'CURRENT 2-THET A=» . F7« 3 # 5X . • ENTER TARGET 2-THETA

1 IF7.3)')

READ! IRD.1080)TANG!IUNIT)

1080 F0RMAT(F7.3)

C TRANSFER SEQUENCE! SLEW. INTRUP. ENSLEW. INTRUP

CC

c600

ITRIIUNIT) = 4

MODE! IUNIT.7) = 1 ITRANS! lUNIT, 1) = 6

ITRANS! 1UNIT.2) = 12

ITRANS! lUNlT, 3) = 7

ITRANS! IUNIT,4) = 12

GO TO 999 •

REQUEST MADE TO KI LL 30TH

1 CALL CLEAR!NBS, 0)

CALL CLEAR!NBSt

CALL EXIT

0)

UNITS AND RETURN TO SYSTEM

C

C FILE TRANSFER REQUESTED USE lUNIT =1 TEMPORARILY

C700 lUNIT = 1 CALL PUSH! IUNIT» 1 11 GO TO 999

C

C LIST TABLE OF CONTENTS ON LU5

C750 ENCODE! IALPH.756) IPACK

756 FORMAT! *LI5 ».A2)

CALL SYSTEM! I ALPH.6)

GOTO 998

C

C DELETE A FILE CURRENTLY ON DISK = I PACK

C 800 CALL FILNAM(3)

ENCODE! I ALPH* 1098) ! NAME! I ) • 1= 1 .6) . IPACK

1098 FORMAT! 'OE '.6A1.1H. .A2)

CALL SYSTEM! 1 ALPH, 12)

WRITE! ITYP, 10 99) ! NAME! I ) . 1 = 1 .6) .IPACK

1099 FORMATIIH .'FILE '.6Al,' ON .A2,' WAS DELETED*

C

C RETURN TO INTRUP

C GO TO 998

C

C RESET THE

C900 WRITE!

1100 FORMAT

1 SX.'O

DEBUG OUTPUT FLAGS

ITYP, 1100) lUNIT

!1H0. 'ENTER DEBUG FLAGS FOR UNIT#',

= OFF.l = ON, 2 = OPTIM')

12 .

42
221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

2 58

259

260

REA0( IR0.1032) I0BUG( lUNlT)

C

C RETURN TO INTRUP

C

GO TO 998

C

C RESET THE TRACKING COUNTER ON lUNIT

C950 WRITE! ITYPtll20)lUNIT

1120 FORMAT! IHOt 'ENTER CURRENT 2-THETA FOR UNITW'*I2)

READ!IRD.1080)CANG!IUNIT)

CALL SETANG!2UN1T)

GOTO 998

C

C TYPE STATUS OF THE 0 IFFRACTOMETES

C

970 J= 1TR!1)

K= ITR!2)

CALL DATE

C

WRITE! ITYP.12 20) 10 AT * I T 1 H, ! NMF IL! 1 . I) . I =1 .6 ) t !NMFIL!2 . I) «I=1 .6)

1 ! ITRUN! J. I ) . 1=1 .3) .IACT!1 ) »! ITRUN!K» I )t 1=1*3)« IACT!2I*

2 !1ENRN!1.I )tI=l»4)»!IENRN!2« I )»I=1«4)

3 tCANG

1220 FORMAT!/10X» STATUS * ON • . I 2

t

• . I 2

t

• / • t 12. • AT ••

1 12 . •

:

•

.

12 . • :

•

.

12//

1 15X , 'UNIT: • .6X . *1 • .8X. *2'//

2 IX. 'F ILE: • . 17X.6A1 .3X.6A1/

3 IX. ‘run:* .13X.2!3X.3A2.I2>/

4 lX.'TO END at: •3X.2!3X* 12t '/'• 12t 2Xt 12t ' :

* tI2)/

5 IX. • 2-THETA: • . 11X.2F9.3)

cC SET UP ITRANS FOR CALL TO INTRUP

C

998 CALL PUSH! IUNIT.12)

C

C ALL DONE - RETURN TO AUTO FOR BRANCH TO NEXT ROUTINE ON ITRANS STACK

C999 RETURN

END

43
123

45

6

7

8

9

10

1112

13

14

15

16

17

18

1920

2122

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

50

5152

53

54

55

56

57

58

59

60

6162

63

64

65

66

67

68

69

70

7172

73

74

SUBROUTINE DATE

C

C.c

c

c

cc

c

c

c

c

THIS SUBROUTINE READS THE DATE AND TIME FROM CLOCK

( DEVICE 6D UNIT = IDT ) AND STORES THEM IN ARRAYS IDATE AND

IF DATE IDAT !1

INPUT THE DATE AND

IS EQUAL TO 00

TIME • TESTS

REQUESTS FROM THE USER TO

THAT YEAR STARTS WITH 8

IMPLICIT INTEGER42 ( I-N

INTEGER44 NBS

COMMON /BUFF/ I ALPH(66)t NAME! 15)

COMMON /lO/

1 ISPEC.

2 IDISK!2.^).

NBS.

IRD. IFIN.

IDT.

IPRT.

IFOUT

ICLOCK.

ITYP.

COMMON /PROS/

1 ITITLE(50)

I0AT(3)IFLAG(2.10)ITIM(3).

ITIM

Cc*************************************************************************

c

C NTRY IS ATTEMPT TO SOLVE OUR DATE-TIME CLOCK READING PROBLEM

C NTRY=0

CC READ DATE AND TI^^ FROM CLOCK

C200 READ! IDT. 201 .END=230»ERR=240> lOAT.ITIM

201 F0RMATI3I2.2X .312)

ICODE=0

IF( ICATdl .GE. 80 ) GOTO 999

GOTO 250

230 I CODE = 1 GOTO 250

240 ICODE = 2

C

C CLOCK IS NOT SET

C250 WRITE! ITYP. 251) ICODE. IDT

251 FORMAT! IHO. 'CLOCK NOT SET- I CODE= • . I 2. • LUf=*.12)

NTRY=NTRY+1

IF(NTRY.EQ.l) GOTO 200

GO TO 310

C

C ILLEGAL DATE/TIME FORMAT. TRY AGAIN

C300 WRITE! ITYP. 301)

301 FORMAT! IHO. • ILLEGAL DATETIME*)

C

C READ DATE AND TIME

C310 WRITE! ITYP. 31 1)

311 FORMAT! IHO. • INPUT DATE AND TIME AS*

1 . IX, • YYMMODHHMMSS*

READ! IRD. 321. ERR=300) IDAT.ITIM

321 F0RMAT!6A2)

C

C WAS IT A LEGAL ENTRY?

C CHECK THAT YEAR STARTS WITH B ,*** CHANGE TO 9 IN 19907?

C IF! IDAT! 1

• LT. •80' • OR*

1 ICAT! 2) • GT. • 12* • OR*

2 IDAT! 3) • GT. •31 • • OR.

3 ITIMil• GT. •24* • OR.

4 ITIM! 2) • GT. • 60* ) GOTO 300

C

C LEGAL - SET CLOCK VIA THE SYSTEM COMMAND 'SC*

C

ENCODE ! I ALPH.33 1 ) IDAT.ITIM

331 FORMAT! 'SC • . 3A2 . 3

!

' .

* . A2 )

CALL SYSTEM! I ALPH, 18)

C

44
75 C BRANCH TO READ OF DATE AND

76 C

77 GO TO 200

78 999 RETURN

79 END

45
SUBROUTINE ENOCNT ( I UN I T t I ERROR

)

1Z

3

45

6

7

8

9

10

1112

13

14

15

16

17

18

19

20

40

4142

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

•58 59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74

THIS SUBROUTINE READS THE COUNTER FROM EITHER FIXED TIME

OR FIXED COUNT MODE

IN EITHER FIXED TIME OR FIXED COUNT MODE OR DUAL MODE THE DATA IS

STORED AS follows;

TIME COMPLETION STORE COUNTS () IN I CNT ( IPT ( lUNIT)

)

COUNT COMPLETION STORE TIME AS A NEGATIVE « IN ICNT< IPTf lUNITl

>

THERE ARE TWO MODES OF ACTION BASED ON THE ENOCNT STATUS FLAG;

MODE! I UNIT# 6) = 0 WAIT FOR THE SUBROUTINE TO COMPLETE BEFORE CHECKING IT THIS IS FOR CASES WHEN ENDCNT IS CALLED BY ANOTHER

SUBROUTINE#

MODE! IUNIT.6) = 1 PROCEED DIRECTLY TO CHECK IF NORMAL COUNT COMPLETION

CCCURED. THIS IS FOR THE CASE WHEN THE COMPLETION

WAS DETECTED BY SUBROUTINE INTRUP AND THE STATUS

21 C FLAG IS ALREADY IN COMMON AS INTR

22 C 23 IMPLICIT INTEGER42 ( I-N

)

24 INTEGER44 NBS. I NTRt NBSADD. NBSSUB*MASKA«MASKC .MASKD#

25 1 ITM#KCNT . 26 c 27 COMMON /ANG/ BANG! 2)

•

CANG(2). DANG(2)#

28 1 EANG(2)# IRATE(2)# PANG(2). RATE(2).

29 2 TANG(2)# IZRSTI2)

30 c

31 COMMON /CNTL/ IACT(2)

.

IDBUGI 2)

.

INTR.

32 1 1RUN(2># ITRANSI 2.20)

.

MODE(2.20)

.

MVCNTI2)

33 c 34 COMMON /COUN/ ICNT(2.16). IPTC2)

.

IT0T(2).

35 1 LIMCNT(2). ISAVE(2)

36 c 37 COMMON /lO/ NBS# IDT# ICLOCK#

38 1 I SPEC# IRD# IPRT. ITYP#

39 2 IDISK(2«2)# IFIN. IFOUT

DATA MASKA/X* 08 •/. M ASKC/X • 000 1• / . MASKO/X • 1000 »/

Cc

c CALCULATE THE ADDRESS OF THE SELECTED INTERFACE

NBSADD = lUNIT 4 4

SET THE ACTIVITY FLAG AND TEST MODE

lERROR = 0

IF(MODE(IUNIT,6)#NE.O)GO TO 200

C

C GO INTO A WAIT LOOP CHECKING INTERFACE FOR COMPLETION

C100 INTR = ISTAT(NBStNBSADO)

IF( IAND( INTR.MASKA) .NE.MASKA) GO TO 100

C

C READ THE STATUS OF THE INTERFACE

C200 INTR = INBUS(NBS)

C

C TEST IF A PRESET TIME COMPLETION CCCURED

C IF( IAND( INTR.MASKC) .EQ.OIGO TO 240

ICMPL = 1 GO TO 300

C

C IT DIDN'T SO SEE IF A MAXIMUM COUNT COMPLETION OCCURED

C240 IF( IANO< INTR.MASKD) #EQ#01G0 TO 260

ICMPL = 2 GO TO 300

C

C ERROR - NEITHER TIME NOR COUNTS COMPLETED

46
75

76

77

78

79

60

81

88

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

1 10

111

112

113

1 14

115

1 16

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

C

260 WRITE- ITYP.lOlO) lUNIT* I NTR«CANG( lUNIT)

1010 FORMATC 1H0« 'ENDCNT ERROR UNITK'.II.' STATUS^* #Z4. • 2-THETA=» ,F7 .3

)

C

C IF FIRST ERROR TRY TO RECOVER BY STARTING COUNT CYCLE AGAIN

C

IF(MCDE( IUNIT*6)»NE.1) GOTO 900

C

C THE COUNTER MUST BE ZEROED

C NBSSUB = NBSAOO 3

CALL CLEAR! NBSt NBSSUB)

C MODE! IUNIT»9) = 0

CALL BGCNT! lUNIT)

MODE! IUNIT«6) = 0

GOTO 100

GO TO 900

C

C READ THE INTERFACE

C300 NBSSUB = NBSADO * 3

C

C READ THE COUNT TIME FROM INTERFACE REGISTER • 2ND ZERO*

C INTR = ISTAT!NBS*NBSADD)

ITM = INBUS!NBS)

C

C READ THE COUNTS FROM INTERFACE REGISTER 'THREE*

C INTR = ISTAT! NBS.NBSSUB)

KONT = INBUS!NBS)

C

C THIS SECTION READS AND CHECKS THE RESULTS

C500 JPT = IPT!IUNIT)

GO TO!610t520)«lCMPL

CC TIME CCMPLETICN CCCUREO - SAVE THE COUNTS

C510 ICNT! IUNIT» JPT) = KONT

GO TO 999

CC MAX COUNT COMPLETION OCCURED - STORE THE TIME

C AS -0 OF O.ISECONDS REQUIRED TO REACH L IMCNT ! I UNIT)

520 ICNT! lUNIT. JPT) =-ITM

GO TO 999

C

C AN INTERFACE ERROR HAS OCCURED - CALL FINIS IN MODE 5 TO

’

C CLEAR THE RUN PARAMETERS AND RESET THE INTERFACE

900 MODE! lUNIT. 10) a 5

CALL FINIS!1UNIT)

lERROR a 1 999 RETURN

END

47
SUBROUTINE EN MOVE ( lUNIT . I ERROR

)

SUBROUTINE END MOVE TO CHECK THAT A MOVE COMPLETED NORMALLY

6 C ENSURES TFAT THE TRACKING COUNTER = TARGET ANGLE !TANG)

7 c RESETS CURRENT ANGLE !CANG) TO THE TARGET ANGLE

8 c CLEARS THE ACTIVITY FLAG

9 c 10 c

11 c MODES OF ACTICN BASED ON THE ENMOVE STATUS FLAG •• 12 c 13 c MODE! IUNIT.8) = O WAIT FOR THE SUBROUTINE TO COMPLETE BEFORE CHECKING IT

14 c THIS IS FOR CASES WHEN ENMOVE IS CALLED BY ANOTHER

15 c SUBROUTINE.

16 c MODE! IUNIT.8) = 1 PROCEED DIRECTLY TO CHECK IF NORMAL MOVE COMPLETION

17 c OCCURED. THIS IS FOR THE CASE WHEN THE COMPLETION

18 c WAS DETECTED BY SUBROUTINE INTRUP AND THE STATUS

19 c FLAG IS ALREADY IN COMMON AS INTR.

20 c 21 c 22 IMPLICIT INTEGER*2 ! I-N

)

23 INTEGER+4 NBS .INTR. NBSADD .NBSSUB •MASKA.MASKB •MASKC.MASKD.MASKE

24 c 25 COMMON /ANG/ BANG! 2). CANG!2). DANG! 2)

.

26 1 EANG!2). IRATEI2) . PANG!2). RATE! 2).

27 2 TANG!2). IZRST!2)

28 c 29 COMMON /CNTL/ lACT! 2). I0BUGI2). INTR. 30 1 IRUN!2). ITRANS!2.20 ) . MODE!2«20)

.

MVCNT!2)

31 c 32 COMMON /COUN/ ICNT! 2. 16)

.

IPT!2>IT0T!2).

33 1 LIMCNTI2). ISAVE!2)

34 c 35 COMMON /lO/ NBS. IDT. ICLOCK.

36 1 I SPEC. IRD. IPRT, ITYP.

37 2 IDISK!2.2). IFIN. IFOUT

38 c 39 C^i**m******************m********************************************:ti**-**ilt

40 DATA MASKA/X* Ca*/. MASKB/X*20*/. MASKC/X* 10 • /. MASK0/X'08*/

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

6162

63

64

65

66

67

68

69

70

7172

73

74

75

DATA MASKE/X*80*/

I ERROR = O SET UP THE INTERFACE ADDRESS

NBSADD = lUNIT 4

CLEAR THE ACTIVITY FLAG AND TEST MODE

IF(MODE( IUN1T.8).EQ.1)60 TO 200

C

Cc

c

c

c50

c

C GO INTO A WAIT LOOP CHECKING INTERFACE FOR COMPLETION

C100 INTR = ISTAT(NBStNBSADD)

IF( lANDC INTR,MASKA).NE.MASKA)GO TO 100

CC INTERFACE HAS COMPLETED CHECK IF ALL WENT WELL

C

C FIRST CHECK THAT THE BUS IS NO LONGER BUSY

C200 IF( IAND( INTR.MASKS) .NE.MASKB) GO TO 220

C

C ERROR HAS BEEN DETECTED - BUS IS NOT BUSY AND INTERFACE

C HAS NOT CCMPLETEOI

C WRITE! ITYP, 1000) I UNIT. INTR

1000 FORMAT! IHO » 'ENMOVE ERROR UNIT W'.Il.* INTERFACE IS BUSY*

1 • STATUS=*24* ABORT*)

GO TO 900

CC READ THE 16 BIT INTERFACE STSTUS WORD

C220 INTR = INBUSINBS)

C

C CHECK THAT THE CORRECT NUMBER OF STEPS COMPLETED

48
76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

1 10

1 11 112

113

1 14

115

1 16

117

1 18

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

1 40

141

142

143

144

145

146

147

148

149

150

C

IF( IAN0( INTR»MASKC)«EQ.HASKC)GO TO 300

C

C THE REQUESTED NUMBER OF STEPS WERE NOT MOVED

C CHECK IF THE LOW ANGLE LIMIT SWITCH WAS HIT (IE BIT 12=1)

C

1F( IANO( INTR.MASKD)*NE.MASKO)GO TO 240

C

C LIMIT SWITCH HIT - KILL RUN

C230 WRITE! ITYP«1010)IUNIT«INTR

1010 FORMATdH .'LIMIT SWITCH. UNIT »'.I1.' STATUS* '. Z4 . • ABORT*)

GO TO 900

C

C CHECK IF HIGH ANGLE LIMIT SWITCH WAS HIT (IE BIT 8=1)

C

240 IF( 1AN0( INTR.MASKE) .NE.MASKE)GO TO 260

C

C HIGH ANGLE LIMIT WAS HIT - ABORT!

C

GO TO 230

C

C PROBLEM IS NOT WITH LIMIT SWITCHS - IT MUST BE ELVES!

C

260 WRITE! ITYP. 1020)IUNIT»INTR

1020 FORMAT! IHO. 'ENMOVE ERROR. UNIT »',I1,' STATUS '.Z4.' ABORT')

GO TO 900

C

C ALL WENT WELL WITH THE MOVE SO FAR. SO LASTLY CHECK THE

C TRACKING COUNTER TO SEE IF IT EQUALS TANG4200

C300 NBSSUB = NBSAOO 2 INTR = ISTAT! NBS. NBSSUB)

C

C READ THE TRACKING COUNTER

C

INTR = INBUSINBS)

ITEMP = IFIX2!200. TANG(IUNIT) + 0.5)

C STORE INTEGER44 TO INTEGER42 AND TEST

IT = INTR

IF! IT.NE.ITEMP)GO TO 320

C

C NORMAL COMPLETION

C

CANG(IUNIT) = TANG(IUNIT)

C

C READ COUNTS AND CLEAR THE COUNTER REGISTER

C NBSSUB = NBSSUB 1 INTR = ISTAT! NBS. NBSSUB)

C DO WE READ COUNTS AND SAVE THEM IN I CNT! IPT! lUNI T) )7 IF! ISAVE! lUNIT) .EQ.O) GOTO 310

JPT = IPT! lUNIT)

1F!JPT.LT. 1 .OR. JPT.GT.16) JPT = 1 INTR = INBUS(NBS)

ICNT(IUNIT.JPT) = INTR

ISAVE! lUNIT) = 0

310 CALL CLEAR! NBS.NBSSUB)

C

C RESET ACTIVITY CODE AND RETURN

C

lACTIIUNIT) = 0 GOTO 999

C

C TRACKING COUNTER AND TARGET ANGLE DO NOT AGREE - ABORT!

C320 WRITE! ITYP,1030)IUNIT.INTR,TANG!IUNIT)

1030 FORMAT! IHO, 'ENMOVE TRACKING COUNTER .NE. TARGET ANGLE'

1 IH ,'UNIT «' .1 1 , 1 10.F10.3. ' ABORT')

C

C ABNORMAL TERMINATION SECTION

C SET FINIS MODE FLAG TO 5 AND CALL FINIS

C900 MODE! lUNIT.lO) = 5

CALL FINIS! lUNIT)

49
151 1 ERROR 1 152 C 15 j C ENMOVE IS DONE - RETURN TO CALLING PROGRAM

154 C

155 999 RETURN

156 END

50
12

3

4

5

6

78

9

10

1112

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

eo

61

62

63

64

65

66

67

68

69

70

7172

73

74

C.

C.c

cc

cc

c

cc

c

cc

c

c

c

c

c

c

c

c

c

c

SUBROUTINE ENSLEhK 1 UNI T • I ERROR

)

THIS SUBROUTINE CHECKS THAT A SLEW COMMAND PROPERLY TERMINATED

MODES OR operation:

MODE! IUNIT.7)

MODE! IUNITt7)

MODE! IUNIT*7)

MODE! lUNITf 7)

0 - ENSLEW WAS CALLED BY ANOTHER SUBROUTINE AND

IS To WAIT FOR SLEW COMPLETION

1 - ENSLEW WAS CALLED FROM MAIN VIA INTRUP SO

THAT COMPLETION HAS ALREADY OCCURED.

2 - ENSLEW WAS CALLED FROM ANOTHER SUBROUTINE • WITHOUT PREVIOUS SLEW MOTION.

DO NOT WAIT FOR COMPLETION.

3 -CALLED FROM AUTO(MAIN». POP THE ITRANS TABLE

NO PREVIOUS SLEW WAS NECESSARY

SKIP TEST FOR COMPLETION

IMPLICIT INTEGER42 ( I-N

)

INTEGER44 NBS. INTR. NBSADD. MASK

COMMON /ANG/ BANG(2). CANG(2). DANG(2).

1 EANG(2).

2 TANG<2).

IRATE(2)

IZRSTI2)

PANG(2)» RATE(2)«

COMMON /CNTL/

1 1RUN(2).

IACT(2)

ITRANS(2«20 )

IDBUG(2)

HQDE(2.20)

INTR.

MVCNTC2)

COMMON /lO/

1 I SPEC.

2 IDISK(2.2).

NBS.

IRO.

IFIN.

IDT.

IPRT.

I FOOT

I CLOCK.

ITYP.

COMMON /RNOT/ NREC(2)

NMFIL(2.6)

1TR(2)

1 IENRN(2.4)

C**************** ********************************  :¥** *************ikHi***

DATA MASK/X*C8»/

CC CHECK MODE OF SUEPOUTINE CALL

C

IF( MODE( IUNIT.7) .EQ.OGO TO 100

IF(MODE( 1UNIT,7).EQ. 2) GOTO 300

C

C ENSLEW WAS CALLED FROM MAIN - POP ITS ADDRESS FROM TRANSFER TABLE

lERROR = O

CALL POP( lUNIT. lERROR)

IF(M0DE(IUNIT.7).EQ.3) GOTO 300

GO TO 200

C

C AWAIT COMPLETION OF SLEW MOTION

C100 NBSADD = lUNlT * 4

150 INTR = 1ST ATINBS. NBSADD)

IF( IANO( INTR.MASK) .NE.MASKIGO TO 150

C

C UNIT HAS CCMPLETEO CHECK THAT TARGET ANGLE = TRACKING COUNTER

C AND RESET CURRENT ANGLE AND TURN OFF SLEW FLAG

C200 MODE! IUNIT.8) a l CALL ENMOVEI ILNIT. lERROR)

IF( lERROR.EQ. 1)G0 TO 999

C

C NOW WE MUST MOVE UP THE LAST 10 STEPS TO GET TO BANG AND

C REMOVE THE GEAR LASH

C FIRST PUT A DUMMY ADDRESS ON THE TRANSFER STACK TO BE

C POPED EY BGMOVE. THEN ISSUE AN ABSOLUTE CALL TO BGMOVE TO

C RETURN HERE (IE NOT USING TRANSFER STACK).

C

300 TANG(IUNIT) = CANG(IUNIT) O.OS

I ACT{ lUNIT) = 3

CALL PUSH( lUNIT.lO)

CALL BGMOVE( lUNIT. 10)

51
NOW ISSUE A CALL TO END MOVE IN MODE 0 WHiLH MEANS WAIT UNTIL

MOVE IS COMPLETED 8EPOR RETURNIG

75

76

77

78

79

80

81

82

83

84

85

86

C

C

C

c MODE! IUNIT.8) = 0

CALL ENMOVEI lUNIT.IERRORI

IF( lERROR.EOo DGO TO 999

C IF ITR = 4 tSET FLAG ITR = I ( UNIT

C

IF( ITR< lUNIT) .EQ. 4) ITR(IUNIT)

999 RETURN

END

INACTIVE )

1

52
SUBROUTINE ENTI M ( I UNlTt RUN

)

1a3

4

5

6

7

8

9

10

1112

13

14

15

16

17

18

19

20

2122

23

24

43

44

THIS ROUTINE ADDS THE ESTIMATED RUN TIME TO THE PRESENT TIME

AND CALCULATES THE DATE AND TIME THAT THE JOB WILL BE COMPLETED

THE RESULT IS STORED IN THE ARRAY lENRN AS MONTH DAY HOURS & MIN

IMPLICIT INTEC-ER+2 U-N»

COMMON /PROS/

1 ITITLE(50»

IDAT(3)

COMMON /RNDT/ NRECI2).

1 1ENRN(2«4)

IFLAG<2*10)

NMFIL(2*6)

ITIM(3).

ITR<2)

C

C GET THE DATE AND TIME

C TO GET DATE INFOBMATICN ON THE ARRAY NAME

CALL DATE

25 IDAY = IDAT(3)

26 IMON = IDAT(2)

27 C

28 C CONVERT RUN TIME TO HRS AND

29 c 30 IHR = IFIX2IRUN)

31 IMN = 60*(RUN-IHR)

32 c 33 c ADO THE HRS AND MIN TO THE ( 34 c 35 IMN = ITIM(2) * IMN 36 IF( IMN .LT* 60) GOTO 100

37 IHR = IHR + 1 38 IMN = IMN - 60

39 c 40 c NEXT HOURS

41 c 42 100 IHR = ITIM(l) + IHR

IF (IHR .LT. 24) GOTO 200

IDAY = IDAY + 1 45 IHR = IHR -24

46 C

47 C STORE INTO END RUN ARRAY

48 C

49 200 lENRNI IUN1T.4) 3 IMN

50 IENRN< IUNIT«3) = IHR

51 lENRNI IUNIT.2) = IDAY

52 IENRN< IUNIT»1

)

= IMON

53 RETURN

54 END

I

I

53
1z3

4

5

6

7

8

910

1112

13

1415

16

17

le19

20

2122

23

24

25

26

27

28

29

30

3132

33

34

35

36

37

38

39

40

414^

43

44

45

46

47

48

49

50

5152

53

54

55

56

57

58

59

60

6162

63

64

65

66

67

68

69

70

7172

73

74

on

Mono

*-nonn

non

C. SUBROUTINE ESTI I UN IT , lERROR

C

cC THIS SUBROUTINE MAKES A RAPID ESTIMATE OF THE PEAK AND BACKGROUND

C INTENSITIES CF A LINE SO THAT THE PEAK AND BACKGROUND COUNT TIMES

C CAN BE OPTIMIZED BY SUBROUTINE OPTIM

C IMPLICIT INTEGER42 (I-N)

INTEGER44 NBS» INTR

C COMMON /ANG/ BANG! 2)

CANGI2)DANGI 2 )

1 EANG(2), IRATEI2)

PANGI2). RATEI 2 ). 2 TANG(2). IZRST(2). NPTPKI2)

V COMMON /CNTL/ 1ACT(2). ID3UGI2)

INTR,

/*• 1 IRUN(2)* ITRANSC 2. »0 ) . M0DEI2 ,20) , MVCNTI2)

COMMON /COUN/ ICNTI 2,16)

IPTI2)IT0TI2),

1 LIMCNT<2), ISAVEI2)

V COMMON /lO/ NBS. IDT. ICLOCK.

1 I SPEC. IRD, IPRT, ITYP,

2 I0ISK(2»2), IFIN. IFOUT

COMMON /aUAN/ CONC, FREL, lOVLP,

1 KOOEs LOOP I 2)LPKI2)NUMI2 .20)

2 SIGSTD. STD, STDREL

COMMON /TIM/ BKGTIMI2)

F1XERRI2)

IPKI2)

1 NBG(2). NPKI2) TIMEI2). TIMLIMI2)

C^ic 4444**4444 Italic 1)1444444444 44444 444 4444 44 4 4*44 W**#^*:)^*^**

C MODE! lUNIT, 13) = 0 FIRST ENTRY*

< 2THETA MUST BE AT BANG!

c = 1 LOW BKG COUNT COMPLETED

c = 2 SLEW TO PANG OR EANG COMPLETEDI ISTOP=0)

c

c SLEW BACK TO BANG COMPLETED I 1ST0P=1

c = 3 PEAK COUNT COMPLETED

C

CC POP ESTIM ADDRESS OFF THE TRANSFER TABLE

C IERROR=l

CALL POP( lUNIT, lERROR)

BRANCH DEPENDING ON MODE! lUN I T , I 3

IGO = MODE! IUNIT.13) + I GOTO ( 10.50,260.270) «IGQ

IF NO BACKGROUND POINTS ARE TO BE MEASURED SET ICNTI ,11=0 AND

SKIP TO PEAK ESTIMATION

IF<NBG( IUNIT).NE.O) GOTO 20

ICNTI lUNIT. 1 ) =0 lGO=2

GOTO 200

WE ARE NOW AT THE LOW ANGLE BACKGROUND - COUNT FOR ONE SECOND

TIME(IUNIT) = 1,0

MODE! lUNIT ,9) = O

CALL BGCNT(IUNIT)

CALL INTRUP TO AWAIT COMPLETION THEN RETURN TO ESTIM VIA LIFO STACK

C GOTO 990

C

C STORE THE 8ACKGRCUND COUNT INTO I CNT ( I UN I T , 1 )

54
75

76

77

78

79

80

8182

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

lOO

101

102

103

104

105

106

107

108

109

110

111

112

1 13

114

115

1 16

117

1 18

119

120

121

122

123

124

125

126

127

128

129

130

1 31 132

133

1 34

1 35

136

137

138

139

140

141 142

143

144

145

146

147

148

1 C50 IPT(IUNIT) =

C

C CALL END COUNT FOLLOWING THE COMPLETION

C MODE< IUN1T.6) = 1 CALL ENDCNTC lUNIT. lERROR)

IF( lERROR.EQ. 1 ) GO TO 999

CC CHECK THE BACKGROUND FOR OVERFLOW AND ZERO

C IF( ICNTdUNIT tl ) >100.150.200

CC MAX COUNTS OCCURED - 1 CNT( lUN 1 T . 1 ) = - 10 . O+SECONDS

C100 ICNTdUNIT. 1) = IFIX2(LIMCNT( lUNIT>/(-ICNT( lUNIT. 1 )/10)+0.5)

60 TO 200 ' » CC DEFAULT BACKGROUND TO 1 CPS

150 ICNTdUNIT. 1) = 1 C SET ICNT ARRAY POINTER

200 IPTdUNIT) =2

C WHICH DATA COLLECTION MODE? PEAK HEIGHT OR INTEGRATED SCAN

IFCIPKdUNIT) .EQ. 0) 60 ' TO 220

C PEAK HEIGHT - SET TARGET ANGLE TO THE PEAK ANGLE

TANG(IUNIT) = PANGCIUNIT)

GOTO 240

C SCAN MODE - RAPIDLY INTEGRATE ENTIRE PEAK AREA

220 TANG( IUNIT)=EAN6( lUNlT)

C INDICATE THAT COUNTS FROM SCAN ARE TO BE SAVED

ISAVEI lUNIT) = 1 CC NEXT MOVE TO THE TARGET -ANGLE AT SLEW RATE

C FIRST PUSH A DUMMY ONTO THE LIFO STACK FOR POPING BY BGMOVE

C SECOND CHECK FOR VALID TARGET ANGLE. THEN INITIATE MOVE

C240 CALL PUSH! IUN1T.8)

CALL CKANGdUNI T.NSTEP. lERROR)

IF< lERROR.EQ. 1) GOTO 999

I ACT( lUNIT ) = 3

CALL BGMOVEdUN IT.NSTEP)

GOTO 990

CC DRIVE COMPLETED

C260 MODE! IUNIT.8) = 1 CALL ENMOVEI lUNIT. lERROR)

I ACT( lUNIT) =0

IFdERROR.EQ. 1 .OR. ISTOP.EQ.DGO TO 999

C IF SCAN MODE THEN THE COUNTS ARE SAVED IN ICNTdUNIT. 2) BY ENMOVE

IFdPKdUNIT) .EQ.O ) 60T0 280

C

C BEGIN A 1 SECOND COUNT AT THE PEAK

C IPTdUNIT) = 2 CALL 3GCNT( lUNIT)

GOTO 990

C . C PEAK COUNT COMPLETION

C270 MODE! lUNIT. 6) = 1 CALL ENDCNTI lUNIT.IERROR)

1F( lERROR. EQ« I ) GO TO 999

CC CHECK THE PEAK INTENSITY

C280 IFdCNTdUNlT, 2) )300 .350.400

C

C MAX COUNT COMPLETION OCCURED

C300 ICNTdUNIT. 2) = IF I X2{ L I MC NT( 1 UNI T ) /( - 1 CNTd UN IT. 2 ) /I 0 ) +0 . 5 ) GO TO 400

C

55
149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

C DEFAULT INTENSITY TO 1 ^ C350 ICNTI IUNIT,2 ) = 1 GOTO 500

C

C IF WE ARE IN PEAK COUNT MODE GO STRAIGHT TO THE TIME

C OPTIMIZING ROUTINE

C400 IF( IPKI lUNIT) .EQ. 1 )G0 TO 500

CC WE ARE IN INTEGRATE COUNT MODE* COMPUTE THE AVERAGE CPS

C DELTM=60.0*<EANG( I UN IT ) -BA KlG< lUNITl ) /( R ATE( I UNI T) ) ICNTI IUNIT,2) = FL0AT2I ICNT(IUNIT,2))/DELTM + 0.5

CC NOW OPTIMIZE THE PEAK AND BACKGROUND COUNT TIMES

C500 CALL OPTIM(IUNIT)

CC DEBUG PRINT OUT IF IDBUGI )=2

C IF( IDBUGI lUNl T) .NE.2j GOTO 520

WRITE I ITYP.51 0) ICNTI UNIT, 1 ) , ICNT I lUN IT, 2 > , F IXERR I lUNIT) , 1 TIMLIMI IUNIT),NPTPKIIUNIT),N0GI lUNITl.TIMEI lUN IT ) . BK GT IM I lUNIT)

510 FORMATI 1H0« ‘OPTIM RESULTS; • » 2 I 7 , 2F6. 2, 2 1 5, 2F6* 2

C

C SET TIMEI ) AND BKGTIMI )' AS REQUIRED BY INTERFACE AND DATA COLLECTION

C METHOD

C520 TIMEIIUNIT) = F I XT I M I T I ME I lUN I T ) , MVCNT I lUNI T )

)

BKGTI MI UNIT) = F I XTI MI BKG TI M I I UNI T ) , MVCNTI I UNI T) ) I FI IDBUGI lUNIT) .EQ.2) WR I TEI I T YP, 530 ) T I MEI IUNIT),BKGT IMI UNIT)

530 FORMATIIH , *PK & 8G TI MES= • , 2F 6. 2

)

C

C SLEW BACK TO BANG BEFORE LEAVING ESTIM

C TANGIIUNIT) = EANGIIUNIT)

CALL PUSH! IUNIT,7)

CALL PUSH! lUNIT, 12)

CALL PUSH! lUN IT,6)

GOTO 999

CC COMMON CODE FOR LIFO STACK SET UP FOR CALLS TO INTRUP AND RETURN TO ESTIM

C

'

- 990 MODE! lUNIT. 13) = IGO

CALL PUSHI lUNIT ,13)

CALL PUSHI lUNIT, 12)

999 RETURN

END

56
1 C

' 2 SUBROUTINE FILEUPUUNIT* 10)

3 C

4 C 5 C THIS SUBRCUTINE GETS THE TITLE* OPERATOR NAME* DATE AND TIME AND

6 C THE OUTPUT DATA FILE NAME

7 C 8 IMPLICIT 1NTE6ER42 II-N)

9 1NTE6ER44 NBS* INTR

10 C

11 COMMON /BUFF/ IALPHI66)* NAME! IS)

12 c

13 COMMON /lO/ NBS* IDT* XCLOCK*

14 1 ISPEC* IRO. IPRT* ITYP*

15 2 ID1SK(2*2)* IFIN* IFOUT

16 c

17 COMMON /PROS/ 10AT(3)* 1FLAG!2*10)* ITIMO)*

18 1 ITITLE(SO)

19 c 20 COMMON /RNOT/ NREC(2)* NMFIL(2*6)

ITR(2)

21 1 IENRN(2*4)

22 c 23

24 C

25 c GET THE DATE AND TIME

26 c 27 CALL DATE

28 c 29 c GET THE NAME OF THE OUTPUT FILE

30 c

31 CALL FILNAM(IO)

32 c 33 c STORE FILE NAME IN NMFIL

34 c 35 DO 200 1=1*6

36 200 NMFILt lUNIT* I )= NAME! I)

37 c 38 c READ THE TITLE

39 c 40 40 WRITE! ITVP. 1030)

41 1030 FORMAT! IH * 'ENTER RUN TITLE*)

42 READ! IRD*104O) ( ITITLE! 1 ) *1=1* 40)

43 1040 F0RMAT(40A2)

44 C

45 C READ THE OPERATORS NAME

46 c 47 WRITE! ITYP* 1050)

48 1050 FORMAT Cl H * 'ENTER YOUR NAME!' > 49 READ! IRO* 1040)! ITITLE! I )• 1=41 • SO)

SO RETURN

51 END

57
SUBROUTINE FILNAMCIO)

123

43

6

7

8

9

10

1112

13

14

15

16

1718

19

20

2122

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

50

5152

53

54

C THIS SUBROLTINE CFECKS IF THE NAME OF A FILE TO BE CREATED

C STARTS WITH A LETTER t THE REMAINING 5 SYMBOLS HAVE TO BE

C LETTERS OR NUMBERS

C

THE ARGUMENT ID TELL WHO CALLED FILENAME

ID = 1 CALL FCR A DATA FILE

ID = 2 CALL FOR A RUN FILE

ID = 3 CALL FCR A TRANS FILE OR DELETING A FILE

IMPLICIT INTEGER42 < I-N

)

INTEGER44 NBS

COMMON /BUFF/

COMMON /lO/

1 I SPEC*

2 IDISK(2.2)«

IALPH<66)

NBS*

IPO*

IFIN*

NAME! 15)

IDT*

IPRT*

IF OUT

DIMENSION KPRT<3*3)

DATA KPRT/'D '»'R •**D •*• *.* ***QR»*»

DATA ICO/* 0'/*IC9/*9*/* ICA/ • A • / * ICZ/* Z»

/

ICLOCK*

ITYP*

• R*/

C************ ************************************ ******************^t^

c BECAUSE OF CORE LIMITATIONS WE DO NOT CHECK ALL ASPECTS OF

INPUT FILE NAME

C

C

C

c

ccc

c

ccc

c

cc300

301

FILE NAME STRUCTURE

1-2 INITIALS

3-5 ALPHANUMERIC

6 R FOR A RUN FILE

D FOR A CATA FILE

ASK FOR A FILE NAME

WRITE(ITYP*301) (KPRTdD*!)* 1=1*3)

FOR MAT (1 HO* 'ENTER FILE NAME- 6 CHARACTERS ENDING WITH **3A2)

READ! IRO»311) (NAME! I)* 1=1 *6)

F0RMAT(6A1

)

311

C

C CHECK IF NAME IS LEGAL

C CHECK THAT THE FIRST TWO CHARACTORS ARE LETTERS

C DO 400 1=1*2

IF( NAME! I ) *LT.ICA.OR*NAME( I )*6T*1CZ)G0 TO 600

55 400 CONTINUE

56 C 57 C CHECK THAT THE LAST LETTER IS R OR D 58 c 59 IDM=NAME(6)

60 IF( ID *EQ* 1 *AND* IDM *E0. *0*) GOTO 450

61 IF( ID .EQ. 2 .AND. IDM *EQ* *R')GOTO 450

62 IF< ID .GT. 2 .AND. ( IDM .EQ. *R* .OR* IDM .EQ.

63 60 TO 600

64 C

65 c CHECK THAT LETTERS 3*4 AND 5 ARE ALPHAMERIC

66 c 67 450 DO 500 1=3*5

68 IFINAMEd) .GE. ICA .AND. NAME! I) .LE. ICZ) GOTO

69 IF(NAMEd) *GE. ICO .AND. NAME(l) .LE. 1C9) GOTO

70 GOTO 600

71 500 CONTINUE

72 C

73 c NAME IS LEGAL

74 c

58
75 GOTO 9«G

76

77

78

79

80

8182

83

C

C ILLEGAL NAME TRY AGAIN

C600 WR1TE( lTYP« 60 n

601 FORMAT! IH «• ILLEGAL FILE NAME*)

GOTO 300

999 RETURN

END

59
SUBROUTINE FINIS(IUNIT)

12

3

4

56

7

8

9

10

1112

13

14

15

16

17

18

19

20

2122

23

24

25

26

27

28

29

THIS SUBROUTINE RESETS A UNIT AND TERMINATES A RUN

THERE ARE FOUR

MOOE( lUNIT. 10

)

MOOES OF ACTION BASED ON THE FINIS STATUS FLAGl

= 1 - RESET MODE

IMMEOIATLY HALT lUNIT

WRITE ANY REMAINING DATA TO THE OUTPUT FILE

RESET ALL RUN PARAMETERS

START SLEW TO 80.0

MOOE( IUNIT» 10) = 2 - NORMAL TERMINATION OF DATA COLLECTION

WRITE REMAINING DATA

RESET RUN PARAMETERS

BEGIN SLEW TO 80.0 DEGREES

= 3 - (NOT USED)

= 4 - (NOT USED) = 5 - INTERFACE ERROR EXIT

HALT lUNIT

WRITE ANY REMAINING DATA TO OUTPUT FILE

RESET ALL RUN PARAMETERS

SET lACT TO -1 AND DO NOT SLEW TO 80.0

IMPLICIT INTEGER42 (I-N)

INTEGER44 NBS. INTRt NBSAOO. NBSSUB. ICNTL

MOOE( lUNITf 10)

MODE( I UNIT. 10)

MODE( lUNlT. 10)

30 COMMON /ANG/ BANG(2). CANG(2). 0ANG(2).

31 1 EANG(2). IRATE(2)

.

PANG(2). RATE(2).

32 2 TANG(2). IZRST(2)

33 C 34 COMMON /CNTL/ 1ACT(2). IDBUG(2). INTRt

35 1 IRUN(2)» ITRANS( 2.20 )

.

MODE(2.20)

MVCNTC2)

36 C 37 COMMON /lO/ NBSt IDT. 1 CLOCK.

38 1 I SPEC. IRDt IPRT. ITYP.

39 2 I0ISK(2.2). IFIN* IFOUT

40 c

41 COMMON /PROB/ IDAT(3)

IFLAG(2.10). IT1M(3).

42 1 I TITLE (50) • 43 c 44 COMMON /RNOT/ NREC(2)

NMFIL(2.6)

.

ITR(2)

45 1 IENRN(2«4)

46 c 47 COMMON /TIM/ BKGTIM(2). F1XERR(2). IPK(2).

48 1 NBG(2)t NPK(2)t T1ME(2). TIML1MI2)

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74

C*********************************** ************* *************************

DIMENSION lASGNO). 101011(2)

DATA ICNTL/X'OOOC*/

CC DATA ASSIGNMENTS FOR FREEING 10 UNIT 10 OR 11 C DATA IASGN/*AS*.* '.'BO*/. lOlOll/* A»,» B*/

IASGN(2) = 10101 1 ( lUNIT)

CC IF IN INTERFACE ERROR MODE DO NOT POP STACK

C IF(MODE( lUNlT.lO) .EQ.5)G0 TO 50

C

C IF ERROR FROM SLEW (ITR = 4.) .SET I NACT AND STOP

C IF( MODE( lUNIT • 10) .NE.l. OR. I TR( lUNIT) .NE.4)G0T0 10 MODE! ILNIT.IO) s 5 GOTO 140

C

C POP FINIS ADDRESS OFF TRANSFER TABLE

C

10 (ERROR s 0

CALL POP( lUNlT. (ERROR)

C

60
75

76

77

70

79

60

81

82

83

64

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

1 12

113

114

115

116

117

118

1 19

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

1 35

136

137

138

139

140

141

142

143

144

145

146

147

148

C IF NORMAL TERMINATION SKIP FORWARD TO WRITE REMAINING DATA

C

IF(MOOE( IUNIT«10).EQ«2)60 TO 140

C

C RESET UNIT MODE SEND CONTROL WORD TO HALT

C

50 NBSADD » lUNIT 4

NBSSUB s NBSAOO * 2 C

C GET TO FIRST ZERO REGISTER ON INTERFACE AND HALT BY SENDING CONTROL WORD

C

INTR « ISTAT(N8<tNBSSU3>

INTR « ISTATI NB St NBSAOO)

CALL OUTBUSINBStICNTL)

C

C IF WE CLEARED THE UNIT DURING A MOVE WE MUST NOW ESTABLISH

C THE CURRENT 2-THETA POSITION

C

INTR s ISTATINBStNBSSUB)

INTR = INBUS(NBS)

CANC(IUNIT) s FLOAT(INTR) / 200*

C

C WRITE ANY REMAINING DATA TO THE OUTPUT FILE AND ZERO ARRAY

C

140 1F< ITR( lUNIT) .EQ.4) GOTO 300

CALL WRFILEI lUNIT)

CC ENDFILE AND CLOSE THE OUTPUT FILE

C IFILE = IDISK<IUNIT.2)

ENDFILE IFILE

CALL SYSTEM! I ASGNt6)

C

C PRINT COMPLETION MESSAGE

C

C WRITE DATE ON CCNSOL

C

200 CALL DATE

C

WRITE! ITYPt 1010) lUNITt ! NMF ILC lUNITt I ) t 1=1 t 6 ) t NREC ! lUN I T )

t

1 lOATtlTlM

1010 FORMAT! IHOt 'END OF RUNS UNIT o 12 t

* t FILES • c6Al t

' tREC= *• 16*

1 • ON • . I2t ,12t '/'t 12. • AT •• 12. 12. •: *9 12) c

c CLEAR ALL RUN PARAMETERS FOR lUNIT

C

IRUNIIUNIT) = 0

I ACT! lUNIT) = 0

ITR!IUN1T) = 1 NREC! lUNIT) = 0

RATE! lUNIT) = 30*0

00 250 1= 1.4

250 lENRN! lUNIT* I ) = 0 IFIMCDE! lUNITtlO) .EQ«5)G0 TO 300

CC NOW SET THE TARGET ANGLE TO 80.0 AND SLEW . INTRUP. ENSLEW. 1 NTRUP

C ITRUUMT) = 4 TANG! ILNIT) = 80.

MODE! IUNIT.7) = 1 ITRANS! lUNIT* 1)= 6

1 TRANS! lUNIT. 2) =12

ITRANS! lUNIT. 3)= 7

ITRANS! I UNIT. 4) =12

GO TO 999

C

C TERMINATION DUE TO INTERFACE ERROR

C300 lACT! lUNIT) = -1

DO 310 1=1 .20

310 ITRANS! lUNIT, 1) = O

ITRANS! lUNIT. 1 ) = 12

999 RETURN

END

61
X23

456

78

9

10

111213

rt

r»

nn

REAL FUNCTICN F IXANG( ANGLE

)

FIX ANGLE SO THAT IS A MULTIPLE OF >005 DEGREES

IMPLICIT INTEGER42 (I-N)’

NSTEP s IFIX2U ANGLE-«-0.0005)>l>200*0)

FIXANG = FL0AT2(NSTEP)/200.

C RETURN

END

62
n

o

n

n

C .. REAL FLNCTION F IXT IM( T1 MVCNT

)

C

SET TIME TO THE NEAREST MULTIPLE OF

O.ISEC SET IN aCCNT WITH LIMIT OF 3270.0 SEC MAXIMUM (16 BIT INTEGER)

0.01 SEC SET IN BGMOVE

IMPLICIT INTEGERP2 (I-N)

C

XMULTalOoO

IF(MVCNT.EQ»1) XMULT«100*0

C

ITIME « IFIxaiTIMEFXMULT * O.S)

IF( ITIME.EQ.O) ITIME « 1 FIXTIM s FL0AT2(ITIME)/XMULT

C

RETURN

END
123

4

5

6

7

8

9

10

1112

13

14

IS

16

17

18

19

20

2122

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

SO

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74

n

n

n

nonrtnn

nno

SUBROUTINE INIT

C_1

c

c

c

c

cc

cc

THIS SUBROUTINE SETS UP ALL PROGRAM PARAMETERS COMMON

TO ALL PROGRAM SEGMENTS* IT REQUIRES THE READING OF

THE CURRENT ANGLE ON BOTH DIFFRACTOMETERS SO THAT

SUBROUTINE CKANG CAN CHECK THEIR RELATIVE POSITIONS

IN ORDER TO PREVENT COLLISIONS*

IMPLICIT INTEGER42 (I-NI

INTEGER44 NBS * INTR

COMMON /ANG/

EANG!2)«

: TANG!2),

BANG! 2)

IRATE!2)

IZRST!2)

CAN6!2)*

PANG!2)*

DANG! 2)*

RATE! 2)*

COMMON /BUFF/ IALPH! 66 )* NAME! IS)

COMMON /CNTL/

IRUN!2)*

1 ACT! 2)

1TRANS!2*20)

I0BUG!2)*

M00E!2 *20)

INTR*

MVCNT!2)

COMMON /COUN/

LIMCNT!2)

ICNT!2*16)*

ISAVE!2)

1PTI2)* IT0TI2)*

COMMON /lO/

ISPEC*

: IDISK!2*2)*

NBS*

IRD*

IFIN*

IDT*

IPRT*

IFOUT

I CLOCK*

ITYP*

COMMON /PROS/

ITITLE!50)

I0AT!3)* IFLAG!2*10)* 1TIM!3)*

COMMON /RNDT/

1ENRN!2*4)

NREC!2)NMFIL'!2*6) * ITR!2)

COMMON /TIM/

NBG!2)*

8KGTIM!2)*

NPK!2)*

FIXERR!2)*

TIME!2)*

IPK!2>*

riMLIM! 2 )

SET THE I/O UNITS

NBS « 1 IDT » 2

I CLOCK = 3

I SPEC a A IRD = 5 IPRT 3 6

ITYP * 7

IDISKd «1 ) s 8

IDISK(1*2) 3 10

IDlSK(2tl) 3 9 ID1SK(2*2) 3 11 IFIN 3 12

IFOUT 3 13 •

HANDLE P01»ER FAIL

CALL SYSTEM! »PF C.4)

ATTACH THE LOGICAL UNITS TO PHYSICAL DEVICES

CALL SYSTEM! *ZU* *2>

CALL SYSTEM! «ND DO* *5)

CALL SYSTEM!* AS 188**6)

CALL SYSTEM!* AS 260**6)

CALL SYSTEM!* AS 36C* *6)

CALL SYSTEM! »AS 520**6)

CALL SYSTEM!* AS 662**6)

CALL SYSTEM!* AS 720**6)

ATTACH THE INSTRUMENT CONFIGURATION FILE

ENCODE! lALPH* 1060) ISPEC

64
75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

1 12

1 13

114

115

1080 FORMAT (• AC OACCNFt»#Zl»

CALL SYSTEM(IALPHtll)

C

C CHECK IF THE DATE AND TIME HAVE BEEN SET

C CALL DATE

C

c

cc

INITIALIZE ALL

TO INACTIVE

RUN PARAMETERS AND SET ACTIVITY FLAGS

50

DO 100 lal,2

BANG! I ) = 0«0

TANG( I ) = 0*0

EANG(I) = 0«0

lACTI I) = 0

IOBUG( I ) s 0

ISAVEI 1)=0

IPT(I) * 0

IRATE! !) = O

irun: 1 ) = 0

ITR(I> = I NREC( I) = 0

RATE! I ) = 30*0

T IME! I ) = 0*0

BKGTIM!!) = 0*0

FIXERR!!) = 0.0

TIMLIM!!) = 0.0

LIMCNT! n = 0

MVCNT!1) = 0

DO 50 3=1.20

ITRANS!I»J) = O

MODE!lfJ) - 0

1FIJ.GT.16) GOTO

ICNT! I. J) = O

IFIJ.GT.IO) GCTQ

IFLAG!I«J) = 0

IF!J.6T.6) GOTO

NMFIL! I.J» =• • IF!J.GT.4) GOTO

lENRN! 1 tJ} =0

CONTINUE

50

50

50

50

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

100 CONTINUE

C

C ESTABLISH THE CURRENT POSITION OF BOTH DIFFRACTOMETERS

C

00 200 1 = 1.2

WRITE! ITYP. 105011

1050 FORMAT! IH .‘ENTER THE CURRENT 2-THETA OF UNIT «*.ll*tX.

1 MF10.3)*)

READ! IR0.10601CANG!!)

1060 FORMAT!F10.3)

C

C INITIALIZE THE TRACKING COUNTER

C lUNIT = 1 CALL SETANG! lUNIT)

200 CONTINUE

C

c enable the real time clock to intrupt -

C ! future USE ) c

c CALL SYSTEM! *EF 6C*.5)

c

c CLEAR THE FLAG TABLE

C CALL SYSTEM! *CF* .21

RETURN

END

65
12

3

45

6

7

8

9

10

1112

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

SO

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74

C SUBPOUT INE INTRUPcTuNIT)

c

cC THIS SUBROUTINE PROCESSES INTERRUPTS FROM THE CONSOL CIE WHEN

C ESCAPE IS HIT) OR FROM THE PRECISSION INTERVAL CLOCK OR

C FROM A POWER FAIL.

C IT ALSO DETECTS COMPLETIONS ON EITHER INTERFACE

C IMPLICIT INTEGER42 < I-N

)

INTEGER44 NBS. INTR. NBSAOO* NBSSUBt MASK

c COMMON /CNTL/ IACT!2)

.

IDBUG!2). INTR.

c

1 IRUN!2)» ITRANS!2.20 )

MODE(2.20)

MVCNT!2)

COMMON /lO/ NBS. IDT. ICLOCK.

1 I SPEC# IRDt IPRT. ITYP,

2 IDISK!2«2)t IFIN* IFOUT

V* DIMENSION JFL!3)

V. DATA MASK/X'C8'/. JFL/' ES* • *PF' *X'6C'/

c POP TRANSFER ADDRESS OFF TABLE

C

I ERROR = O CALL PCP( lUNIT.IERROR)

C

C CHECK IF AN ENTRY HAS BEEN MADE INTO THE FLAG TABLE

C100 IFL = IFLAG(O)

C

C WAS THERE A CODE ON THE FLAG TABLE

C IF( IFL.EQ. 0)GO TO 200

C

C WE HAVE RECEIVED AN INTERRUPT - SEE WHO. DID IT

C CONSOL ESCAPE KEY PUTS AN 'ES* ON FLAG TABLE

C POWER FAIL PUTS AN 'MM* ON FLAG TABLE

C THE CLOCK PUTS AN X'6C» ON FLAG TABLE (FUTURE USE)

C DO 120 Isl .3

J = 1 IF( IFL.EQ. JFL(J))GO TO 140

120 CONTINUE

WRITE! ITYPtlOOO)lFL

1000 FORMAT! IHO. • ILLEGAL DEVICE INTERRUPT •*

1 A2.' IGNORED')

C

C CLEAR THE FLAG TABLE OF ANY MULTIPLE ENTRIES

C130 CALL SYSTEM! 'CF». 2)

GO TO 100

C

C BRANCH ON TYPE OF FLAG ON THE FLAG TABLE

C140 GO TO! 150*160.170) tJ

C

C A CONSOLE INTERRUPT OCCURRED - USE lUNIT^l TEMPORARILY

C150 lUNIT = 1 MODE(IUNIT.l) = 0

CALL PUSH! lUNIT.l)

GO TO 999

C

C A POWER FAIL INTERRUPT HAS OCCURRED - PRINT MESSAGE

C160 WRITEdTYP.lOlO)

1010 FORMAT! IHO* 'PF INTERRUPT- I GNOREO*

)

GO TO 100

C

C THE PRECISSION INTERVAL CLOCK HAS INTERRUPTED

C

66
75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

C170 WRITE! ITYP* 1020)

C1020 FORMATUHO, 'CLOCK INTERRUPT-I 6N0RE0 * ) 170 GO TO 100

C

C THIS SECTION CHECKS FOR AN INTERFACE COMPLETION

C200 lUNIT s 0

210 lONITalUNIT 1 1F( IUN1T.6T.2) GOTO 100

IF( IACT( IUNIT)*LE*0) GOTO 210

NBSAOO s lUNlT * 4

INTR a ISTATIKBS. NBSAOO)

IF( IANOUNTRtMASK).NE.MASK)GO TO 210

C

C A COMPLETION HAS OCCURRED ON lUNIT - RETURN AND SERVICE IT

C999 RETURN

END

67
12

34

5

67

8

9

10

1112

13

14

15

16

17

1819

20

2122

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

SO

5152

m 2 54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74 nr>

^n

nn

nn

n

n

nn

nrvrt

C.; SUBRCUTINE CPTIM(IUNIT) ~

C

cC SUBROUTINE CPTIM TO OPTIMIZE THE TIME SPENT COUNTING THE

C PEAK AND EACKGRCUNO POINTS IN EITHER FIXED TOTAL TIME MODE

C OR FIXED ERROR MCDE

C IMPLICIT INTEGER42 ( I-N

)

INTEGER44 NBSt INTR

C COMMON /ANG/

1 EANG(2).

2 TANG(2)t

BANG! 2)

• IRATE(2).

1ZRST12)

CANG(2)

PANG<2)t

NPTPKC2)

DANG(2 ).

RATE(2)t

COMMON /CNTL/

1 IRUN(2)»

IACT(2)

ITRANS12.20) . I0BUG(2)MODE! 2 *20)

INTR.

MVCNT(2)

COMMON /COUN/

1 LIMCNT(2).

ICNT( 2.16)

1SAVE(2)

1PT(2)

IT0T(2).

COMMON /lO/

1 ISPEC.

2 I0ISK(2.2)«

NBSt

IRDt IFIN.

IDTt IPRTt

IFOUT

1 CLOCK.

ITYPt

COMMON /OUAN/

1 KODEt

2 SIGSTOt

CCNC.

LOOP! 2)

STO.

FREL.

LPK(2)

ST OREL

lOVLP.

NUM(2.20)

COMMON /TIM/

1 NBG(2)»

BKGTIM(2)t

NPK(2).

FIXERR(2)t

T1ME(2).

IPK(2)t

TIMLIM(2)

cc******** **************************************** ****>ti*ilt************:t‘^it

DUM1=FL0AT2< 1CNT( lUNIT. 1 )

)

0UM2=FL0AT2( ICNT(IUNITt2i

DUM3=FIXERR( IUN1T)/100«0

BKGTIN(IUNIT) = 0*0

DETERMINE THE NUMBER OF BACKGROUND POINTS TO BE COLLECTED

NPTBG=NBG( lUNIT)

IF(EANG( IUNIT).GT*0«1) NPTBGaNPTBG-fNPTBG

XPTBG=FLCAT2<NPT8G)

DETERMINE THE NUMBER OF PEAK OR SCAN POINTS TO BE COLLECTED

IF ( IPK( lUNIT) •EOo 1 ) XPTPK=FL0AT2(NPK( lUNIT)

)

IF( IPK< IUNIT)«EC«0) XPTPK=IEANG(IUNITi-BANG(IUNIT) l/OANGI I UNIT)

1 ! ,0-XPTBG

NPTPK(IUNIT) = IFIX2{XPTPK*0«00n

TEST IF BACKGROUND POINT WAS MEASURED. IF NOT SET R AND RINV TO 0.0

IFINPTBG.NE.O) GOTO 10 R =0.0

RINV = 0.0

GOTO 16

CALCULATE THE RATIC OF PEAK TO BACKGROUND INTENSITIES

R = SQRT{DUM2/DUM1

)

IF(R.LT.l.O) R = 1*0

RINV = 1.0/R

BRANCH TO THE PROPER COUNT MODE ROUTINE

1F(FIXERR( lUNlT )*LT.0«01)G0 TO 100

WE ARE IN FIXED ERROR MODE. CHECK THAT PEAK AND BKG

COUNTS ARE DIFFERENT - IF NOT CONVERT TO FIXED TIME MODE

IFIR.EQ.laO)GO TO 100

COMPUTE THE PEAK COUNT TIME (IN SECONDS) FOR FIXED ERROR MODE

68
75

76

77

78

79

80

8182

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

i06

107

108

C20 T1ME(IUNIT)« (0UM24R4DUMU /(DUM3*0UM3*XPTPK*

1 (DUM2-0UM1)4(0UM2-0UM1 )) 60 TO 200

C

C WE ARE IN FIXED COUNT TIME MODE (TIMELIM IS IN MINUTES)

C DETERMINE COUNT TI WEsTI ME( I UN IT) IN SECONDS

C100 TIMECIUNIT) s 60.04T IMLI M( I UNI T ) / ( XPTPK4I 1 • 04R INV))

C

C NOW COMPUTE THE BACKGROUND COUNT TIME FOR BOTH MCDES

CC IF THE MAXIMUM NUMBER OF COUNTS ALLOWED IN THE SCALER USING A TIME

C BASE OF «1 SEC IS EXCEEDED DEFAULT TO MAX TIME OP 3270*

C I 200 IF(TIME(IUNIT)«GT«3270» )TIME( lUNXT) « 3270.

IF(NPT86«EQ*0) GOTO 300

BKGTIMI lUNIT) = XPTPK TIMEX lUNIT) /

1 (XPTBG 4> R)

C

C IF WE ARE IN FIXED ERROR MODE MAKE SURE THAT THE SUM OF TIME

C AND BKGTIM DO NOT EXCEED THE TOTAL TIME (TIMLIM)

C300 1F(FIXERR(IUNIT)«LT.0.001)G0 TO 999

TEMP = BKGTIMX lUNIT) XPTBG

TEMP = CTEMP TIMEX lUNlT) * XPTPK) / 60«

IFXTEMP.LEaTIMLlMX lUNITDGO TO 999

C

C TOO MUCH TIME REOUIRED FOR FIXED ERROR MODE CONVERT TO FIXED TIME

C FIXERRXIUNIT) = 0.0

GO TO 100

999 RETURN

END

69
SUBROUTINE PKSCANI lUNlf .NSTEP)

12

34

5

6

7

89

10

1112

13

35

36

37

38

39

40

4142

43

44

45

46

47

48

49

50

5152

53

54

55

56

57

58

59

60

6162

63

64

65

66

67

68

69

70

7172

73

7475

SUBROUTINE PEAK COUNT PERFORMS THE FOLLOWING FUNCTIONS!

1* COUNTS NBG POINTS ( SEPERATED BY DANG) AT THE FIRST BACKGROUND

FOR BKGTIM SECCNOS EACH

2* MOVES TO THE PEAK ANGLE - NPK/2 AND COUNTS NPK POINTS (ALSO

SEPERATED BY CANG) FOR TIME SECONDS EACH.

3* MOVES TO THE HIGH ANGLE BACKGROUND, IF IT IS NON ZERO,

AN COUNTS NBK POINTS FOR BKGTIM SECONDS EACH

4* WRITE FINAL DATA BUFFER VIA CALL TO WRFILE

14 C WHEN ALL COUNTING IS COMPLETED RETURN TO MAIN

15 C

16 IMPLICIT INTEGER42 (I-N)

17 INTE6ER44 NBS, INTR

18 c BANG^2)

19 COMMON /ANG/ CANG(2)

DANG( 2 )

20 1 EANG(2), IRATE(2)PANG (2), RATE( 2).

21 2 TANG(2), 1ZRST(2)* NPTPKI2)

2? c 23 COMMON /CNTL/ I ACT ( 2 )

10BUG(2)

INTR,

24 1 IRUN(2), ITRANS(2, *0) , MODE(2,20)

MVCNT(2)

25 c 26 COMMON /lO/ NBS, IDT, 1 CLOCK*

27 1 ISPEC, IRO, IPRT, ITYP*

28 2 IDISK(2,2), IFIN» IFOUT

29 c 30 COMMON /TIM/ BKGTIM(2) , FIXERR(2)

1PK(2)

31 1 NBG( 2 )

NPK(2), TIME(2), T1MLIMI2)

32 c 33 COMMON/COUN/ ICNf(2.16), 1PT(2)

1T0T(2),

34 1 LIMCNT(2), ISAVE(2)

C

c - ' C44**** 44444 44444444 4444444 444 444444444444444

C

C POP THE PEAK SCAN ADDRESS OFF OF THE STACK

C

c

c

c

DIMENSION TEANG(2)

CALL P0PUUNIT,0)

BRANCH BASED ON THE VALUE OF THE MODE FLAG

FIRST ENTRY - WE ARE ALREADY AT BANG (THE FIRST BACKGROUND)

SAVE THE ANGLE OF THE HIGH ANGLE BACKGROUND

TEANG(IUNIT) = EANGUUNIT)

IGOTO * MODE( 1UNIT,5)

GO TOC 100, 200, 300, 400), IGOTO

Cc

c

c100

cC THE NBG BACKGROUND POINTS WILL BE MEASURED BY SUBROUTINE STEP

C SCAN* SET EANG SO THAT STEP SCAN WILL TERMINATE AFTER NBG POINTS

C EANG(IUNIT) = BANGdUNIT) + DANG(IUNIT) 4 FL0AT2 ( NBGl I UN I T )- 1 ) CC SET PEAK SCAN MODE TO RETURN TO THE PEAK COUNTING SECTION

C

M0OE( lUNlT ,5) =2

GO TO 998 ' * C

'' C LOW ANGLE BACKGROUND IS COMPLETE. WE NOW MUST COUNT THE PEAK

C FOR NPK POINTS. SET UP THE TARGET ANGLE FOR THE MOVE

C200 DUMMY = FL0AT2(NPK( IUNIT)/2) 4 DANGCIUNIT)

TANG(IUNIT) = PANG(TUMIT) - DUMMY

CC SET THE ENDING ANGLE FOR THE PEAK POINTS

C EANG(IUNIT) = PANG(IUNIT) + DUMMY

M0DE( lUNIT ,5) =3

GO TO 993

70
76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

-105 106

107

108

109

110

111

112

113

114

115

1 16

117

118

119

120

121

122

123

124

125

126

127

1 28

1 29

C WE ARE NOW FINISHED WITH THE PEAK* HAS A HIGH ANGLE BACKGROUND

C BEEN REQUESTED?

C300 IFITEANGI 1UN1T)*EQ*0*0)G0' TO 400

C

C HIGH ANGLE BACKGROUND IS TO BE COLLECTED. SET M00E»4 IS TO SIGNAL

C A RETURN TO CALLING PROGRAM! VIA MAIN) AT END OF STPSCN.

C MODE! lUNITy 5) » 4 I C

C SET THE NEW ENDING ANGLE

C TANGUUNIT) = TEANG(IUNIT) - DANG(IUNIT) FL0AT2 1 N86< lUN IT )-l ) EANG(IUNIT) = TEANG(IUNIT)

GO TO 998

C

C ALL DONE - WRITE THE REMAINING DATA TO THE OUTPUT FILE

C

' ‘ 400 CALL WRFILE! lUNIT)

GOTO 999

CC CHKANG ERROR - ABORT RUN BY CALLING FINIS

C

. 900 MODE! lUNIT. 10 ) = 1 ITRANSdUNIT. 1) = 10

GOTO 999

C

C SET UP THE TRANSFER SEQUENCE! INTRUP. STPSCN. PKSCN

C998 CALL PUSH! IUNIT.5)

CALL PUSH! IUN1T.4)

C

C SET MODE FLAG FOR STPSCN TO INDICATE POSITIONED AT BANG

C MODE! IUNIT.4) =3

C IF FIRST CALL TO PKSCN WE ARE AT STARTING ANGLE - SKIP 86M0VE CALL

IF! IGOTO.EQ* 1 ) GOTO 999

C CHECK. TARGET ANGLE FOR LEGAL RANGE

CALL CKANGdUNIT.NSTEP. TERROR)

1F(IERR6R.E0* U GOTO 900

C PUSH CALL TO INTERRUPT ONTO STACK AS 86M0VE WILL BE CALLED

CALL PUSH! lUNIT. 12)

CC TARGET ANGLE IS OK* MOVE TO TARGET ANGLE VIA BGMOVE

C PUSH GOTO POINTER ONTO STACK TO BE POPPED BY BGMOVE

C

CALL PUSH! lUN IT.8)

C

C SET MODE FLAG FOR STPSCN TO INDICATE THAT BGMOVE WAS CALLED AND THAT

C STPSCN MUST CALL ENMOVE"

C MODE! IUNIT.4) = 1 999 RETURN

END

71
c. SUBROUTINE POP( lUNl T« lERROR)

123

4

5

6

7

8

9

10

It12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

C.CC

C

c

c

c

c

THIS SUBROUTINE POPS THE "GO TO" FLAG OUT OF I TRANS( lUNI T . 1

)

AND PUSHES ALL OF THE REST OF THE TABLE DOWN ONE*

IMPLICIT INTE6ER42 (I-NI

INTEGER44 NBS * INTR

COMMON /CNTL/ IACT!2)

IDBUG!2)

INTR*

1 IRUN!2)t 1TRANS!2.20)

M0DE!2*20)

MVCNT! 2)

COMMON /lO/ NBS* IDT. I CLOCK.

1 I SPEC* IRO. IPRT. ITYP.

2 IDISK!2.2). I FIN. IFOUT

C******************** ************************************** ************^*^

c

C IF lERROR = 0 THEN SKIP ERROR TEST ON END OF TRANSFER TABLE

C

DO 100 1=1.19

ITRANSCIUNIT* I) = ITRANSI lUNIT* 141

)

100 CONTINUE

ITRANSI IUNIT.20) = 0

1F(IERR0R.EQ*0}60 TO 999

lERROR = 0 IF(ITRANS(IUNIT.1).GT.O.ANO.ITRANS(IUNIT«1).LT.14}GO TO 999

CC ILLEGAL TRANSFER ADDRESS IS NOW ON TABLE

C WR ITE( ITYP. 1000) lUNIT.t ITR ANSI I UN IT . I ) . 1=1 . 20

)

1000 FORMAT! IHO. 'POP ; ILLEGAL I TRANS! 1 ) -> UN I TW • • 1 1 .

• I TRANS=* « 20 1 2)

lERROR s 1 999 RETURN

END

72
SUBROUTINE PUSH( lUN ITt 1 PUSH)

t2

3

4

5

7

8

9

C_. Cc

c

c

THIS SUBROUTINE PUSHES TH “GO TO" ADDRESS IN IPUSH ONTO THE

TRANSFER TABLE AND BUMPS THE REST UP BY ONE

IMPLICIT INTEGER42 U-N)

INTEGER44 NBSi INTR

10 C

11 COMMON ACNTL/ IACT!2)t 1DBUG(2)* INTR*

12 1 IRUN(2)« 1TRANS!2«20) . HOOE(2»20)» MVCNTC 2)

13 c 14 COMMON /lO/ NBSt IDT* I CLOCK*

IS 1 I SPEC# IROt IPRT« ITYP*

16 2 I0ISK(2«2>* IFIN# IFOUT

17 C************4‘**************************W ******** *************************

18 c 19 c CHECK IF ANYTHING IS GOING TO BE PUSHED OFF

20 c

21 IFUTRANS! IUNIT.20)*NE.0)GO TO 200

22 DO 100 1=1 .19

23 c note; a decrementing LOOP OOSN'T WORK

24 J = 20 - I 25 ITRANS! lUNITt J+1) = ITRANS! IUNIT* J)

26 100 CONTINUE

27 ITRANS! lUNITt 1) = IPUSH

28 GO TO 999

29 c 30 c TABLE IS FULL

31 c 32 200 WRITE! ITYPt 1000) IUNIT,! I TRANS! lUN IT . I ) , 1=1 • 20)

33 1000 FORMAT! IHO* • ITRANS FULL- UNIT4».11.» 1TRANS=*

•

2012)

34 CALL EXIT

35 999 RETURN

36 END

73
123

4

56

7

8

9

10

1112

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

3132

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74

SUBROUTINE QUAL(IUNIT)

C.

c

cC QUALITATIVE ANALYSIS SET UP SUBROUTINE

C TO COLLECT A STEP SCANNED POWDER PATTERN

C

c

C MODE! IUNITf3) = 2 RETURN PROM SLEW TO BANG

C COMPLETE INPUT OF RUN PARAMETERS

C

C IMPLICIT 1NTEGER42 (I-N)

INTEGER44 NBS t INTR

C

COMMON /ANG/ BANG! 2)

CANG!2)* DANG! 2)*

1 EANG!2)* 1RATE!2>* PANG!2)* RATE!2)*

2 TANGI2)* IZRST!2)

COMMON /BUFF/ IALPH!66)

NAME! 15)

COMMON /CNTL/ I ACT! 2)

IDBUG!2)

INTR*

1 IRUN!2)o ITRANS!2.20)MODE!2.20)

MVCNT!2)

COMMON /COUN/ ICNT!2*16). IPT!2). IT0T!2)*

1 LIMCNT!2). 1SAVE!2)

COMMON /lO/ NBS* IDT* ICLOCK*

1 I SPEC* IRO. IPRT* ITYP*

2 IDISK!2*2)« IFIN* IFOUT

COMMON /PROB/ IOAT!3)IFLAG!2*10). ITIM! 3).

1 ITITLEI50)

COMMON /RNDT/ NREC!2)* NMFIL!2*6)

ITR!2)*

1 IENRN!2*4)

COMMON /TIM/ BKGTIM!2)* FIXERR!2)

IPK!2I*

1 NBG!2>* NPK!2)* TXME!2)t TIML1M!2)

DIMENSION IST0(3)

cC*4*444*4*44*4444444444444444*44*44i4^4r**4i*4u|i*4444* 4*4*44**** ***4***4444** 4*

C

C POP DUAL'S TRANSFER ADDRESS OFF OF THE LIFO STACK

C lERROR s 0

CALL POP( lUNITflERROR)

C

C IS THIS A RETURN CALL FROM SLEW?

C

IF<MODE( IUNIT.3)#EQ.2)60 TO 100

C

C WE ARE STARTING A QUAL RUN - SAY HELLO

C

C SET ITR TO QUAL

ITR(IUNIT) = 2 WRITE! ITYP* 1000) I UNIT* I DAT . ITIM

1000 FORMAT < 1 HO » 'PCWDER PATTERN DATA COLLECTION ON UNIT * » II

1 • CN '.I2.'/’ »12.'/'.I2»' AT '.lE.'t'.IE.'l'tlEI

WR ITE( ITYP* 1005)

1005 FORMATOHO* 'ENTER STARTING ANGLE FOR THE RUN-F7 • 3- lOEF AULT=5 .01 • ) READ! IRO, 1010 )EANG( lUNIT)

1010 F0RMAT(F7.3)

C

C ROUND BANG TO *005 DEGREES

C

BANG! 1UNIT)=FIXANG( BANG!1UNIT» ) C

C SET DEFAULT VALUE FOR BANG

C

IF! BANG! lUNIT) .LT* 0* 1 ) BANG! lUNIT ) » 5*0

C

C

74
76

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

1 12

113

114

115

116

117

118

1 19

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

1 46

147

148

TANG(IUNIT) s BANG(IUNIT)

C

C BEGIN SLEWING TO THE STARTING ANGLE.THEM RETURN TO 100 TO CONTINUE

C INPUT WHILE DIFFRACTOMETER IS MOVING TO TANG-10 STEPS

C

ITRANSI lUNIT* U * 6

ITRANSI IUNITt2) » 3 MODE! IUNIT*3S a 2 GO TO 999

C

C MOTOR IS NOW MOVING - GET THE RUN PARAMETERS

CiOO CALL FILEUPC2UNIT»n

C

C SET RUN PARAMETERS FOR FIXED TIME COUNTING

C IN STEP SCAN MODE

C IPK(IUNIT) » 0

FIXERRUUNIT) a 0*0

C

C READ ENDING ANGLE. STEP SIZE. COUNT TIME AND SPEED

C

120 WRITE! ITYP. 1020»

1020 FORMAT! IHO. 'ENTERIEND ANGLE* STEPS 1 ZE. COUNT T1ME!SEC)'

I .* .METHOD. MAXCCUNTS UNDER DEFAULT VALUES'/

3 IH .'90.000 0.020 1.0 0 32700')

READ! IRO. 1022 JEANG! IUNIT)»DAN6! lUNITl.TIME! lUNlT)*

1 MVCNT! IUNIT).LIMCNT!IUN1T)

1022 FORMAT! 2F7. 3. F7. 1 . 13.16)

C

C SET THE DEFAULT VALUES

C IFCEANG! IUN1T1.lt. O.IJEANG! lUNIT) s 90.0

IFjDANG! IUNIT1 .lt. 0.00510ANG! lUNIT) = 0.02

IF! TIME! lUNIT ) .LT. 0.01 J TIME! lUNIT ) = 1.0

IF! LIMCNT! IUNIT) oEQ.OlLIMCNT! lUNlT) - 32700

C

C SET ANGLES AND CCUNT TIME TO MULTIPLES OF INTERFACE UNITS

C DANG! IUNIT) = FIXANG! DANG! IUNIT) I EANG! IUNIT) = FIXANG! EANG! IUNIT) ) TIMEIIUNIT) = FIXTIMITIMEC IUNIT). MVCNTIIUNIT))

CC COMPUTE THE RUM TIME AND OUTPUT

C DELTA = (EANGUUNIT) - BANGIIUNIT)) / DANG! IUNIT)

IF(DELTA.GT.0.0)G0 TO 130

WRITE! ITYP. 1025)

1025 FORMATCIHO, • ILLEGAL EANG-MUST BE > BANG')

GO TO 120

130 RUN = DELTA * ( T IME < lUN IT ) +.22 ) / 3600.

C note: a PRECISE CCMMUNICATION TIME FACTOR MUST BE MEASURED AND

C INSERTED HERE. A TEMPORARY VALUE OF .21 SEC WILL BE USED FOR NOW

C******************** *************** ************* ***1^^*^^^***** **************

CC READ THE CODES FOR THE INTERNAL STANDARDS USED

C WRITE! ITYP. 1045)

1045 FORMATCIHO, 'ENTER 2 LETTER COOES FOR UP TO 3 INTERNAL STANDARDS')

READ! IRO, 1048 ) ISTO

1048 F0RMATI3A2)

10 = ITYP

125 WRITECIO.IQOO) lUN I T , IDAT , ITI

M

WRITE! IDeI031 ) ! I T 1 TLE ! I ) , 1=1 , 39

)

1031 FORMAT! IH ,39A2)

WRITE! ID, 1031 ) ! ITITLE! I }. 1=41 .50)

WRITE! ID, 1032) (NAME ! 1) , I = I , 6 ) , ISTD

1032 FORMATIIH OUTPUT F ILE : '.6A1/1H STANDARDS: ' 3! 2X.A2 )

)

WRITE! ID.1030)BANG( lUMIT) .EANG! lUNITl.OANG! lUNITl.TIME! IUNIT)*

i MVCNT! IUNIT) .LIMCNTUUNIT) .RUN

1030 FORMAT! IH ® 'BEGIN ANGLE = ' .F8.3/

1 IX, 'END ANGLE(OEG)=»oF7.3/

2 IX, 'STEP SI2E(0EG)=»,F7.3/

75
149 3 lX.'CNT TIME(SEC) »' tF7«3/

ISO 4 lX.'MVCNT METHOD «'tl7/

ISl 4 IX, 'MAX COUNTS =',I7//

152 5 IX, 'RUN TIME(HRS) «=',F7.3)

1S3 1F(I0 .EQ. IPRT) GOTO 140

154 WRITE! ITYP,1034)

155 1034 FORMATdHO# 'CORRECTIONS? Y/N* ) 156 READ! IRD, 1040) lY

157 1040 FORMAT(Al)

156 1F(IY .NE, 'N'lGOTO 100

159 WRITE! 1TYP,10A2)

160 1042 FORMATUH .* PR I NT .INPUT? Y/N')

161 READ! IRO, 1040) lY

162 IF!IY .NE, 'Y') GOTO 140

163 ID - IPRT

164 GOTO 125

165 C 166 C SET THE NUMBER OF PEAK AND BACKGROUND POINTS

167 c 168 140 NB6!IUNIT) = 0

169 NPK!IUNIT) = IFIX2!DEI.TA * 1.5 ) 170 c 171 c COMPUTE THE NUMBER OF CYLINDERS REQUIRD TO STORE THE FILE

172 c ON THE XEBEC DISK. 16 DATA POINTS PER 128 CHARACTER RECORD AND 96

173 c RECORDS PER CYLINDER ! 16496=1 536)

.

174 c 175 ISIZE = IF1X2!DELTA/1536«0 * 1.0)

176 c 177 c NOW ALLOCATE THE OUTPUT DATA FILE

178 c 179 ID = ID ISK! 1UNIT.2)

180 CALL ALCT! IUNIT,1D,1S1ZE)

181 c 182 c CALCULATE THE HOUR THE RUN IS GOING TO END

183 c 164 CALL ENTIM! IUNIT,RUN)

185 c 186 c WRITE THE RUN PARAMETERS TO THE OUTPUT FILE

187 c 188 WRITE! ID, 1050 >EANG! lUN I T ) , E ANG ! lUNI T ) , DANG! lUNIT) • 189 1 RATE!IUN1T), M VCNT! lUN IT ) , LI MCNT ! lUN IT ) , I STO,TI ME! lUNIT)

190 1050 FORMAT ( F7.3* 7X t 2F7* 3 •F4.1 . 1 1 . 1 2Xt 15 «3A2 t48X ,F7.2)

191 C 192 c NUMBER OF RECORDS WRITTEN ON OUTPUT FILE

193 c 194 NREC! lUNIT) = 6

195 c 196 c SET STATUS TO DUAL

197 c 198 IRUN!IUNIT) = 2

199 ITOT! lUNIT) = 0

200 c

201 c NOW CHECK IF SLEW HAS COMPLETED - IF NOT HAVE ENSLEW WAIT FOR IT 202 c 203 MODE! IUNIT.7) = 0

204 c 205 c TEST IF SLEW REQUEST RESULTED IN ZERO STEPS. IF SO CALL ENSLEW TO

206 c MOVE UP 10 STEPS TO REMOVE GONIOMETER BACKLASH

207 c 208 IF! IZRST! lUNIT) .EQ. 1) MODE! lUNIT ,7) = 2 209 c 210 CALL ENSLEW! lUNIT, lERROR)

211 IF! lERROR.EQ. 1 ) GO TO 999

212 c 213 c NOW WE BEGIN DATA COLLECTION BY CALLING STEP SCAN ON COMPLETING

214 c IT WILL PUT THE FINIS ADRESS CN THE STACK

215 c 216 ITRANS! lUNIT, 1) * 4 217 c 218 c PUT MODE FOR CALL TO STEPSCAN

219 c 220 MODE! IUNIT,4) = 1 221 IF!MVCNT! lUNIT) .EQ. 1 ) MODE! lUN I T.4) = 3

222 999 RETURN

223 END

76
1 c. 23 C

SUBPCU71NE GU4NT(1UN1T)

4 c 5 c THIS GENERAL DATA COLLECTION SUBROUTINE ALLOWS FOR FIVE MODES

6 c OF DATA CCLLECTICN• THREE ARE FOR QUANTITATIVE ANALYSIS AND TWO ARE

7 c FOR SELECTED AREA DATA COLLECTION# THEY are:

8 c 9 c INTERNAL STANDARD METHOD ( IFLAGC IUNIT«3) » 1)

10 c INTENSITY RATIC METHOD C IFLAGI lUN IT «

3

) » 2)

11 c SPIKING METHOD ( IFLAGC lUNlT* 3) a 3)

12 c PEAK AND INTEGRATED INT* ( 1FL.AG( ZUNIT* 31 a 4)

13 c CALIBRATICN (IFLAGC IUNIT.31 a 5}

14 c IS c note; INTENSITY AND CALIBRATICN DATA COLLECTION IS IDENTICAL. THE

16 c DIFFERENT IFLAG VALUES ARE ONLY FOR PURPOSES OF ANALYSIS OF THE

17 c RAW DATA. GENERALLY THE PEAK AND INTEGRATED INTENSITY MODE WILL BE

18 c USED FOR DETERMINATION OF RELATIVE INTENSITIES

19 c 20 c MODE! IUNIT*2) = 1 BEGIN OF QUANT RUN. SET UP FILES

21 c a 2 RETURN FROM INITIAL SLEW tSETUP FILES

22 c * 3 RETURN FROM STPSCN

23 c = 4 RETURN FROM SLEW- INTRUP-ENSLEW-ESTIM

24 c 25 IMPLICIT INTEGER42 < I-N

)

26 INTEGER** NBSt INTR

27 c 28 COMMCN /ANG/ 8ANGC2)

«

CANGC2). 0ANGC2).

29 1 EANG(2), IRATEC2}

«

PANGC2). RATEC2).

30 2 TANG(21* IZRSTC2)* NPTPKC 21 31 c 32 COMMCN /BUFF/ 1ALPHC661* NAMECtS)

33 c 34 COMMCN /CNTL/ IACTC2)

I0BUG(2)

.

INTR.

35 1 1RUN(2)« ITRANSC2.20I

M00EC2 .20)

.

MVCNT(2)

36 c 37 COMMON /COUN/ ICNTC2.161

.

IPTC2)

.

1TOTC2).

38 1 LIMCNT(2)« ISAVEC2)

39 c 40 COMMON /lO/ NBSc lOT. I CLOCK.

41 1 I SPECIRO» IPRT. ITYP.

42 2 I0ISK<2«2)« IFIN. IFOUT

43 c 44 COMMON /PROB/ IDAT(3)

1FLAGC2.10} . ITIMC3).

45 1 1TITLE<50I

46 c 47 COMMCN /RNOT/ NRECC2)

.

NMFILC2.61

.

ITRC2)

.

48 1 IENRN(2t 4)

49 c SO COMMON /QUAN/ CCNC. FREU. lOVLP.

51 1 KOOE* LOOP C 2)

«

LPK(2)

.

NUMC2 .20)

.

52 2 SIGSTD* STD. STORELt IREPTC2)

S3 c 54 COMMCN /TIM/ BKGTI MC2)

FIXERRC2)

.

IPKC2)

.

55 1 NBG(2)« NPKC21. T1MEC2). TIML1MC2)

56 c 57 DIMENSION NAM(3 )« JKLC3)

58 c 59 DATA lEL/* •/

60 c

61 444 444444444444444*44444 4*4 4 *44*444444444 4*444444444 4444 4444444:

62 c 63 c POP QUANT ADDRESS OFF OF THE LIFO STACK

64 c 65 lERROR = 0 66 CALL POPtIUNIT,1 I ERROR!

67 c 68 c BRANCH TO APPROPRIATE SECTION BASED ON THE MODE FLAG

69 c 70 IGOTG = MODE! IUNIT.21

71 GO T0( 100tll0.300.40O)tlG0TO

72 c 73 c THIS IS THE BEGINNING OF A QUANT RUN - SET UP THE FILES

74 c CLEAR TOTAL RUN TIME

77
75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

1 12 113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

1 39

140

141

142

143

144

145

146

147

148

1 C100 IRUN(IUNIT) = RUN = 0*0

WRITE! ITYP, 1000 ) lUNlT

1000 FORMAT! IHO* 'QUANT ANALYSIS DATA COLLECTION ON UNIT W* « II

}

C SET RUNNING FLAG

C ITRIIUNIT) = 3 CC GET ThE APPROXIMATE STARTING ANGLE OF THE RUN

C WRITE! ITYP, 1005)

1005 FORMAT! IHO, 'ENTER APPROXIMATE STARTING 2-THETA !F7.3)>)

READ! I ROt 1080 )EANG! lUNIT)

CC SET UP THE LIFO STACK TO BEGIN THE SLEW TO BANG

C TANGIIUNIT) = EANG!IUNIT)

MODE! lUNIT* 2) = 2 1TRANS!IUNIT, 1) = 6

ITRANS! IUNIT,2) = 2 GO TO 999

C

C GET THE NAME OF THE RUN FILE

C110 10 S lOISK! lUMT.l)

WRITE! ITYP.lOlO)

1010 FORMAT! IHO ,' BUN FILE ALREADY EXIST? Y/N'J

REA0!1R0, 1020 ) lY 1020 FORMAT! Al) IF! 1Y.EQ*'Y')60 TO 120

CC CREATE. A NEW STANDARD FILE

C CALL STDFIL! lUNlT)

GO TO 130

C

C ACTIVATE TFE EXISTING DATA FILE

C120 CALL FILNAM!2)

ENCODE! I ALPH, 10 EO) ! NAME! I ) ,1=1 ,6) , ID 1050 FORMAT!'AC ' • 6A1 . ' ,

' ,Z1

)

CALL SYSTEM!IALPH,11)

CC READ IN THE RUN FILE

C130 READ! ID* 1060) !ITITLE!I ) ,1 = 1.50) .lOATtlTlM,! IFLAG! lUNI T * I ) , I=I , 10

)

1C60 F0RMAT!S6A2 .1 Oil

)

ISIZE =1

LINES = O

C

C READ THE INSTRUMENT SPECIFICATION PARAMETERS

C135 DO 137 1=1.4

READ! ID. 1072) !1 ALPH! J) .J=l .64)

1072 F0RMAT!64A2)

ISIZE = ISIZE 1 137 CONTINUE

CC SKIP THE EMPTY CHEMICAL COMPOSITION OF THE UNKNOWN RECORD

C138 READ! ID, 1072)

CC INPUT THE NUMBER OF REPETIONS AND MOUNTINGS FOR THIS SAMPLE

C WRITE! ITYP, 1040)

1040 FORMAT! IHO, 'enter: tt OF REPETIONS. W OF MOUNTINGS !2I1)')

REAC!IRD.104S)IFLAG! lUNIT.S). IFLAG! 1UNIT,6)

1045 FORMAT!2Il)

IF! IFLAG!IUNIT.5)>EQ«0) IFLAG! lUNIT.S) =1

IF! 1FLAG!IUNIT.6)«EQ*0) IFLAG! IUNIT.6)=1

C

C WHICH LINES ON THE RUN FILE ARE TO BE DETERMINED?

78
149

150

lei

ISS

153

1S4

155

156

157

168

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

163

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

C (ALL LINES TO BE MEASURED IF 1-REL OR CALIBRATION RUN

C

1F( !FLAG( 1UNIT.31.GT.3) GOTO 140

WRITE! ITYP, 1100)

1100 FORMAT! 1H0« 'ENTER THE NUMBER OF EACH LINE TO BE MEASURED*/

1 IH • *DEFAULT«ALL LINES (2012)*)

READ! ZROtl 1 10) (NUM! lUNlT » 1) . 1 « 1 « 20)

1110 FORMAT (201 2)

IF(NUM( lUNXT* l)eGT»0)G0 TO 140

DO 139 l«l«20

139 NUMdUNIT*!) » X CC NOW READ THE LINE INFORMATION

C140 CONTINUE

REAO(IOtl0 80tEND3:iaO)BANG(XUNIT)«PAN6(IUNIT)*EANG( IUNIT)«

1DANG(IUNXT)«RATE( lUNIT) «MVCNT( lUNIT) tTZMLlM( lUNITl tF IXERR ( lUN IT)

2 LIMCNT! lUNlT) tNAM.JKL«KOOE.IOVLP*IPK(lUNlT)*NPK( lUNlT)*

3 NBG( lUNIT) »FREL.STOREL.STO.SIGSTO

1080 FORMAT (4F7.3«F4.1. 11, F7.3.F5«2t IS. 6A2.3I 1.21 2tF6. It

1 F4.1.F9.4.F8.4.F6.3.2F7.2)

LINES a LINES 1 C

C TEST IF THIS LINE IS TO BE MEASURED* IF SO THEN ADO TO 0 RECORDS

C AND ESTIMATED RUN TIME

C

DO 144 1=1.20

IF(LINES.EQ*NUM(1UNIT.I ) ) GOTO 148

144 CONTINUE

C NO MATCH - DO NCT MEASURE THIS ONE

GOTO 170

C

C COMPUTE THE NUMBER OF OUTPUT RECORDS NEEDED FOR THIS PEAK

C148 IF( IPK! IUN1T)*EQ*0)GC TO 150

CC THIS IS A PEAK CCUNTED LINE

C IREC = NPK(IUNIT) NBG(IUNIT)

C

C IF A SECOND BACKCRCUND WAS REQUESTED ADD ANOTHER NBG

C IF(EANG( 1UN1T)*GT*0*0)IREC = IREC NBGUUNIT)

IREC = IREC/16+1

GO TO 160

CC THIS PEAK WILL BE COUNTED IN INTEGRATE (STEP SCAN) MODE

C

150 IREC = (EANG(IUNIT) - BANG! lUNlT) )*200* / 16. .999

160 1SI2E = IS12E + IREC + 2 C

C ADD MAXIMUM RUN TIME FOR THIS LINE TO THE ESTIMATED TOTAL TIME

C

RUN = RUN TIMLIM! lUNJT)

C

C NOW READ THIS LINES RECORD NUMBER 8

C170 READ(ID,1072) ( I ALPH ( J ) , J=1 ,64

GO TO 140

CC WE CAN NOW CALCULATE THE SIZE OF THE OUTPUT FILE AND ALLOCATE

C IT ON THE BASIS CF 96 RECORDS PER CYLINDER

C MULTIPLY CALCULATED NUMBER OF RECORDS BY THE NUMBER OF

C REPEATS (IFLAG! *5J) AND THE NUMBER OF MOUNTINGS ( 1FLAG( ,6))

C

180 ISI2E = IFLAG{IUNIT,5>*IFLAG( IUNIT,6)*ISI2E

isize = lSIZE/96+1

CALL FILEUP! lUNIT.l)

CC ALLOCATE THE FILE AND WRITE THE FIRST 5 RECORDS

C CALL ALOT( lUN IT .IDISK( IUNIT.2) .ISIZE)

C

C MULTIPLY ESTIMATED RUN TIME BY THE NUMBER OF REPETIONS AND

79
223

224

225

226

227

226

229

230

231

232

233

234

23S

236

237

236

239

240

241

242

243

244

245

246

247

246

249

250

251

252

253

254

255

256

257

256

259

260

261

262

263

264

265

266

267

266

269

270

271

272

273

274

275

276

277

278

279

280

261

262

263

264

265

286

267

266

289

290

291

292

293

294

295

296

C MOUNTINGS. CONVERT FORM MINUTES TO HOURS. THEN SAVE THIS VALUE

C RUN = IFLAGI IUNIT.51 IFLAGd UN IT . 6 ) * RUN/60.0

CALL ENTIMC lUNIT.RUN)

C . C IF ELEMENTAL CCMFOSITICN CONSTRAINTS ARE GOING TC BE USED

C ENTER THE CCMPCSITICN OF THE UNKNOWN OR STANDARD

C

J S o

IF( lFLAG(IUNiT«4).EQ.0)G0 TO 190

I = 1 J = 30

185 WRITE( ITYP. 1C90

>

1090 FORMAT! IHO, 'ENTER SAMPLE COMPOSITION AS ELEMENT SYMBOL* • I'WEICHT X* SIGMA'//

3 'ELI.000 0.10EL2.000 0.20EL3.000 0.30EL4.000 0.40EL5.000 '* 4 '0.50')

READ! IRO* 1072) (IALPH(K)«K=I«J)

IF! J.EQ.60 )G0 TC 190

WRITE! ITYP.1C95)

1095 FORMAT! IHO. 'MORE ELEMENTS!UP TO 5) 7Y/N')

READ! IRD.1020)IY

IF! lY.NE.'Y • ) GO TO 190

I = 31

J = 60

GO TO 185

cc BLANK CUT THE PEST OF THE lALPH ARRAY

c190 1 = J + 1 DO 200 J=I *64

200 1ALPH!J) = IBL

C

C WRITE RECORD 6 ON THE OUTPUT DATA FILE

C ID = ID ISK! lUMT .2)

WRITE!ID*1072) ! I ALPH ! J ) « 1 *64

)

C

C W OF RECORDS ON CUTPUT FILE

C NREC(IUNIT) = 6

C

C CHECK THAT SLEW IS FINISHED OR WAIT FOR IT

C IF ZERO STEP SLEW WAS CALLED SET ENSLEW MODE

C220 MODE! IUN1T.7) = O

IF! IZRST!IUNIT).EQ.l> MODE ! lUN IT. 7) = 2 CALL ENSLEW! ILNIT.IERROR)

IF! lERROR.EC. 1) GO TO 999

C

cc

C ++++++ + * + + + + + ++ + + + + + ++-«-+ BEGIN QUANT RUN F+++++ + ++++++++++ ++++ C

CC WE ARE NOW READY TC BEGIN THE QUANTITATIVE ANALYSIS

C WE START BY INITIATING A LOOP OF IFLAG ! lUN IT . 6 ) MOUNTINGS

C AND IFLAG! lUNIT.S) REPETICNS OF THE UNKNOWN OR STANDARD

C REQUEST THE MOUNTING OF THE SAMPLE

C LOOP! lUNIT) = O 230 LOCPIIUNIT) = LQCP!1UNIT) + 1 IF!LnOF!IUNlT).GT.IFLAG(IUMT.6))Ga TO 500

WRITE! ITYP, IX 20) LOOP! lUNIT) , lUNIT

1120 FORMAT!lHO, 'PLACE SAMPLE # ',11.' ON UNIT ',11,

1 IX, 'WHEN READY HIT RETURN. ENTER I TO STOP')

READ! I RD, 1045) I SKIP

I F ! I SK I P. EQ. 1 ) GO TO 500

C

C REQUEST WTX OF REFERENCE OR SPIKING PHASE

C CONC = 100.0

1 = IFLAG! lUNlT, 3)

GO T0!232 .238.232,238.236) , I80
297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

C INTERNAL STANOARC OR SPIKING METHOD - ENTER CONCENTRATION OF PHASE

232 WRITE! ITYP,23A)

234 FORMAT! IHO. 'ENTER WTX OF REFERENCE OR SPIKING PHASE(F7 .3) •

)

REACCIRO. 10801 CCNC

CC INITIALIZE THE REFETICN COUNTER

C236 IREPTI lUNITJ a 0 C

C INITIALIZE THE POINTER OF THE NEXT LINE TO BE ANALYSED

C240 LPK(IUMT) = 0 IREPTCIUNIT) = IREPTtlUNlT) + 1 IF! IREPTUUNITl.GT. IFLAG( lUNIT.Sn GOTO 230

C

C IN RE>RUNNING A SAMPLE WE REWIND THE RUN FILE AND RE EXECUTE IT

C _

lb' * IDISK! lUMTtU

REWIND ID

C

. C SKIP OFF TFE FIRST 6 RECORDS

C DO 250 1=1 .6

READ! ID* 1072)

250 CONTINUE

CC WE ARE NOW READY TO ANALYSE THE NEXT LINE ON THE RUN FILE

C THIS IS THE ENTRY POINT ON RETURNING FROM STPSCN OR PKSCN

C300 LPKIIUNIT) = LPKUUNIT) + 1 CC ZERO THE COUNTER OF THE POINT NUMBER BEING MEASURED

C ITOT! lUNlT) = O

CC READ A LINE FRCM THE RUN FILE. ON END OF FILE BRANCH TO NEXT REPET ION

C

ID = lOISKCIUMT .1 ) READ! ID* 1080(EN0=240)BANG!IUNIT) .PANG! 1UN1T)«EANG!1UNIT)«

lOANG.! I UNIT). RATE! I UN IT) ,MVCNT! I UN I T ) .T I ML I M ! lUNIT ) « FI XERR ! I UN IT ) • 2 LSMCNT! lUNlT) ,NAM , JKL . KODE . I O VLP . I FK! lUNIT) «KPK! lUNIT).

3 NBG! lUNIT) .FREL.STDREL.STO.SIGSTO

CC READ THE ASSOCIATED RECORD NUMBER 8

C READ! ID. 1072) ! I ALPH ! J ) , Js-l , 64 ) CC IS THIS LINE TC EE MEASURED?

C ! IF I-REL OR CALIBRATION RUN THE MEASURE ALL LINES)

C IF! IFLAG! lUNl T»3).GT.3) GOTO 330

DO 320 1=1.20

IF!LPK! IUN1T).EQ.NUM!IUNIT.1) )G0 TO 330

320 CONTINUE

CC NO - SKIP TO NEXT LINE

C GO TC 300

CC YES IT IS

C l« SLEW TO BANG

C 2. WAIT FCR INTfiUP C 3. CALL ENSLEW

C 4. CALL ESTIM TO DETERMINE THE OPTIMUM AMOUNT OF TIME TO SPEND

C COUNTING THE PEAK AND BACKGROUND REGIONS

C 5. RETURN TO OUANT

C330 TANG(IUNIT) = BANGIIUNIT)

ITRANS! lUNlT. 1 )=6

ITR ANSI I UNIT, 2) =12

ITRANSI IUNIT.3) =7

MODE! IUN1T.7) = I ITRANS! XUNIT, 4)=13

MODE! lUNIT, 13 )=C

81
371

373

373

374

375

376

377

378

379

380

381

383

383

384

385

386

387

388

389

390

391

393

393

394

395

396

397

398

399

400

401

403

403

404

405

406

407

408

409

410

411

413

413

414

415

416

417

418

419

430

431

ITRANSC lUNIT# 5» =3

H00E( IUNIT.3) = 4 GOTO 999

C

C WRITE LINE COLLECTION PARAMETERS TO OUTPUT FILE

C400 10 = 10 ISK( IUMT«3)

WRITE! ID t 1080 )BANG( lUNIT) .PANG! lUNIT) «EANG( lUNIT)

•

10ANG( lUNIT) .RATE! lUNIT) tMVCNT! lUN IT ) «T 1 ML IM ( I UN IT ) «F IXERR! lUNIT).

3 LIMCNT! I UN IT) «N AM . JKL. KOOE « 1 OVLP « I PK( lUNIT) .NPK( lUNIT )« 3NBG( lUNIT) «FREL.STOREL« STOtSI GSTO.CONC . TIME ( lUNI T ) t BKGT IM( lUNlT)

WRITE(JD*1073)( IALPH( J) tJ=l*64)

C

C » OF OUTPUT RECORDS

C NREC( IUNIT)=NREC( IUNIT)+3

C

C RESET IPT(IUNIT) AS IT WAS USED BY ESTIM

C IPT(IUNIT) = O

CC TO BEGIN CATA COLLECTION WE NOW NEED ONLY TO CALL STPSCN OR PKSCN

CC TRANSFER SEQUENCE: . STPSCN OR PKSCN AND QUANT

C ITRANS(IUNIT*3) - 3

M00E(1UNIT«3) = 3

C

C BRANCH BASED CN COUNT MODE

C XFI IPK(IUNIT)»EQ«1)G0 TO 450

CC SET TO CALL STPSCN FOR INTEGRATED COUNTS

C MOOE(1UNIT*4) = 3

ITRANS(IUNIT.l) =4

GO TO 999

C

C SET TO CALL PKSCN FOR PEAK COUNTING

C450 MODE! lUNlT* 5) = 1 ITRANSdUNIT* 1) = 5 GO TO 999

C

C END OF QUANT RUN - <ALL FINIS

C500 MODE! IUNIT« 10) » 3

MODE! lUNITt 3) = O

ITRANSI lUNIT* 1) = 10

999 RETURN

END

82
123

4

5

6

7

8

9

10

1112

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

C

SUBROUTINE SETANGC lUNlT

)

C

cC THIS SUBROUTINE SET THE CURRENT ANGLE (IN CANG) INTO

C THE INTERFACE TRACKING COUNTER

C AND ZEROS THE INTERFACE SCALER

C IMPLICIT INTECER42 (I-Nl

INTEGER44 NBS* INTR. NBSAOD* NBSSUB* MASKt MASKLSt ICNTL

C COMMON /ANG/ BANG(2). CANG(2). 0ANG(2).

1 EANG(2).

2 TANG(2)»

IRATE(2)

I ZRST ( 2

)

PANG(2). RATE(2).

COMMON /CNTL/ I ACT! 2)

IDBUG(2). INTR.

1 IRUN(2)t 1 TRANS! 2.20) . M0DE(2.20) . MVCNT(2)

COMMON /IQ/ NBS. IDT. I CLOCK.

1 I SPEC. IRD. IPRT. ITYP.

2 I0ISK(2.2)« IFIN. IFOUT

c DATA MASK/X*40'/t ICNTL/X'OO*/

DATA MASKLS/X»8888*/

CC4 4444444 4*4444444* 44444 444444444*4 444444 444**444 4*444*44*4 4 44444444I44444*

C

C FIRST CHECK IF THE INTERFACE IS PRESENT AND ACKNOWLEDGING REQUESTS

C

C NBSAOD = ADDRESS OF INTERFACE ON NBS BUS - A MULTIPLE OF 4

C N6SSUB = SUBAODRESS OF ONE OF THE 4 REGISTERS ON THE NBS BUS

NBSAOD = lUNIT * 4

NBSSUB = NBSAOD + 2 C

C CLEAR ALL INTERFACE REGISTERS

C CALL CLEAR(N8S. NBSAOD)

CALL CLEARC NES.NBSADD)

C

C CHECK THAT BOARD IS PRESENT AND NOT ACTIVE

C INTR = I ST AT (NBS. NBSAOD)

IF( IAND(INTRtMASK).EQ.MASK)GO TO 100

CC THERE IS SOME PROBLEM WITH THE INTERFACE - PRINT WARNING

C

WRITE! ITYP, 1000)IUN1T.INTR

1000 FORMATOHO, 'SETANG INTERFACE #*.I1.» NOT RE ADY-ISTAT= • . Z4 ) I ACT( IUNIT)s-l ‘ GOTO 999

C

C TEST IF A LIMIT SWITHCH IS ACTIVATED

C100 IF( IAND( INTR.MASKLS) .EQ.O) GOTO 120 . WRITE! ITYP, 1006) lUNIT.INTR

1006 FORMAT! IHO, ‘UNIT* ,12.' LIMIT SWITCH SET. 1 STATUS^* .Z4

)

lACT! lUNIT) = -1

GOTO 999

C

C INITIALIZE THE INTERFACE TO A NON ZERO ADDRESS

C120 INTR = ISTAT!NBS«N8SSUB)

C

C INTERFACE RESPONDS - RESET TO THE FIRST ZERO REGISTER

INTR = ISTAT(NBS. NBSAOD)

CC NOW LOAD THE CONTROL WORD INTO THE FIRST OF THE TWO

C ZERO REGISTERS OF THE INTERFACE

CALL OUTBUSINES. ICNTL)

C

C USE CKANG TO CHECK LEGALITY OF CANG AND TO COMPUTE THE INTEGER

C TRACKING CODE (IE 200 * CANG).

83
75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

nnr»

nnn

ronn

C lERROR » -1

TANG(IUNIT) = CANG(IUNIT)

CALL CKAN6( lUNIT.NSTEPt lERROR)

IF( lERRCR.LE.OlGO TO 200

WRITE! ITYP.IOIOIIUNIT

1010 FORMAT! IHO. *USE OPTION 4 TO RESET UNITl**»l2)

lACT! lUNIT) = -1

GO TO 999

THE CURRENT ANGLE AS ENTERED IS OK - SET IT INTO TRACKING COUNTER

INTR s ISTATIKBS.NBSSUB)

INTR = NSTEP

CALL OUTBUS!NES tINTR)

OPERATICN COMPLETED. SET ACTIVITY FLAG TO INACTIVE

lACT! IUNITI=0

CLEAR THE INTERFACE COUNTER REGISTER

NBSSUB = NBSSUB -I- 1 CALL CLEAR! NES.NBSSUB)

999 RETURN

END

84
1a3

45

6

76

9

10

111213

14

42

43

44

45

46

47

48

49

50

5152

53

54

55

56

57

58

59

60

6162

63

64

65

66

67

68

69

70

7172

73

74

subrojtTnk stpscnTIunit*nstepT

c SUBROUTINE STEP SCAN COLLECTS FIXED TIME COUNT DATA STARTING

AT BANG AND ENDING AT EANG STEPPJNG BY DANG BETWEEN POINTS.

QUANTITATIVE ANALYSIS INTEGRATED SCANS ARE SIMPLY THE SUM OF

THE INTENSITIES COLLECTED AT EACH POINT IN THE PROFILE

DEFINED BY BANG AND EANG

AFTER EACH SET OF 16 DATA POINTS ARE COLLECTED THEY ARE WRITTEN

TO THE OUTPUT DISK FILE.

15 C WHEN EANG IS REACHED FINIS IS CALLED TO SAY 0YBY

16 C

17 c

18 c 19 c 20 IMPLICIT INTEGER+2 ( I-N)

21 INTEGER*4 NBS, INTR

22 c 23 COMMON /AN6/ BANG! 2)

CAN6(2) . OANG( 2 ) , 24 1 EANG(2), 1 RATE<2»

,

PANG(2 )t RATE! 2).

25 2 TANG(2), IZRST(2)

,

NPTPKI2)

26 C 27 COMMON /CNTL/ IACT(2)

,

10BUG(2) . INTR,

28 1 1RUN(2). ITRANSI 2.20)M0DE(2 ,20) • MVCNTI 2)

29 c 30 COMMON /COUN/ 1CNT( 2,16), IPT(2)

,

ITOT( 2

)

, 31 1 LI MCNT< 2) , I SAVE(2)

32 C 33 COMMON /lO/ NBS, IDT, I CLOCK,

34 1 ISPEC. IRO, IPRT» ITYP.

35 2 I0ISK(2,2). IFIN, IFOUT

36 C 37 COMMON /RNDT/ NREC(2)

,

NMFILI 2,6)

,

1TR(2)

,

38 1 IENRN(2,4)

39 c 40 COMMON /TIM/ BKGT1M<2). FIXERRI2), 1PK(2 ) . 41 1 NBG(2)« NPK<2). TIME(2)

TIMLIMI2)

CCC**********Jt‘***************************************3i‘**********************

C ' c

c

c

cc

c

c

cc

ccc

cc

c

c

cccc* ***********

**,H*+**^**l(:y:jtJj;*,it*:(t****»*4-***4,* **4*4 .H ****>jc + *** ***** *

C POP THE STPSCN ADDRESS OFF THE TRANSFER TABLE

C

1 ERROR = 0 CALL PCP( lUN IT, lERROR

)

C

C MAKE END ANGLE A MULTIPLE OF 0.005 DEG FOR CHECKING AGAINST TANG

C CALL F IXANG(EANG( lUNIT)

**FOR MVCNT=0**

MODE (I UNIT, 4) = 1 FOR BGMOVE COMPLETED. CALL ENMOVE THEN B6CNT

= 2 COUNTING COMPLETED SO CALL ENOCNT THEN BGMOVE

=3 AT BANG. BEGIN WITH COUNTING. DO NOT CALL

ENMOVE.

**FOR MVCNT=1**

= 3 FIRST CALL TO SIMULTANEOUS COUNTING AND STEPPING

SET UP CONTROL WORD, NSTEP AND IRATE BY CALLING

BGMOVE

= 4 SUBSEQUENT CALLS FDR SIMULTANEOUS COUNTING AND STEPPING

CALL ENMOVE TO CHECK COMPLETION OF MOVE. TO READ COUNTER

AND INITIATE. THE NEXT MOVE

85
75

76

77

78

79

80

8182

83

84

I 85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

1 07

108

109

110

111 112

1 13 114

115

116

117

118

119

1 20

121 122

123

124

125

126

127

1 28

129

130

1 31 132

133

134

1 35

136

137

1 38

1 39

140

141 142

143

144

145

146

147

148

CC ORANCH BASED ON THE VALUE OF THE MODE FLAG

C IGOTO = MOOE( IUNIT.4)

GO T0( 300t400«310. 300) « IGOTO

CC THIS IS THE NORMAL STEP AND COUNT SECTION WHERE MOST OF

C THE ENTIRE DATA COLLECTION PROCEDURE OCCURS.

C

C IF THIS IS THE FIRST ENTRY GO STRAIGHT TO BEGIN COUNTING

C300 IF( ITOT<IUNIT).EO.O)GO TO 310

C

C CHECK THAT THE PREVIOUS MOVE OPERATION COMPLETED NORMALLY

C MODE( IUNIT.8) = 1 CALL ENMOVEI lUNIT. lERROR)

IF( lERROR.EQ. 1) GO TO 999

C

C IF PATTERN COLLECTION SET MODE! .9)=1 TO FLAG USE OF TIME(IUNIT)

C IN CALCULATION OF COUNTING TI ME< M VCNT=0 ) OR DRIVE RAT E( M VCNT=l

)

C310 MODE! IUN1T.9) =1

IF( IRUN(IUNIT) .EQ.2) GOTO 316

C

C QUANTITATIVE ANALYSIS RUN.

C BEGIN COUNTING THE NEXT DATA POINT FOR TIME(IUNIT) SECONDS

C OR BKGTIMI lUNIT) SECONDS IF IT IS A BACKGROUND POINT

C IF NEXT POINT IS AT PEAK SET MODE ( I UN IT, 9 ) TO 1 C IF NEXT PCINT IS ON BACKGROUND SET MODE! lUNlT, 9) = 2 C

IF( ITOT( lUNIT) .LT.NBGI lUNIT) .OR. ITOTI lUNI T) .GE.

1 NPTPK(IUNIT) + NBG(IUNIT) )M0DE(IUNIT,9) = 2 C

C IF SIMULTANEOUS STEP AND COUNT FLAG IS SET THEN SET FLAG TO SAVE

C COUNTS AT END OF ENMOVE AND SET ENMOVE MODE TO INITIATE THE NEXT MOVE

C316 IF(MVCNT( lUNIT) .EQ.O) GOTO 320

ISAVEI lUNIT) = 1 MODE( IUNIT.4) = 4

GOTO 450

C

C CALL sequence; BGCNT, INTRUP. STPSCN

C320 CALL PUSH! IUNIT.4)

MODE! lUNITe 4) = 2 CALL PUSH! IUNIT.12)

CALL PUSH! lUN IT .9)

GO TO 999

CC COUNTING IS COMPLETE - CHECK FOR NORMAL TERMINATION

C AND READ OUT THE COUNTER

C400 MODE! IUNIT.4) = 1 MODE! IUNIT.6) = 1 ITOT(IUNIT) = ITOT(IUNIT) + 1 IPTUUNIT) = IPKIUNIT) + 1 CALL ENOCNTI lUNIT.IERROR)

1F( lERROR.EQ. 1 ) GO TO 999

C

C IF THAT WAS THE 16TH POINT WRITE THEM TO OUTPUT FILE

C450 IF( IPT(IUNIT).LT.16)G0 TO 458

CALL WRFILEI lUNIT)

C

C INCREMENT TARGET ANGLE AND TEST IF WE ARE FINISHED

C458 TANG(IUNIT) = CANG(IUNIT) + DANG(IUNIT)

CALL CKANGI lUNIT.NSTEP. lERROR

)

IF( lERROR.EQ. 1) GO TO 459

IF< (TAN6( 1UNIT)-EANG< lUNIT) ) .GT.«-0. 0005) GOTO 500

GOTO 460

CC CALL FINIS - ERROR DETECTED IN CKANG

86
149 C 150 459 MOOE( lUNIT. 10) * 1 151 ITRANSI lUNlT, 1) = 10

152 GOTO 999

153 C 154 C NOT DONE NOR FOUND ERROR IN TARGET ANGI^. SET STACK POINTER

155 c TO RETURN TO STEP SCAN FOR NEXT POINT

156 c 157 460 CALL PUSH( IUNXT.4)

158 C 159 c SET UP IRATE(IUNIT)

160 c

161 1F(MVCNT( lUNIT) .EQ. 1 ) GOTO 470

162 c INDEPENDENT STEP AND COUNT MOVE AT RATEIIUNIT)

163 IRATE! lUNIT) = IF1X2(30.0/RATE( lUNIT )

)

164 GOTO 480

165 c SIMULTANEOUS STEP AND COUNT MOVE AT DANG/TIME

166 c 167 470 TEMPRY = TIME(IUNIT)

168 IF(MODE( IUN1T.9) .EQ. 2) TEMPRY = BKGT I M( lUN IT

)

169 C IRATE = 30.0 DIVIDED BY RATE IN DEGREES PER MINUTE (TEMPRY I! 170 IRATE(IUNIT) = 1FIX2C0.54TEMPRY/DANGUUNIT) * 0.5)

171 ITOT(IUNIT) = ITOT(IUNIT) + 1 172 IPT(IUNIT) = IPT(IUNIT) 1 173 C

1 74 C CALL sequence: BGMCVE. INTRUP

175 C 176 460 M0DE< IUNIT.8) = 1 177 CALL PUSH( lUN IT. 12)

178 CALL PLSH( 1UNIT.8)

179 GOTO 999

180 C 181 C STEPSCAN OF BANG TO TANG IS COMPLETED

182 C IF CALLED BY PEAK SCAN RETURN TO IT VIA ITRANS FLAG

183 c 184 500 1F< 1PK< lUNlT) .EQ. 1 ) GOTO 999

185 C

1 86 c WRITE BUFFERED DATA TO COMPLETE DATA RECORD

187 c 188 CALL WRFILEC lUNIT)

189 c 190 c IF PATTERN COLLECTION RUN THEN SET ITRANS CODE TO CALL FINIS

191 c 192 IF( IRUN( IUNIT).NE.2) GOTO 999

193 c 194 c CALL FINIS - PATTERN COLLECTION RUN HAS COMPLETED

195 c 196 CALL PUSH! lUNIT.lO)

197 MODE! lUNlT. 10) = 2 198 c 199 c STPSCN HAS COMPLETED

200 c 201 999 RETURN

202 END

IN SEC.)

NEXT

I

87
SUBROUTINE STOFILI lUNl T

)

3 C_.

4 C

5 C

6 C THIS1 SUBROI

7 c QUANTITATl'

8 c

9 c THE FORMAT

10 c

11 c RECORD 1 : 1 12 c ( 13 c i 14 c i 15 c 16 c RECORD 2-5

17 c

18 c RECORD 6* 1 19 c 20 c RECORD 7* 1 21 c COL 1 - 7

22 c COL 8 -14

23 c COL 15 -21

24 c COL 22 -28

25 c COL 29 -32

26 c COL 33 -40

27 c COL 41 -45

28 c 29 c COL 46 -50

30 c COL 51 -56

31 c COL 57 -62

32 c COL 63

33 c 34 c 35 c 36 c 37 c 38 c COL 64

39 c COL 65

40 c COL 66 -67

41 c 42 c COL 68 -69

43 c COL 70 -75

44 c COL 76 -79

45 c COL 80 -88

46 c COL 89 -96

47 c COL 97 -10

48 c 49 c 50 c RECORD 8* 1 51 c 52 c 53

54

55

THE FORMAT OF THE STANDARD DATA FILE IS AS FOLLOWS*

COL 81-100 OPERATORS NAME

COL 101-106 DATE OF FILE CREATION

COL 113-122 IFLAG - RUN OPTION SELECTION

7* ONE FOR N LINES TO BE ANALYSED < ONE RECORD PER PROFILE)

STARTING ANGLE OF PROFILE OR LOW ANGLE BACKGROUND

2-THETA OF PEAK MAXIMUM

ending angle of PROFILE OR HIGH ANGLE BACKGROUND

STEP WIDTH (NOT USED FOR PEAK COUNTING)

RATE OF MOTION BETWEEN DATA POINTS ( OEGREES/M IN)

TIMLIM THE MAX TIME TO COUNT A LINE IN MINUTES

FIXERR THE PERCENT ERROR TO COUNT TO. IF ZERO

A FIXED TIME COUNT WILL BE PERFORMED

LIMCNT THE MAX NUMBER OF COUNTS TO COLLECT AT A POINT

THE NAME OF THE PHASE

THE H K AND L OF THE LINE (312)

KODE DESCRIBING THE TYPE OF LINE BEING ENTERED

= 1 A LINE BELONGING TO THE UNKNOWN PHASE BEING ANALYSED = 2 A LINE OF THE INTERNAL STANDARD MATERIAL

= 3 A REFERENCE LINE FROM THE SAMPLE HOLDER

= 4 AN AMORPHOUS HALO LINE. NO BACKGROUND POINTS ARE

TO BE MEASURED.

lOVLP THE NUMBER OF OTHER LINES OVERLAPPING THIS ONE

IPK = 0 - STEP SCAN THE PEAK. = 1 - PEAK COUNT MODE

NPK THE NUMBER OF PEAK POINTS TO MEASURE. IN INTEGRATE

SCAN MODE THIS IS NUMBER TO AVERAGE AT MAX FOR PEAK I. NBG THE NUMBER OF BACKGROUND POINTS ON EACH SIDE OF PEAK

RELATIVE INTENSITY OF THE LINE

STANDARD DEVIATION OF THE RELATIVE INTENSITY

STANDARD INTENSITY VALUE (I/ISTD OR IPURE OR I/IREF)

SIGMA OF STANDARD INTENSITY

CONCENTRATION OF ADDED PHASE FOR SPIKING METHOD

OR OF REFERENCE PHASE FOR INTERNAL STD METHOD

OF STANDARD LINES WHEN NEEDED

IMPLICIT INTEGER42 (I-N)

INTEGER44 NBS. INTR

56 COMMON /ANG/ 6ANG(2). CANG(2). 0ANG(2).

57 1 EANG(2). IRATE(2)

•

PANG(2). RATE(2).

58 2 TANG(2). IZRST(2)

59 C

60 COMMON /BUFF/ 1ALPH(66)

•

NAME( 15)

61 C 62 COMMON /CNTL/ IACT(2). IDBUG(2)

.

INTR.

63 1 lRUN(2)t ITRANS(2.20)

•

MODE(2.20)

•

MVCNT( 2)

64 C

65 COMMON /COUN/ ICNT(2.16). IPT(2)

.

ITOT( 2).

66 1 LIMCNT(2). I SAVE! 2)

67 c 68 COMMON /lO/ NBS. IDT. ICLOCK.

69 1 ISPEC* IRO. IPRT. ITYP.

70 2 ID1SK(2.2). IFIN. IFOUT

71 c 72 COMMON /PROB/ lOATO). IFLAG(2. 10)

•

ITIM( 3).

73 1 1T1TLE(50)

74 c 75 COMMON /QUAN/ CONC. FREL. lOVLP.

88
76

77

78

79

80

81

82

83

64es86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

1C7

108

109

1 10

111

112

1 13

114

115

116

117

1 18

119

120

121

122

123

124

146

147

148

149

1 KODE*

2 SIGSTO*

COMMON /TIM/

1 NB6(2).

DATA IBL/' »/

LOOP! 2).

STO*

BKGTIMl(2),

NPK<2)*

LPK(2)

STOPEU

FZXERR(2).

TIME(2)«

NUM(2t20>*

IPK(2)t

TlMtIM(2)

CC INPUT THE NAME OF THE RUN FILE

C CALL FILEUPUUNIT«2)

ESTABLISH THE NEEDED FLAG VALUES

IFLAG( lUNITtl) « 2

IFLAGC IUNITt2) 2

WRITE! ITVP# 1000)

1000 FORMAT! IHO. 'METHOD OF ANALYSIS 7 III)'/

1 IH .'1 - INTERNAL STANDARD'/

2 IH *'2 - INTENSITY RATIO'/

3 IH . *3 - SPIKING'/

4 IH .'4 - REL. INT. ! DEFAULT) »/

5 IH ,'5 - PROFILE')

READ! IRDtlOlO) IFLAG ! lUN IT« 3)

1010 FORMAT! ID

IF! IFLAG! 1UNIT»3).EQ,0) IFLAG!IUNIT,3) = 4

IF! IFLAG!IUNIT*3).EQ.4)IFLAG! lUNITt2) * 3

IF SPIKING I-REL OR PROFILE ANALYSIS* THEN CHEMISTRY IS NOT USED

IFLAG! 1UNIT.4) ~ 0

IF! IFLAG! IUNIT.3) *GE.3)GO TO 100

WRITE! ITYP, 1020)

1020 FORMAT! IHOo 'WILL CHEMICAL COMPOSITION BE ENTERED? Y/N '

)

READ! IRD.1030) lY

1030 FORMAT! Al)

IF! lY.EQ.'Y') IFLAG!IUNIT»4) » 1 C

C ALLOCATE THE RUN FILE WITH 1 CYLINDER

C AND WRITE THE FIRST 5 RECORDS

C100 ID s lOISK! lUNITtl)

CALL ALOT! lUNZTflD.l)

C

c

c WRITE A DUMMY RECORD 6 FOR NOW QUANT WILL ASK FOR CHEM

WRITE!I0»1030)

125 C

126 C ENTER INFORMATION ON EACH LINE

127 C 128 K = 0

129 101 K = K + 1 130 102 WRITE! ITYP. 1050)K

131 1050 FORMAT! IHO. 'FOR LINE 0'.I4.' ENTER UNDER DEFAULT VALUES'/

132 1 IH .' 1-6 NAME OF LINE! BLANK TERMINATES INPUT)'/

133 A IH .' 7- 8* 9-10. 11-12 H K AND L '/

134 2 IH .'13-14 =0 INTEGRATE. =1 PEAK COUNT'/

135 3 IH ,'15-16 =1 UNKNOWN. =2 STO. =3 PEF. =4 AMORPH LINE'/

136 4 IH ,'17-22 =X.X THE DESIRED X ERROR !0=FIXEO TIME)'/

137 B IH .'23-30 T1ME!MIN) TO COUNT PK BKG'/

138 C IH •2 1-38 REL. INT. '/

139 D IH ,'39-44 SIGMA! REL, INT,)'//

140 E IH ,'NNNNNN H K L 0 1 1.00 10.00 «.««')

1 41 READ! IRD. 1060 ) ! lALPH! I)*I=1*6)» IPK! IUNIT)«KODE»

142 1 FIXERR! lUNIT ) . T I ML I M! I UN I T) . FREL. STDREL

143 1060 FORMAT! IX* 6A2 <2 1 2 *F6*2 . 2F8. 2* F6* 2

)

144 c 145 C ARE WE FINISHED?

IF! IALPH!1).EG*' ' ) GO TO 300

SET DEFAULT VALUES

89
ISO

151

152

1S3

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

C IFIKOOE.EQ.O) KOOEsl

IF(FIX6RR( lUN ITl.LT.O.O 1 ) FIXERR( IUN1T)®1.0

IF<T1MLIM< lUNIT) .LT.0.01) TIML IM( lUNIT ) = 10.0

C

C ECHO INPUT

C WRITE! ITYP.10 60) ( lALPHU ) .1=1 ,6) tIPK( lUNIT) .KOOE.

FIXERR(IUNIT) .TIMLIM! lUNITl.FREL.STDREL

WRITE! ITYP. 10701

1070 FORMAT! IH .'CK? TYPE Y/N*

)

READ! IRD. 1080 ) ICK

1080 FORMAT(Al)

IF! ICK.NE* 'Y* ) GOTO 102

C

C REQUEST ANGLE CONTROL INFORMATION FOR THE CURRENT LINE

C104 WRITE! ITYP. 11501

1150 FORMAT! IHO. 'ENTER THE FOLLOWING UNDER THE DEFAULT VALUES!*/

1 IH . 'COL 1 -10 BACKGROUND LOW 2-THETA*/

2 IH . *COL 1 1-20 PEAK 2-THETA*/

3 IH . *COL 21-30 BACKGROUND HIGH 2-THETA'/

4 IH . *COL 31-40 STEP WIDTH*/

5 IH . 'COL 41-46 MAX. COUNTS*/

6 IH .'COL 47-50 0 OF PEAK POINTS'/

7 IH . 'COL 51-55 0 OF BACKGROUND POINTS'/

8 IH . *COL 60 MVCNT METHOD*//

9 3X . 'LLL.ILLL *-.3X. 'PPP.PPP* .3X. 'HHH.HHH' .5X. * 0.005' . A IX .'32700 5 10 O')

READ! IRD. 1 160) BANG! lUNlT). PANG! lUNITl.EANG! lUNIT) • DANG ! lUNl T 1

1 LIMCNT! lUNIT) .NPK! lUNIT) .NBG! lUN IT ) . MVCNT! lUNlT)

1160 FORMAT!4F10.3. 16. 14.2X5)

CC DEFAULT PARAMETERS

C 1F!DANG! IUNIT).LT.0«005)DAN6! lUNlT) = .005

IFILIMCNT! IUNIT).EQ.O)LIMCNT! lUNIT) = 32700

IF!NPK!IUNIT).EQ.O)NPK! lUNIT) = 5

IF!NBG! lUNIT) .EQ.O)NBG! lUNIT) = 10

IF!K0DE.EQ.4) NBGCIUNIT) = 0

C

C ONLY MOTION TOWARD HIGH ANGLE WILL BE ALLOWED IN INTEGRATE MODE

C IF!IPK!IUNIT).EQ«1.0R.EANG!IUN1T).GT.BANG!IUNIT))G0 TO 106

WRITE! ITYP. 1 1 16)

1116 FORMAT! IHO. • ILLEGAL ANGLES - EAN6 MUST BE > BANG')

GO TO 104

C

C IF NPK IS NOT ODD FORCE IT

C106 IF! !NPK!IUNIT)/2)4>2.EQ.NPK!IUNIT) )NPK! IUNIT)=NPK( IUNIT)-1

C

C ECHO INPUT PARAMETERS

C

WR ITE! ITYP. 1160) BANG! I UN I T ). PANG ! I UNI T ) . EANG! I UN IT ) • D ANG! lUNIT) . * LIMCNT! I UNIT) .NPK! lUNlT) .NBG! lUN IT ). MVCNT! lUNIT)

WRITE! ITYP. 1070)

READ! IRD. 1080) lOK

IF! lOK.NE. * Y* ) GOTO 104

C

C READ OVERLAPPING LINE INFORMATION - NONE ALLOWED IF SPIKING

C 1-REL OR PROFILE MEASUREMENTS

lOVLP = 0 IF! IFLAG! IUNIT.3) .GE.3) GO TO 160

WRITE! ITYP. 1190)

1190 FORMAT!1HO. 'ENTER THE 0 OF LINES WHICH OVERLAP THIS L I NE! MAX=2 )

*

)

RE AC! IRD. 1010 )IOVLP

CC WE NOW HAVE ALL THE PARAMETERS NEEDED TO WRITE RECORD 7 OF THE RUN FILE

C160 WR ITE! ID. 1200 )6ANG! I UN IT) .PANG! lUNlT) .EANG! I UNIT) .DANG! lUNlT).

90
221

222

223

224

229

226

227

228

229

230

231

232

233

234

23S

236

237

238

239

240

241

242

243

244

249

246

247

248

249

250

251

252

253

254

255

256

257

258

259

1 HATE( lUNlT) # WVCNT( XUNIT) eTIMLlMt IXGRR4 JUNIT) • 2 L IMCNTl lUN IT ) • ( I ALPH( l)«lsl*6S »K00E« lOVLP# IPKlIUNITlt NPK( lUNlTl

3 NB6C lUNIT) .FREL.STDREU

1200 FORMAT! 4F7» 3# F4»l«!l*F7*3»F5«2e 13»6A2»31 1 #2J2tF6»l#F4*ll

READ THE OVERLAP LINE INFORMATION FOR RECORD 8

64 DO 169 I«l*64

65 lALPHCn » IBL

IF< 10VLP.EQ«0)60 TO 170

WRITE! ITYPtlElO) iOVLP

210 FORMATflHO.' FOR THE 'tilt* LINEISI •

1 IH t 'OVERLAPPING THE CURRENT LINE ENTERS*/

2 IH ,'COL 1-6 NAME OF PHASE 2*/

3 IH t'COL 7-8t 9-10* 11-I2* Ht K AND L OF LINE 2*/

4 IH t'COL 13-18 REL* INTt'/

5 IH t'COL 19-22 S1GMA(REL. INT.J'//

7 IH t'PHASE2 H K L 15.0 1.0 PHASES H K L 10.0 l.S*)

READ! IRD.1220K 1ALPH( 1) • l>lt24)

220 F0RMAT(64A2)

ECHO INPUT PARAMETERS

WRITE! ITYP. 1220) ( I ALPH( I ) t 1»1 »24

1

WR ITE! ITYP. 1070)

REA0!IRDtl080) lOK

IF! lOK.NE. • Y' ) GOTO 164

CC THE CHEMICAL ANALYSIS SECTION OF RECORD 8 WILL BE SUPPLIED

C BY THE PROCESSING PROGRAM ON THE 1108 FROM THE INFO

C CONTAINED IN RECORD 6 AS READ BY QUANT

C170 WR ITE! ID. 1220 X lALPHU ) * 1 = 1 .64)

C RETURN TO TOP FOR NEXT LINE

GOTO 101

300 ENDFILE ID REWIND ID RETURN

END

91
123

4

5

6

7

e

910

1112

13

14

15

16

17

le

19

20

2122

23

24

25

26

27

26

29

30

31

32

33

34

35

36

37

36

39

40

41

42

43

44

45

46

47

46

49

50

SI52

S3

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

7172

73

74

SUBRCUIINE TRANSUUNIT)

C.

c.c

c

cc

c

ccc

c

c

cc

c

c

c

co

c

c

cc

cc

c

THIS ROUTINE TRANSFERS DATA FILES FROM THE DISK 00 TO FLOPPY FO

PART II KILL TRANSFER DATA VIA NBS NET • NOT YET READY

GLOSSARY

IFIN =12 INPUT FILE

IFOUT =13 OUTPUT FILE

NRC » OF RECORDS READ

lALPH ARRAY FOR READING AND WRITTING

IDOX IS THE USER INPUT OPTION CODE

= 1 FOR TRANSFER TO FLOPPY FO

= 2 FOR TRANSFER VIA THE NBS NET * 3 FOR TRANSFER TO PRINTER

IMPLICIT INTECER+2 (I-N)

INTEGER44 NBSt INTR

COMMON /BUFF/ IALPH!66)

.

NAME! IS)

COMMON /lO/ NBS. IDT. ICLOCK

I SPEC. IRO. IPRT. ITYP.

1 I0ISKI2.2). IFIN. IFOUT

POP ADDRESS OFF THE TRANSFER TABLE

IERR0R=0

CALL POP! 1 UN IT • I ERROR)

C

C GET FUNCTION DESIRED

C90 WRITE! ITYP. 100)

100 FORMAT(1HO« 'ENTER TRANSFER OPTION: 1=T0 FLOPPY*/

1 IH »23X,*2=VIA NBS NET'/IH ,23X.*3=T0 PRINTER*)

READ! IROtl 10) IDOX

110 FORMAT! ID

IF! IDOX aLTal .OR. IDOX «GTo 3)GOTO 90

IF! 1DQX»EQ*2) GOTO 500

CC ENTER THE NAME OF THE FILE TO BE COPPIEO

C CALL FILNAM !3J

C

C ACTIVATE INPUT FILE

C ENCODE! lALPH. 120) !NAME! 1 ) * 1 = 1 « 6) , I FIN

120 FORMAT!*AC • t 6 A 1

.

• «• « Z1 ) CALL SYSTEM! IALPH.il

)

C

C IF PRINT ! IDOX = 3 ) SKIP THE REST OF TO. INPUT

C IF! IDOX «NE« 3 ) GOTO 130

WRITE! IPRT. 124) !NAME! I ) . 1 =1 « 6

)

124 FORMAT! IHl ,57X, • .6At «

*4*')

GOTO 300

CC NUMBER OF RECORDS

C130 WRITE! ITYP, 135)

135 F0RMAT!1H .'ENTER 0 OF RECORD S ! 13 )*

)

READ! I R0.140.ERR=130)1NREC

140 FORMAT! 13)

WRITE! ITYP. 145) INREC

145 F0RMAT!1H .'IS '.13.' CORRECT? Y/N'

)

READ! IPO. 146) lY

148 F0RMAT!A1)

IF ! lY .EQ. 'N*> GOTO 130

92
76

76

77

78

79

60

81

62

83

84

86

66

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

C

C REQUEST MCUNTING OF FLOPPY - WAIT UNTIL IN PLACE

C150 WRITE! ITYP*151)

151 FORMAT! 1H0« 'MCUNT FLOPPY ON FO. 0H£N READY ENTER R»»

READ! IRO. 148) lY

IF ! lY .NE. 'R') GO TO 150

C

C CALCULATE THE NUMBER OF CYLINDERS FOR THE FLOPPY

C CURRENTLY TFE NBS 1108 HANDELS ONLY SO CHARACTER RECORDS EASILY

C SINCE FLOPPY TRANSFER IS MOST CONVENIENT WE WILL WRITE OUR 128

C CHARACTER RECORD IN TWO PARTS! 80 CHARACTERS THEN 46 CHARACTERS

C FOR 80 BYTES RECORD LENGTH THERE ARE 46 RECORDS PER CYLINDER

C lSIZE=24INREC/48-t-l

CALL ALCT!lUNIT«IFOUTtISIZE)

CC COPY FROM DISK TO FLOPPY

C300 NRC=0

310 READ!IFIN»311«EN0=380.ERR=340) ( I ALPH! I ) t 1 • 64)

311 F0RMAT!64A2)

NRC=NRC+1

CC OUTPUT THE RECORD TO EITHER THE FLOPPY OR THE PRINTER

C IF! lOOX.EQ. 1) WRITE! IF0UT«320 .ENOs370«ERRs360) ( I ALPH! I ) . Isl .64

)

323 F0RMAT!40A2)

IF! 1D0X.EQ.3) WR ITE! IPRT t3 1 1 • ERR=360) < lALPH! 1) > Isl *64

)

GOTO 310

C

C ERRORS ON INPUT

C340 WRITE! ITYP. 341)

341 FORMAT! IH « 'READ ERROR-EXIT*

I

GOTO 390

C

C OUTPUT ERROR

C360 WRITE! ITYPt361)

361 FORMAT! IH .'WRITE ERROR-EXIT')

GOTO 390

CC ERROR - FLOPPY IS FULL. TRANSFER CAN NOT BE COMPLETED

C370 WRITE! ITYP, 371) NRC

371 F0RMAT!1H , 'FLOPPY OUT OF SPACE AT RECORD* , 14. * EX IT *

)

GOTO 390

CC END OF COPY

C360 IF ! 1D0X.EQ.3) GOTO 400

ENDFILE IFOUT

C

C CLOSE ALL FILES ATTATCHED TO FLOPPY FO

C390 CALL SYSTEM! *CH FO',5)

CC PRINT CCMPLETICN MESSAGE

C400 WRITE! ITYP, 410) NRC

410 F0RMAT!1H , 'TRANSFER COMPLETED t *, 14 ,* RECORDS *

)

C

C IF TRANSFER TC PRINTER THEN SEND A FINAL FORM FEED

C !REQUIREO ON VERSATEC PRINTER TO GET IT OUT OF SOLUTION)

C . - - i IF! ID0X.EQ.3) WRITE! IPRT. 420)

420 FORMAT !1H1) . _ GOTO 999

C

cC PART II TRANSFER VIA NBS NET NOT READY YET

C500 WRITE! ITYP, SOI)

93
Ill

III m

149 501 FORMATdH .'NBS NET TRANSFER N£T READV-EXITM

.150 C . r - ; .151 C RETURN TO INTRUP

2 C

3 999 -CALL PtSH( I UN IT « 12)

4 RETURN

155 END

94
t23

4

56

7

8910

111213

14

IS16

17

IS

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

5152

53

54

55

56

57

58

59

60

6162

63

64

65

66

67

68

69

C.

C.CC

c

c

c

c

c

c

c

SUBRCUTINE WRF ILE( lUNIT

»

SUBROUTINE WRITES THE OUTPUT FILE OF

IMPLICIT INTEGER42

INTECER44 N8S

U-N)

COMMON /ANG/

1 EANG(2)«

2 TANG(2)«

BANG(2)

.

1RATE(2)

.

IZRST(2)t

COMMON /COUN/

£ LlHCNT(2)f

lCNT(2tl6)

1SAVE(2)

COMMON /lO/

1 ISPEC.

2 I0ISK(2,2)

t

NBS*

IRO«

IFIN.

COMMON /TIM/

1 NBG(2)«

6K6TIM(2)

NPK(2)

.

COMMON /PROB/

1 ITITLE(SO)

IDAT(3)«

COMMON /RNDT/

1 IENRN(2.4)

NRECC2)

.

COUNT TIMES AMO COUNTS TO DISK

CANG(2),

PANG(2)t

NPTPK42)

0ANG(2)

RATE(2)t

IPTU). IT0T(2)t

lOT*

IPRT.

IFOUT

1 CLOCK*

ITYP.

F1XERRI2)*

T1ME(2)«

IPK(2)

.

T1ML1M(2)

IFLAG(2tlO). IT1M(3)«

NMFIL(2«6)

.

ITR<2)

.

C

C

C IS THERE ^NY DATA IN THE BUFFER TO BE WRITTEN? IF NOT THEN RETURN

C

J = 1PT( lUNIT)

IF<J*EQ.O) GOTO 999

C

C GET THE TIME

C CALL DATE

CC WRITE THE DATA TO THE OUTPUT FILE# CANG IS THE ANGLE OF THE LAST DATA POINT

C IFILE = ID1SK(IUN1T»2)

WRITE! IFILE.IOOOICANGUUNITI . ITIM.( ICNT ( I UN I T . I 1 * £=1 . J)

1000 FORMAT(F6.3.2X,2I2,16I7)

C

C KEEP TRACK OF THE NUMBER OF RECORDS WRITTEN

C NREC(IUNIT) = NREC(IUNIT) + 1 CC ZERO BUFFER ARRAY AND RESET POINTER

C SUM THE COUNTS SAVED IN ICNT( tl) FOR TEST IF SHUTTER IS OPEN

C ISUM=C

IPT(IUMT) = 0 DO 100 1=1.16

I SUM= ISUM4 ICNT( lUNIT.I

)

100 ICNTt lUNIT. I) = 0 C

C TEST SUM OF COUNT ARRAY FOR SUM>0 AN INDICATION THAT SHUTTER IS OPEN

C IFCISUM.GT.n GOTO 999

WR ITE! ITYP, 120)

120 FORMAT! IHO. '44WARNING44ICNT ARRAY IS FILLED WITH ZEROS')

CC ALL DONE (note; FINIS WILL WRITE FILE MARK AT THE END OF THE FILE)

C999 RETURN

END

95
Appendix 2

LISTING OF PROGRAM CONFIG

This program creates the instrument specification file DACONF read by AUTO and written

as records 2, 3, 4, and 5 on any output file. The file DACONF is eight records long. The

first four describe goniometer #1 and the second four describe goniometer #2. The format

for either set of four is given in Table 5 as records 2 to 5. The function READX permits

free field input from the consol terminal.

96
2

3

4

5

6

7e

9

10

1112

13

14

15

16

17

16

19

20

21

22

23

24

25

26

27

23

29

30

3132

33

34

35

36

37

38

39

40

41

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

THIS RCUTINS

IBRNCH a 1 a 2

READS AND/OR CREATES THE UNIT CONFIGURATION PILE.

ACTIVATE. READ AND LIST CONTENTS

CREATE FILE •

C

c *C0NFIG*4***C0NFIG*****C0NPXG**4*>KC0NFIG*44**C0NF I6***4*

c_. c

c

cc

c

cc

c

c

4141*441444 *4*44**44*4 44*4*44444

CC COMMONS ARE IDENTICAL WITH THOSE USED IN AUTO

C EXCEPTION IS ARRAY JFLAG(2.10) WHICH IS XFLAG(2*10)

I FLAG FILE

file

FILE

CREATION MODE

REVISION MODE

READING MODE (REVISION POSSIBLE FOLLOWING READ)

IN AUTO

IMPLICIT INTEGER42 <I-N)

INTEGER** NBS

COMMON /BUFF/

COMMON /lO/

1 104*

2 IDISK(2*2).

COMMON /PROS/

1 1TITLE(50)

IALPH(66)

NBS.

IRO.

IFIN.

I0AT(3)*

NAME (15)

lOT.

IPRT.

IFOOT

JFLAG(2.10).

I CLOCK.

ITYP.

1TIM(3).

DIMENSION XCALIB(2.6> . 1CALIB( 2.6) • XMAT( 2. 1 5)

DIMENSION ISPEC(2«64)

DATA IBLNK/* •/

ASSIGN LOGICAL UNIT NUMBERS

IDT = 2 104=4

IR0=5

IPRT=6

PHYSICAL DEVICES

42 1TYP= 7 43 C 44 C ATTATCH THE LOGICAL UNITS TO T!^ 1 45 C 46 CALL SYSTEM {

• ZU* .2)

47 CALL SYSTEM! *ND DO* .5)

48 CALL SYSTEM! 'AS 260*. 6)

49 c LOGICAL UNIT *4 WILL BE ALLOCATED

50 CALL SYSTEM! • AS 520« .6)

51 CALL SYSTEM! 'AS 662* .6)

52 CALL SYSTEM! 'AS 720*»6)

53 c 54 c SET I UNIT TO I FOR FIRST ENTRY

55 c

OR ACTIVATED LATER

WILL BE RESET TO 2 FDR SECOND PASS

lUNIT =1

READ SYSTEM CLOCK TO GET CURRENT DATE AND TIME

CALL DATE

READ FUNCTION DESIRED (=2 READ, =1 CREATE)

CC

C

C

c

C WRITE! ITYP. 10) lOAT.ITIM

10 FORMATUHO. 'CONFIGURATION FILE CREATION AND UPDATING ROUTINE*/

IH ,15X,'RUNON •« I2.2( IH/. 12 ).2X» I2«2( 1H: • 12)/

IH0»* INPUT FUNCTION DESIRED) I=CREATE OR 2=REA0/UP0 ATE •

)

IBRNCH=READX( I W .N . 2 . IRO . I TYP, lEOF)

C BRANCH DEPENDING ON WHO CALLED (OR PURPOSE)

IF( IBRNCH. EQ. 2) GOTO 400

C4444444 4 44 44444*444444 444444 444i4i:44i#]|i444r4444c4i4i4.4i*]^«3^4,^4i«4i4i«4»4 4444444

C FILE CREATION BLOCK

C444 444444* *44444 4444 44* 44444 4444 44 4 4*444 4444i|i44c4i ««*«***444 4 444444444

97
74 C ENCODE lALPH FOR ALLOCATION OF THE CONFIGURATION FILE

75 c UNIT 104

76 c 77 c 78 ENCOOEdALPHtSO) 104

79 so FORMAT<»AL OACONFe*. Z1 t •tl*128«)

80 IS1ZE=17

81 c

62 c ALLOCATE FILE DACONF WITH 1 CYLINDER AND 128 BYTES

83 c ATTATCH LOGICAL UNIT 104

84 c 85 CALL SYSTEM! I ALPH. I SIZE)

86 c 87 c SET FLAG FOR INITIAL ENTRY (=0)

88 c 89 IFLAG = 0

90 c 91 c ENTER UNIT NAME INTO ISPEC ARRAY

92 c 93 100 WRITE! ITYP. 102) lUNIT

94 102 F0RMAT!/1X» 'ENTER NAME FOR UNIT«'.I2t* <A4)

) 95 READ! IRQ. 110) ! I SPEC ! lUNI T • I ) « 1=1*2)

96 110 FORMAT!2A2)

97 c 98 c STORE CURRENT DATE !6 CHARACTERS)

99 c 100 ENCODE! lALPH* 118) lOAT

101 118 F0RMAT!3I2)

102 DO 120 1=1*3

103 KK = 1 2

1 04 120 ISPEC! lUNITtKK) = lALPHU)

105 c 106 c WHO IS ENTERING CONFIG INFORMATION

107 c 108 WRITE! ITYP* 130)

109 130 FORMAT! IX* 'ENTER INITIALS (A2)» ) 110 REAO!IRO*X10) I SPEC ! lUNIT * 6

)

111 C FOR UPDATE BRANCH TO ECHO LINE NA**

112 IF! IFLAG.EQ.l ) GOTO 600

1 13 C

114 C TARGET* LINE* WAVELENGTH* FOCAL SPOT* TAKE OFF ANGLE

115 c

1 16 140 WRITE! ITYP *141) 1 ISPEC! lUNIT. I ) *1=1 *2)

117 141 F0RMAT!/1X* 'ENTER IN FREE FORMAT FOR UNIT •* 2A2/

1 18 1X*'TUBE TARGET* LINE* LAMBDA* TYPE* TAKE OFF*/

119 * IX*' A2 A2 F6.4 A2 F4*l • ) 120 c TARGET !A2)

121 IOUM=READX! IW *N • 2 * I RD* 1 TYP * lEOF)

122 ISPEC! IUNIT*7)=1W

123 c CHARACTERISTIC LINE FROM TARGET ( A2

)

124 IDUM=READX! IW *N *1 * IRD* I TYP * lEOF)

125 ISPEC! IUNIT*8)=1W

126 c WAVELENGTH !F6«4 = 3A2)

127 XLAM = REAOX! IW.N.l *IRO*ITYP* lEOF)

128 ENCODE! lALPH* 142) XLAM ' 129 142 F0RMAT!F6.4)

130 C STORE DATA INTO ARRAY I SPEC! lUNl T* 9-1 1

)

131 DO 144 I =1*3

132 KK = I 8

133 144 ISPEC! IUNIT*KK) = IALPH! I

)

134 C FOCAL SPOT CODE ( A2

)

135 IDUM = READX! IW«N*1 *1RD*ITYP* lEOF)

136 ISPEC! IUNIT*12)=IW

137 C TAKE OFF ANGLE !F4*1=2A2)

138 TOF = READX! IW.N*1 .IRD* ITYP*1E0F)

139 ENCODE! lALPH* 146)T0F

1 40 146 F0RMATIF4. 1

)

141 DO 148 1=1*2

142 KK = I + 12

143 148 ISPEC! IUNIT*KK) = IALPH! I

)

144 C 1FOR UPDATE BRANCH TO ECHO LINE TG*4

145 IF ! IFLAG *EQ* 1) GO TO 620

146 C 147 c DIV SLIT CODE AND ANGLE !OEG) OR LENGTH fMM)

98
146

149

150

151

132

153

154

155

156

157

156

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

160

161

182

183

164

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

2 07

208

209

210

211

212

213

214

215

216

217

218

219

220

C G0NICME7ER RADIUS IN MM

C INCIDENT AND DIFFRACTED BEAM SOILLER SLIT ANGLES

C RECEIVING SLIT ANGLE IDEGl

C

160 WRITE( ITYP, 161H ISPECdUNIT.I 1 «lal,2$

161 F0RMAT(1H0»*ENTER IN FREE FORMAT FOR UNIT *t2A2/«lX«

O'OIV SLIT TYPE. ANG/LEN. RADIUS* IN SOLLER* OUT SOLLERt REC SLIT*/

A2 F6*1 F6* 1 F4#l F4*l F4*l*l

C DIVERGENT SLIT TYPE! . FA*F IXED/TC»THETA-COMP

lOUM » REAOX( IW,N,2, IRD.ITVP, lEOF)

ISPEC UUNIT,15>*IW

C DIVERGENT SLIT ANGLE(FX> OR

C IRRADIATED LENGTH IN MM CTO

ANGaREADXC 1 W, N. 1 . IRO. ITYP . lEOF

ENCODE! I ALPH* 1641 ANG

164 F0RMAT(F6.1)

C STORE DATA IN ISPECC lUNlT. 16-18)

DO 166 I«l*3

KK = I 15

166 1 SPEC! !UNIT*KK)sIALPH(I

C GONIOMETER CIRCLE RADIUS IN MM

RAD=REAOX< IW.N. 1 « IRO.ITYP. lEOF)

ENCODE! lALPH, 1641RAD

C STORE IN ISPECC lUN IT .19-21

DO 170 1=1.3

KK = I + 18

170 ISPECC lUNIT.KKlslALPHCl

C GET INCIDENT SOLLER.OIFF SOLLER AND RECEIVING SLIT ANGLES

DO 190 J=1.3

ANG = READXC IW.N, 1 .IRO. ITYP.IEOF)

ENCODE! lALPHt laOlANG • 180 FORMATCF4*!)

C STORE DATA INTO ISPECC lUNIT .22-23 24-25 26-27)

DO 184 1=1.2

KK = l + 19-t-J42

184 ISPECC IUN1T.KK)=IALPH(I)

190 CONTINUE

C FOR UPDATE BRANCH TO ECHO LINE 44SL46

IF CIFLAG.EO.l) GO TO 630

C

C MONOCHRCMATOR CODE: GR=GRAPHI TE/NN=NONE

C DETECTOR CODE 1 SC=SC I NT ILLAL lOR

C DEAD TIME PARAMETER IN MICROSECONDS

C200 WRITE! ITYP.201) C ISPECCIUNIT.I 1 .1=1.2)

201 FORMATC/IX. ’ENTER IN FREE FORMAT FOR UNIT • •2A2/IX*

&*MONO CODE. DETECTOR CODE. DEAD TIME* INT. STABILITY •/

&’ A2 A2 F4.2 F4.2*)

C MONO CCDE

1DUM=REA0XC I W .N . 2 . IRO. I TYP . lEOF)

ISPECC 1UNIT.28)=IW

C DETECTOR CODE

IDUM = READXC IW.N.l. IRO. ITYP.IEOF)

ISPECC IUNIT,29)=IIK

C DEAD TIME

TAU = READXC IW.N.l .IRD« ITYP.IEOF)

ENCODE! lALPH. 180) TAU

C STORE DATA IN I SPE CC lUN IT . 30-31

)

DO 210 1=1.2

KK = I 29

210 ISPECC IUNIT.KK)=IALPHC I

)

C INSTRUMENT STABILITY IN PERCENT

C STAB = READXC IW .N. I . IRD. ITYP. lEOF)

ENCODE! I ALPH. 180)STAB

C

C STORE DATA IN 32-33

DO 220 1=1.2

KK = I + 31

220 ISPECC IUNIT*KK) = lALPHCI)

C

C BLANK FILL REMAINDER OF 128 BYTE RECORD

C

99
221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

00

290 Is34«64

290 ISPEC( lUNlTt

1

IbIBLNK

C FOR UPDATE BRANCH TO ECHO LINE **0T4*

IF (IFLAG.EO.l) GO TO 640

C

C SET UP CALIBRATICN RECORD FLAGS

C WRITE! ITYP.292) ( I SPEC! lUNIT.l ) *1 = 1 .2)

292 FORMAT!/lXt 'ENTER CALIBRATION FLAGS FOR UNIT '«2A2/1X«

1 *0/1 FOR (DO NOT)/!DO> APPLY FLAT SPECt AXIAL OlVt

2 • LORENTZ CORRECTIONS*

)

DO 294 1=1.6

ICALIB! lUNITt 1)=0

294 CONTINUE

lCALlB!lUNIT.n = RE ADX ! 1 W . N, 2 , IRO, 1TVP.«E0P»

ICALIBUUNIT.2) = READX ( I W . N. 1 . IRo, IT yP« > ICALIB! lUNIT. 3) = REAOX ! I W , N« 1 , IRQ , ITYPt^^^'^) C

c

c300

310

SET UP CALIBRATION RECORD! 128 BYTES!

WRITE! ITYP.310) ! I SPEC! lUNI T . I ) , r«l . 2) F0RMAT(/1X. 'ENTER CALIBRATION CONSTANTS FOR UNIT • .2A2

1 /IX, 'ZERO OFFSET, AO, A1 , A2 , A3, A4*l

C ZERO CALIB ARRAY

DO 320 1=1,6

320 XCALIB!IUNIT, 11=0.0

XCALIB!IUNIT,1) = REA0X!1W,N,2, IRD, ITYP, lEOFI

DO 330 1=2,6

XCALIB! lUNlT, I ) =REAOX! I W,N , 1 , IRD, ITYP.IEOE)

IF !N.EQ.O) GO TO 330

XCALIBCIUNIT. I)=0.0

GO TO 340

330 CONTINUE

C FOR UPDATE BRANCH TO ECHO LINE *«CL4*

340 IF !IFLAG,EQ,1) GO TO 650

CC SET UP THE INVERSE MATRIX

C360 WRITE! ITYP, 3621 ! ISPEC! lUNIT, I ) , 1=1 .2)

362 F0FMAT(/1X» 'ENTER FOR UNIT *,2X2,' INVERSE MATRIX ELEMENTS! 00*,

* ' 01 02 03 04 11 ••• 34 44*)

DO 370 1=1,15

370 XMAT! lUNITe 1) = 0.0

XMAT! lUNIT, 1 ) = READX! IW,N,2, IRD, ITYP, lEOF)

DO 380 1=2,15

XMAT! lUNIT, I) = READX! I W , N, I , I RO, ITYP, I EOF

)

!F(N.E0,O)GO TO 380

XMAT! lUNIT, I) = 0,0

GO TO 390

380 CONTINUE

C FOR UPDATE BRANCH TO ECHO LINE MX**

390 IF! IFLAG.EQ. 1 ) GOTO 650

CC IF 1UNIT=1 RETURN TO ENTER DATA FOR IUNIT=2

C ELSE ECHO INPUT

IF! 1UNIT.EQ.2 ) GOTO 600

1UNIT=2

GO TO 100

C************************************************ *******************

C ACTIVATE CONFIG DATA FILE AND READ IT C*****************:tf********:f************* ******** **********************

400 ENCODE! lALPH. 410) 104

410 FORMAT!'AC DACCNF,*,Z11

ISIZE = 11 CALL SYSTEM! lALPH. ISIZE)

C

C READ CONFIG FILE FOR INSTRUMENT SPECIFICATIONS AND CALIBRATION

500 DO 530 1UNIT=1,2

READ! I C4,510.E^iR=540)! ISPEC! lUNIT , I ) , 1 = 1 ,64 ) 510 F0RMAT!64A2)

C

C STORE CURRENT DATE

C DO 512 1=1 .3

100
296

297

298

299

300

301

302

303

304

30S

306

307

308

309

310

311

312

313

314

31S

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

3 46

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

iCK = I 2 512 ISPEC< lUNlTeKK) « IDATd*

REA0( I04«520«ERR=540) ( ICAL :B([ 1 UNI T « T ) . I*! .6 ) t (XCALIBI I UN IT. X)

1 .i^i.e)

520 PORMAT<6Il«F10.3«5E16»8}i

REAOt IC4*524.ERR-540M}<MAri lUN ! T« U » 1 « S5 ) 524 F0RMAT<8E16«7>

530 CONTINUE

IFLAG=2

60 TO 600

C —hRROR DETECTED

540 WRITE! ITYP.5S01 104

550 FORMAT! IHO. •ERROR ON LU=»,I1,» TERM INAT IN6*

C

CALL

ECHO

EXIT

INSTRUMENT

**«

SPECIFICATIONS

C***************************V*********^ tHAi** ’t‘* ************* ******

600 WR ITE( XTYP.610) ( 1 . ( ISPEC! I . J) « Jsl .6) * Isl .2}

610 F0RMAT<lH0.'44NA44'«2Xt °UNIT’«3X. 'NAME>.4X. *0ATE*.3Xt *1N1T*/

(9X. I2»4X(2A2.3X» 3A2.3XtA2H

IF (IFLAG.EG.l) GO TO 700

620 WRITE! ITYP» 62 1 ) ( I . ! I SPEC! I . J} . J=7e 141* I»1 .2}

621 FORMAT! IHO. •TG44* .2X. 'UNIT* ,3X. 'TARGET* .3X. *L1NE'.3X. 'LAMBDA*

3X. 'TYPE* »3X, 'TCA'/

!9X« 12* 6X. A2*6X*A2*4X93A2*4X*A2*4X*2A2$

)

IF !IFLA6.EQ«1) GO TO 700

630 WR ITE! 1TYP.631) ( 1 . ! ISPECU • Jjj . JslS.27) .Isl .2)

631 FORMATIIHO .'*SL4*' .2X, 'UNIT* * 3X. »OIV SLIT •* 3X* 'RADIUS '* 4X*

•S0LLEBS'*3X* »REC SLIT'

/!9X« I2.5X. A2»3A2*3X.3A2.3X«2A2,1X.2A2 .3X.2A2})

IF !IFLAG.EG.l) GO TO 700

640 WRITE! 1TYP.641) ! I* ! I SPEC! I «J) * J=28*33)« 1 = 1*21

641 FORMAT! IHO. •DT44' .2X. 'UNIT' s3X. 'MONO* .3X .' DETECTOR' «3X*

•DEAD TIME* INT. STAB 1 LI TY */ ! 9X . I 2 • 4X . A2 . 7X« A2 • 1 OX * 2 A2«

10X.2A2.tHXl)

IF ! IFLAG.EQ. 1 ? GO TO 700

650 WRITE! ITYP.652MI .! I CALI S! 1. J 1 . J=1.31 • ! XCAL I B! I .K 1 • K= 1 .6 1 * 1 = 1 .2)

652 FORMATtlHO. 'CL4+' .2X.'UN FS AX L2 OFFSET A0'*5X*'A1'*

lOXe 'A2'« lOX. 'AB'flOX* 'A4</! 9X* 1 2* 3! 1 X * I 2 1 * F6. 2* F6. 3* 4E 1 2. 5 1

IF! IFLAG.EO.l 1 GOTO 700

670 WRITE! ITYP. 6721 ! I . ! XMAT! I . U 1 » J=1 . 1 51 • 1=1 .2

672 FORMAT !1 HO. 'MX+4 UNIT'/

! lOX, II* 2X.5E12.5/25X, 4E 1 2* 5/ 3TX* 3E1 2. 5/

49X.2E12.5 /61X.E12.5//1

C****** ************ ***************** *****************************

C ALLOW FOR CORRECTION

C 444

=

444444 44 44444 444 4 44

C

c -WHAT LINE? SET UPDATE FLAG

C

700 WR ITE! ITYP.731)

731 FORMAT! IHO* 'TO EDIT ENTER LINE CODE AND UNIT# CA2.I1) * "OP"*

1 "TY«* OR "OK"')

738 READ! IRD»740.ERR=7491 I ALPHi 1 ) * lUNIT

740 F0RMAT!A2* II

IF! lALPH! 1 1 .EQ® »0K» 1 GOTO 800

C DO WE LIST OPTIONS?

IF! lALPH! 1 ) ®EQ® »0P' 1 GOTO 760

C— -ALLOW FOR COMPLETE LISTING

IFLAG=0

IF! lALPH! 1 1 ,EQ. 'TY' IGO TO 600

C AFTER REENTRY OF DATA LIST ONLY THE LINE INPUT (IFLAG=1)

1FLAG=1

C

C CHECK FOR VALID UNIT NUMBER

C

IF! lUNlT.NE.l .AND. lUNIT •NE. 21

IF ! I ALPH! 1 1 . EQ. 'NA'

60 TO 100

IF ! lALPH! 1 1 .EQ. 'TG*

GO TO 140

IF ! I ALPH! 1 1 .EQ. »SL*

60 TO 160

IF < lALPH! 1 1 .EQ. *DT'

GO TO 200

IF ! lALPH! 1 l.EQ. 'CL'

GO TO 300

IF! lALPH! 1 ) ®EQ* 'MX* 1 GOTO 360

749 WRITE! ITYP, 750)

101
370

371

372

373

374

375

376

377

378

379

360

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

750 FORMAT! IH «'44>1LLEGAL CODE OR UNIT 0 ENTERE044TRY AGAIN**')

C

C LIST EDIT CODE OPTIONS

C760 WRITE! ITYP. 770)

F0RMAT!/1X» 'LEGAL OPTIONS are: NAW* TGW* SLW* OT<f* CLW* MXW'/

1 IX. • plus; ty to U*t all'/

2 IX. ' OP to 1 1 sT opT tons'/

3 IX*' OK to tcrmtnat:* sdtt')

GOTO 700

C^**#******^!*** ********************************** ************4>******

C WRITE CALIB FILE !1FLAG = Otl) TO 104

C PRINT CALIB FILE TO IPRT

C*** ********************************************* ******* ************

800 IF! IFLAG.EQ.2) GO TO 999

WR ITE! 1TYP.810)

810 FORMAT!lHOt 'WRITE/PRINT SPECIFICATION FILE? !Y/N) DEFAULT=Y*

)

READ ! IR0«820)IALPH!1)

820 FORMAT! AD

IF !IALPH! 1 ).EQ.'N« ) GO TO 999

REWIND 104

DO 840 1=1 »2 . WRITE! 1 04* 830)! I SPEC ! I • J ) • J=1 .64)*! IC AL IB ! I *L ) *L= 1 1 6)

1 !XCALIB! 1 «K) «K = 1 .6 ) . ! XMAT ! I t M)

WRITE! IPRT* 83 1 ) ! I SPEC! 1 • J ) • J= 1 • 64 ) * ! I CALI B ! I *L ) • L=1 * 6 )

* !XCAL1B!I *K) *Ksi ,6) * ! XMAT ! I * M ) * M= 1 * 15

831 FORMAT! IHO* 64 A2/ 1 X* 6 1 1* FI 0 • 3* 5E 1 6* 8/1 X* 8E1 6 • 8/lX* 7E 16* 8

)

830 F0RMAT!64A2/6I1 *F1 0* 3*5E1 6 .8/8E 1 6. 8/7E1 6* 8)

840 CONTINUE

C

C PROGRAM CCMPLETICN

C

WRITE! ITYP. 9999) 104

9999 F0RMAT!/1X* 'FILE mOACONF" WRITTEN TO LOGICAL UNIT **I2)

999 STOP

END

102
01. Summary date

Yr. Mo. Day B 0 1 1

04. Software date

Yr. Mo. Day

8 0 1 1 2 5

FEDERAL INFORMATION PROCESSING STANDARD SOFTWARE SUMMARY

02. Summary prepared by (Nam» and Phona)

Camden R. Hubbard 301/921-2921

05. Software title AUTO - A Real Time Diffractometer Control System

06. Short title AUTO

03. Summary action New Replacement Deletion

Previous EDInternal Software ID

07. Internal Software ID

08. Software type

Automated Data (3 System

Q Computer Program

[~| Subroutine/Module

09. Processing mode

fX| Interactive [H Batch Q Combination

10. General Computer Systems

Q Support/Utility ^

[~)3 Scientific/Engineering

[~] BIbliogrephic/Textual

Application area

Specific Management/

Business

Process Control Other

X-ray powder diffraction

11. Submitting organization and address Ceramics Glass & Solid State Science Division

A221, MATL

National Bureau of Standards

Washington, D. C. 20234

12. Technical contact(s) and phone

Camden R. Hubbard

301/921-2921

13.

Narrative Two X-ray powder diffractometers are controlled by this event driven control program.

AUTO allows for file handling including transfers. The data collection options include

complete pattern and quantitative analysis. The program optimizes time or counting

precision for quantitative analysis. The data file structure permits complete analysis

without further input by the user.

14.

Keywords

X-ray powder diffraction; goniometer automation; quantitative analysis

15.

Computer manuf’r and model Interdata 7/16

16.

Computer operating system

FLOXOS

17. Programing tanguage(s)

FORTRAN

18. Number of source program state- ments <^4300

19. Computer memory requirements

54 K bytes (=8 bits)

20. Tape drives none21. Disk/Drum units

1 - 5M bytes

22. Terminals

1

23. Other operational requirements

NBS Bus instrument interface

24. Software availability

Available Limited a

tn-house only

from Camden R. Hubbard on magnetic tape

25. Documentation availability

Available Inadequate

B

from Camden R. Hubbard NBSIR

In-house only

26. FOR SUBMITTING ORGANIZATION USE

185-101 Standard Form 183

1974 July

U.S. Dept, of Commerce—NS^

(FIPS. Pub. 30)
INSTRUCTIONS

01. Summary Date. Enter date summary prepared. Use Year, Month, Day format; YYMMDD.

02. Summary Prepared By. Enter name and phone number (including area code) of Individual who prepared this summary.

03. Summary Action. Mark the appropriate box for new summary, replacement summary or deletion of summary. If this software summary is a replace- ment, enter under “Previous Interna! Software ID" the internal software identification as reported in item 07 of the original summary, and enter the new internal software identification in item 07 of this form; complete all other items as for a new summary. If a software summary is to be deleted, enter under “Previous Internal Software ID" the internal software identification as reported in item 07 of the original summary; complete only items

01, 02, 03 and 11 on this form.

04. Software Date. Enter date software was completed or last updated. Use Year, Month, Day format: YYMMDD.

05. Software Title. Make title as descriptive as possible.

06. Short Title. (Optional) Enter commonly used abbreviation or acronym which identifies the software.

07. Internal Software ID. Enter a unique identification number or code.

08. Software Type. Mark the appropriate box for an Automated Data System (set of computer programs). Computer Program, or Subroutine/Module, whichever best describes the software.

09. Processing Mode. Mark the appropriate box for an Interactive, Batch, or Combination mode, whichever best describes the software.

10. Application Area. General; Mark the appropriate box which best describes the general area of application from among; Computer Systems Suppoit/Utility Process Control Management/Business Bibliographic/Textual

Scientific/Engineering Other

Specific: Specify the sub-area of application; e.g.: "COBOL optimizer" if the general area is "Computer Systems Support/Utility"; “Payroll" if the

general area is “Management/Business"; etc. Elaborate here if the general area is "Other."

11. Submitting Organization and Address. Identify the organization responsible for the software as completely as possible, to the Branch or Division level, but including Agency, Department (Bureau/Administration), Seryice, Corporation, Commission, or Council. Fill in complete mailing address, including mail code, street address, city, state, and ZIP code.

12. Technical Contact(s) and Phone: Enter person(s) or office(s) to be contacted for technical information on subject matter and/or operational aspects

of software. Include telephone area code. Provide organization name and mailing address, if different from that in item 11.

13. Narrative. Describe concisely the problem addressed and methods of solution. Include significant factors such as special operating system modifications, security concerns, relationships to other software, input and output media, virtual memory requirements, and unique hardware features.

Cite references, if appropriate.

14. Keywords. List significant words or phrases which reflect the functions, applications and features of the software. Separate entries with semicolons.

15. Computer Manufacturer and Model. Identify mainframe computer(s) on which software is operational.

16. Computer Operating System. Enter name, number, and release under which software is operating, identify enhancements in the Narrative (item 13).

17. Programing Language(s). Identify the language(s) in which the software is written, including version; e.g., ANSI COBOL, FORTRAN V, SIMSCRIPT 11.5, SLEUTH II.

18. Number of Source Program Statements. Include statements in this software, separate macros, called subroutines, etc.

19. Computer Memory Requirements. Enter minimum internal memory necessary to execute software, exclusive of memory required for the operating system. Specify words, bytes, characters, etc., and number of bits per unit. Identify virtual memory requirements in the Narrative (item 13).

20. Tape Drives. Identify number needed to operate software. Specify, if critical, manufacturer, model, tracks, recording density, etc.

21. Disk/Drum Units. Identify number and size (in same units as "Memory"—item 19) needed to operate software. Specify, if critical, manufacturer, model, etc.

22. Terminals. Identify number of terminals required. Specify, if critical, type, speed, character set, screen/line size, etc.

23 Other Operational Requirements. Identify peripheral devices, support software, or related equipment not indicated above, e.g., optical character devices,

facsimile, computer-output microfilm, graphic plotters.

24. Software Availability. Mark the appropriate box which best describes the software availability from among: Available to the Public, Limited Availability

(e.g.: for government use only), and For-ln-house Use Only. If the software is “Available", include a mail or phone contact point, as well as the price and form in which the software is available, if possible.

25. Documentation Availability. Mark the appropriate box which best describes the documentation availability from among: Available to the Public, In- adequate for Distribution, and For In-house Use Only. If documentation is “Available", include a mail or phone contact point, as well as the price and form in which the documentation is available, if possible. If documentation is presently "Inadequate", show the expected availability date.

26. For Submitting Organization Use. This area is provided for the use of the organization submitting this summary. It may contain any information deemed useful for internal operation.

GPO ; 1974 O - 954 -r, 55
NBS-114A (R£V. 0>76)

USCOMM-DC
I

.1