11 ”111111 111111111111'111111; ;; 11111111111111.1111 .111. 11111 1 :11 1 11111 1.1.1.111 1 11 I 1 11111.1 111111 11111 111 11111 11111111“ 11111 111 111'. 111 ;.11 . « 1.111 11. ; :11111 11 .111 1.11 1 111 11111111 L11111 1? 1. 111 . 11111 11 _. .. _.__... 9-. ~ m” 1 1 11 1 r «m . . r - .—.-£¥T':=f"“‘ ..,- d ~ - 1- .- - . - > ' ‘ M . .—-J...:‘. ,_ n..- ..— __ ‘ w - ~——-—-— .- H' ‘ . ,_- .- - . -A -- , I '_ “Z ...—..‘...... p. ‘ . n a _.. --- - "W 7 ~ *4. ‘v _ .‘ v — .- .~¢<1 v v .1. a..- ‘W ' wag. ~— . M w—o I . Wfl: *— .~. . '.- -v - 4» .4...— 4 - - Tm _.....l~-_ .._..—.,_,_ ~ .. . -, .— ___.._—.' _ Q. ; -, ~‘ 1., <>< -. . .p. - I“ f, ~.f.,- ,3 --. -. .r .- .-. n. .. -. VA _.~4 -4 .. - .— ~ v-V-‘W'vl v r- '- -l, a...» 1 n... ,_..,- "J. ' - J. -v- w . ‘qM . a“..-.rr W - ~n‘ . -.—__g r -. v- v- A r...- .. - _.._ . 7.. a—m-f -~ < -. ' ‘ .4. r o... .fi >_ _ _- - .. - " in}: . -. .4 A v ‘ u— - 4;. -, . - 1 ,._ .53.. v .- ~.-_--.-..v- ’ - "w “ ' ' a .-. ...— ‘ ;—. 1w--- ‘ o .. ‘1 - ' .fl - v a. -n . -. , v _ - .- - ~ -. 1‘ an...“ m- 4...... -:." A x ‘ o - ‘ ~ __ . , -~ - . - —- ‘ - I - - - c _ ~ .. , - 1 . ’ o -.. ‘5 - — "u . - ' u..- i Q ‘ ¢ 11111111 1 1111111 1 11111 . 1111111 1111 .. 1 11.1. "111" 11 1111111 111111 11 111111 .1' “11111111111111111111111111111111111 11" '1" ""111. 111 _ 1 11.. l11111 11111 1111111111 111111 11111111111 11 1111 “11111111111111111 1:111111;1;11 1 .1 ' .11: 11111.». 11111111 ;;;;;; ;;;1;;;;1;1 1; 1111111111 111111111 1 111 ' i 11111.1? :11“ . N 111 - 1 1':11113131:11.11: 111 w 111'“ .1; .1 1 111111 ;;;11 ;;;1111 ;‘ m; 1'1 111111111 11. 111 ' '1 ‘ 111111 ;1; 1111 1 11111111111111 11111 1111:1111 111111111 11 11111.11 1 1 1111111 11 1111 11111 111111111111111111111111111111 111111111111111.11111111111 ’“" 1-11 ; 11;;1’111111111111111111111111 111111111111 1, 1» 1'11 111 11:1 1|111111 11.. 111'. 1'1 111111 111 11111111111111 ' 111/:1" 1‘ " 11111111111111 111 [111.1111 111 111111111 111111 11111 11 1 ' 11.1 11.1 1 ;1.1 1 1 1‘11.1;"11.111 11 1111 111 ‘1: 1‘1. . ' '1 111: 1111 1111 1.11 ; 1 ; 11111.1;;1111111 .n. ‘ 1} I 111 ' 11111 1.1 LIBRARY ‘ W5”- A Umasity This is to certify that the thesis entitled A Minicomputer-Based Automatic Real-Time Data Acquisition System presented by Walter Nester II has been accepted towards fulfillment of the requirements for Master of Science degree in Electrical Engineering and Systems Science ZQ/M Major professor Date -/://2’§/J/ 0-7 639 A MINICOMPUTER-BASED AUTOHATIC REAL-TIME DATA ACQJISITION SYSTEM By Walter Hester II A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE Department of Electrical Engineering and Systems Science 1978 ABSTRACT A HINICOMPUTER-BASED AUTOMATIC REAL-TIME DATA ACQUISITION SYSTEM by Halter Nester II A minicomputer-based data acquisition system which automatically records data from remotely located groups of sensors has been designed, constructed, and tested. It was developed to meet the data gathering requirements of the Water Quality Management Facility of the Institute of Water Research at Michigan State University but has general applicability to other large-scale, distributed, physical systems. The minicomputer communicates with each group of sensors via dial-up telephone lines. Each sensor is automatically sampled at a fixed rate; the maximum sampling rate is once every fifteen minutes. Once a day the minicomputer transfers the accumulated sensor data to a large, main computer, via a dial-up telephone line, where it is entered into a permanent data base. A Real-Time Operating System also allows an operator to simultaneously access the data acquisition system to obtain the current value of any sensor. ACKNOWLEDGEMENTS I would like to thank the following people for their support on this project: Gary S. Krause for designing and constructing portions of the Remote Station which was used to test the DAS in the laboratory; Sigurd L. Lillevik for his floppy disk-based object file loader program, SIGMA, which greatly simplified the software development phase of this project; and a special thanks to my advisor and major professor, Dr. P. D. Fisher. I am grateful for his continued encouragement, assistance, and patience throughout this project. 11 TABLE OF CONTENTS Chapter I INTRODUCTION . Chapter II HARDWARE ORGANIZATION . Introduction . . . Central Station Organization Minicomputer I Processor . . . . . . . . . . . . .l.l Power Fail Detector . l l .2 Real- Time Clock . .3 Teletype Port . .2 16K Memory. . .3 Disk Controller . .4 Automatic Calling Unit Multiplexer (ACUM) .5 Asynchronous Modem Controller (ACM). .6 Custom Controller . . . . . . . Dual Floppy Disk Unit . Modem/Calling Units . Display Controller. Local Modem/Controller. Battery Real-Time Clock . Remote Modem/Controller . Remote Station Organization . NNNNNNNNNNNNNNNNNNN WNNNNNNNNNNNNNNNNN— Chapter III SYSTEM ORGANIZATION. . 3.] Introduction. . 3.2 Automatic Acquisition Mode. 3.3 Dump Mode . . 3.h Disk Error Mode . 3.5 Power Restart Mode. 3.6 Manual Mode . . . 3.6.] A Command . . 3.6.2 D Command . . 3.6.3 H Command . 3.6.h K Command . . 3.6.5 P Command . . 3.6.6 5 Command . 3.6.7 T Command . 3.6.8 U Command . . 3.6.9 V Command 3.6.10 W Command. 3.6.II X Command. 3.6.I2 Y Command. . ooooooox 0‘ Chapter IV SOFTWARE ORGANIZATION . Introduction. Interrupts. . . . . . . Station Definition Blocks . . Sensor Definition Blocks. . Floppy Disk Organization. . Real-Time Clock . . Automatic Acquisition Mode. .1 Error Message Print Routine . Dump Mode . . . . Disk Error Mode . Power Restart Mode . Manual Mode. bbbbfibbbbbbb I-‘I-‘QGDVNO‘UTJ-‘UJNH O H 4.11.1 A Command. 4.11.2 D Command. 4.11.3 H Command. 4.11.4 K Command. 4.11.5 P Command. 4.11.6 S Command. 4.11.7 T Command. 4.11.8 U Command. 4.11.9 V Command. 4.11.10 W Command . 4.11.11 X Command 4.11.12 Y Command . Chapter V CONCLUSION . Objectives. . . . . . . . . Accomplishments . . Overall Project Evaluation. UT UT U1 o e a La.) N H Appendix A BLOCK DIAGRAM COMPOSITION . Appendix B DISK ERROR CODES. Appendix C BASE PAGE INTERRUPT LOCATIONS . References. iv 49 . 49 . 49 . 84 50 51 51 53 56 64 7O 79 . 89 96 .106 .107 .110 .111 .116 .117 .118 .118 .120 .121 .124 1126 .126 .126 .130 .132 .136 .137 .139 >>>§>> vae~uanahl LIST OF TABLES Cost Breakdown . . . . . . . . . . . . . . . . . . . . .129 Custom Controller Block Diagram IC Composition . . . . .132 Local Mbdem/Controller Block Diagram IC Composition. . .133 Display Controller Block Diagram IC Composition. . . . .134 Battery Real-Time Clock Block Diagram IC Composition . .134 Remote Modem/Controller Block Diagram IC Composition . .135 H H .0... mNO‘U'IbUJNH NNNNNNNN LIST OF FIGURES Water Quality Management Facility - Lake Data Acquisition System Block Diagram. . Central Station Block Diagram. . . . . . Custom Controller Block Diagram. . . . . Display Controller Block Diagram . . . . Local Modem/Controller Block Diagram . Battery Real-Time Clock Block Diagram. Remote Modem/Controller Block Diagram. . Remote Station Block Diagram . . . . . . Floating Point Format. . . Real-Time Clock Flow Chart . . . . . . Automatic Acquisition Mode Flow Chart. Dump Mode Flow Chart . . . . . . . . . . Disk Error Mode Flow Chart . . . . . . . Power Restart Mode Flow Chart. . . . . Manual Mode Flow Chart . . . . . . . . vi 10 14 17 20 23 26 27 . 48 57 65 80 85 9O 97 CHAPTER I INTRODUCTION As a prerequisite to understanding and subsequently controlling a physical process, a suitable data base is required. And many physical systems are of the large-scale, distributed type, in which the individual points at which data must be gathered are widely separated, e.g. manufacturing or ecological systems. Thus a problem exists in gathering the data and making it available for the decision-making process. This thesis describes the hardware and software design and the operational characteristics of a real-time data acquisition system which solves these data gathering problems as they apply to a specific large-scale distributed system; namely, the Hater Quality Management Facility of the Institute of Hater Research at Michigan State University. This Facility is used for the study of the restoration of water quality by natural processes to secondary effluent from the East (1) This research is being conducted Lansing sewage treatment plant. at a four-lake system on the Michigan State University campus (see Figure 1.1). Effluent enters lake 1 and progresses sequentially to lake II by gravity feed. Nutrients are removed from the waste water as it proceeds through the system by incorporating them into harvest- able aquatic plants. The water emerging from lake 4 is then used to spray-irrigate crops. It is desired to periodically measure and record chemical properties of the water, such as temperature, 339$... 8.3 I 3333 ”8080928: .3326 Logo: HA ocsmfi tr le SUFm>m mv-(d 3 dissolved oxygen content, turbidity, pH, and conductivity, at the outlets of each of the four lakes. In addition environmental parameters such as wind speed, wind direction, solar intensity, air temperature, dew point, and soil flux must also be monitored. These sensors are widely distributed throughout the Hater Quality Manage- ment Facility. Several methods of collecting data from such widely-distributed sensors are in common use. A mechanical recording device, e.g. stripchart recorder or mechanical printer, can be located near each sensor. There are several disadvantages to this approach, however. The printed output from each of the recording devices must be manually picked up and taken to a central location for collation and preliminary analysis. Thus, the value of the physical parameter cannot be determined until the printed record has been collected and examined. This time lag in obtaining data makes it difficult to make operational decisions based on current data. The recording devices themselves could be centrally located and connected to the remote sensors via individual communication channels. However, the cost of these communication channels would be prohibitive. Further, the printed data must still be manually entered into a computer for numerical analysis. This last problem may be remedied by including a paper tape punch and suitable interface equipment at each sensor. The paper tapes could then be read into the computer, eliminating manual data entry. However, the paper tapes must still be picked up from each sensor location, and the cost of installing a paper tape punch at each sensor would be prohibitive. There is often a more efficient method to collect such data. Several sensors, located near each other, may be connected to a 4 single communication channel. The communication channels from several such groups of sensors may then be connected to a centrally located data logger. This data logger may interrogate each sensor at fixed intervals of time and temporarily store the sensor's data. Once a day the data logger may then call up a large main computer on a dial-up telephone line and send it the accumulated sensor data. Researchers can then easily retrieve the data from this main computer for analysis. Using this method, no human intervention is necessary to sample the sensors and transfer the data to the main computer. This results in a great savings in human time and effort. Addition— ally, such a data acquisition system allows an operator to quickly obtain the current value of any sensor; thus, operational decisions can be based on current data. The design objectives for such a Data Acquisition §ystem (DAS) for the Hater Quality Management Facility are: data from a maximum of 16 widely-separated groups of sensors must be automatically recorded at fixed intervals of time; the sampling rate for each sensor must be individually specified, with a maximum sampling rate of once every 15 minutes; the accmulated data must be automatically transferred to the main campus computer once a day, over a dial-up telephone line, and held at the DAS if the computer is unavailable for up to six days; the DAS must correctly restart itself after a power failure has occurred; data returned from each sensor must be checked against specified tolerance limits, and an error message printed if the data exceeds these limits; and, a non-technically trained operator must be able to access the DAS, from either the location of the data logger or from the Hater Quality Management Facility in order to obtain a printed listing of the data 5 automatically recorded from a specified sensor during the previous 24 hours, obtain the current value of any sensor, define a new sensor, remove an existing sensor, and check the status of the DAS. Chapter 2 of this thesis describes the hardware organization of such a data acquisition system. Chapter 3 explains the overall operation, including the interactive commands which allow an operator to access the DAS. Chapter II details the software organi- zation and the Real-Time Operating System. Chapter 5 concludes with a sunny of the performance of the DAS to date and suggestions for possible improvements . CHAPTER II HARDHARE ORGANIZATION 2.1 Introduction The DAS is configured as a Central Station and at least one Remote Station. The Central Station supervises the data acquisition process, while the Remote Stations interface to the sensors. The Central Station can support a maximum of 16 Remote Stations. Each Remote Station can be connected to a maximum of 62 sensors; 31 of the sensor inputs accept an analog voltage between 0 and 10 VDC. The remaining 31 sensor inputs accept a 12-bit digital TTL input. Two additional inputs are included for diagnostic purposes. Each Remote Station is also connected to a dial-up telephone line. Hhen the Central Station wants to sample a sensor at a Remote Station, it first dials the telephone number of that Remote Station. Thus, a Remote Station can be located anywhere a direct-dial telephone line is available. The Remote Station detects the ringing signal and takes its telephone offhhook. The Central Station then sends five ASCII characters to the Remote Station to indicate which sensor should be sampled. The Remote Station decodes the characters and selects the correct sensor input channel. If one of the analog channels was selected, that input is converted to a 12-bit digital number. No conversion is necessary if one of the digital channels was selected. The Remote Station then codes the 12 bits of sensor data into five ASCII characters and sends these characters back to 6 7 the Central Station. The Central Station may then request the Remote Station to sample another sensor or may terminate the telephone connection. Hhen the Remote Station detects that the telephone connection is broken, it puts its telephone on-hook and waits for the next call. The Central Station automatically dials up each Remote Station when a sensor at the Remote Station must be sampled. Each sensor is automatically sampled by the Central Station at the interval of time specified when the sensor was initially defined. The data from each sensor is stored on a floppy disk at the Central Station. Every weekday this accumulated sensor data is transferred to. the main campus computer, a Control Data Corporation 6500. The Central Station, via one of its two telephone lines, dials up the 6500 and sends it the sensor data in a condensed format. The Central Station then comands the 6500 to execute a program which converts the data back to its original form and adds it to the permanent data base. The sensor data can now be easily accessed on the 6500 Computer system. The Central Station also allows an operator access to the DAS via two Teletypes. The Local Teletype is located adjacent to the Central Station rack cabinet, while the Remote Teletype is located in the Pump House at the Hater Quality Management Facility. The Remote Teletype allows an operator to gain access to the DAS from a location where data is being gathered. An operator, using either Teletype, may obtain the current value of any sensor. The Central Station automatically dials up the correct Remote Station and requests it to sample the designated sensor. The correctly scaled and labeled value of the physical parameter is then printed on the Teletype. The Central Station can also list the data from a given sensor when it was automatically sampled during 8the previous 24 hours. An operator may also add or remove sensors and stations via.oneiof the Teletypes. Thus the DAS can be easily modified to accomodate a changing sensor network. A block diagram of the complete DAS is shown in Figure 2.1; Appendix A contains tables which list the integrated circuits that are contained in each functional block on the block diagrams for the Custom Controller, the Display Controller, the Local Modem/Control- ler, the Battery Real-Time Clock, and the Remote Modem/Controller. 2.2 Central Station Organization The Central Station consists of a rack cabinet, two data couplers, and two Teletypes. The rack cabinet contains a minicompu- ter, display panel, dual floppy disk unit, auxiliary'chassis, and two modem/calling units. A block diagramiof the Central Station is shown in Figure 2.2; the function of each component is explained in the following sections. 2.2.1 Minicomputer The minicomputer is a Computer Automation LSI-2/20, a general- purpose machine which operates with a 16-bit word length. Each block on the left-hand side of Figure 2.2 is a separate circuit card in the minicomputer chassis. The function of each of these cards is explained in the following subsections. 2.2.1.1 Processor The processor is responsible for executing each instruction of the Real-Time Operating System. It also controls all interaction with the peripheral equipment. The processor card contains the Power REMOTE STATION CENTRAL #1 STATION SENSORS REMOTE STATION #2 SENSORS SWITCHED TELEPHONE NETWORK CDC 6500 COMPUTING FACILITY REMOTE STATION #16 SENSORS Figure 2.1 Data Acquisition System Block Diagram r—¢-—————————-o Minicomputer Chassis 7 WMHCTUXOOHZHZ (ACID! 10 power supplies not shown * dedicated telephone line Figure 2.2 Central Station Block Diagram 4 Telephone Lines CBT DATA COUPLER CBT DATA COUPLER I- SWITCHES AND INDICATORS REMOTE PROCESSOR 16K MEMORY DISK CONTROLLER I ASYNCHRONOUS MODEM CONTROLLER | MODEM/ I CALLING AUTOMATIC , UNIT #1 CALLING UNIT MULTIPLEXE MODEM/ l CALLING ASYNCHRONOUS UNIT #2 MODEM CONTROLLER f ------- #27 I I Display I I CUSTOM DISPLAY ., CONTROLLER CONTROLLER I r‘ _____ LOCAL I MODEM/ I CONTROLLER l I I I I {A BATTERY . REAL-TIME l ' CLOCK I Apxlllfity.fihasaia LOCAL TELETYPE MODEM/ CONTROLLER p REMOTE TELETYPE 11 Fail Detector, the Real-Time Clock, and the Teletype port. 2.2.1.1.1 Power Fail Detector The Power Fail Detector continuously monitors the power line and generates an interrupt when a power failure is about to occur. This interrupt causes the Real-Time Operating System to halt proces- sing and shut down the DAS. A second interrupt is generated when power is restored to an acceptable level. The Real-Time Operating System then begins restarting the DAS. 2.2.1.1.2 figglrxigglglggk The Real-Time Clock generates an interrupt 120 times a second, in synchronization with the power line frequency. The Real-Time Operating System uses this interrupt to maintain a clock in the software. This clock keeps track of the time of the day, as well as the day of’the year, and determines exactly'when sensors are automat- ically sampled. The power line frequency is used as a basis for the clock because of its superior long-term accuracy compared to crystal oscillators. 2.2.1.1.3 Teletypg Egg; The Teletype (TTY) Port allows the processor to input charac- ters from a Teletype Keyboard and output characters to a Teletype printer without using a separate circuit card in the minicomputer chassis. The Teletype Port is connected directly to the Custom Controller, which selects which of the two Teletypes is connected to the Teletype Pert. 12 2.2.1.2 165 Memory The 16K Memory is organized as 16,384 words. The Real-Time Operating System itself is stored in the magnetic cores which.make up the memory. Core memory is used, rather than semiconductor memory, so that the memory's contents will not be destroyed during a power failure. 2.2.1.3 Disk Controller The Disk Controller interfaces the dual floppy disk unit to the minicomputer. The Disk:Controller uses Direct.Memory Access (DMA) to store data from core memory onto one of the disks or to transfer data from a disk to core memory. 2.2.1.” Automatic Calling Unit Multiplexer ngg!; A single ACUM card is connected to both modem/calling units. The ACUM, under control of the processor, instructs a calling unit to initiate a telephone call, and then supervises the dialing of the telephone number. The ACUM also generates interrupts to indicate to the processor the progress of the call. 2.2.1.5 Asynchronous Mgggg Controller Igggj Two AMC cards are installed in the minicomputer chassis. Each AMC is connected to one of the modem/calling units. After a calling unit has dialed a telephone number and established a data connection, the AMC supervises the flow of data to and from the associated modem. Each AMC is set up to transmit and receive at 300 baud, with even parity. The Remote Stations and the 6500 Computer system operate with this same data convention. 13 2.2.1.6 Custom Controller The Custom Controller functions as an interface between the minicomputer and the battery-operated Real-Time Clock, the Display Panel, and the two Teletypes. It decodes certain input, output, and select instructions and sends control signals to the Local Modem/ Controller, the Battery Real-Time Clock, and the Display Controller. The Custom Controller also selectively transmits the signals on the minicomputer data bus to the Battery Real-Time Clock and the Display Controller, and receives signals from the Battery Real-Time Clock which it then selectively transmits onto the minicomputer data bus. The Custom Controller also responds to three sense instruc- tions; it selects the proper sense line and connects it to the minicomputer bus when the sense instruction is being executed: SEN :13,l — checks the status of the PRINT ERRORS switch on the Local Teletype. If the switch is on, the next sequential instruction is skipped. SEN :13,2 - checks the status of the Manual Mode Authorization Over- ride switch on the rear panel of the Central Station rack cabinet. If the override switch is on, the next sequen- tial instruction is skipped. SEN :15,0- checks the status of the RESET push button switch on the Display Panel. If the button is pushed in, the next sequential instruction is skipped. A block diagram of the Custom Controller is shown in Figure 2.3. 2.2.2 Dual Floppy Disk Unit The Dual Floppy Disk Unit contains two floppy disk drives and an interface which connects them to the Disk Controller. This interface 14 LINE ‘4)“ 3 LINE _ , fiEUO>DEI§ DRIVERS-A ‘ RECEgVERS ] CBOO-CBl3 IN 14 LINE DRIVERS-B LINE DRIVERS-C OTA :15 4 INA :15 O H LINE DRIVERS—D SEL :15 5 SEL DECODERS AND LATCHES JII SELzl3 2 ! LINE DRIVER—E SEL:13 4* DEVICE ADDRESS SEN : SENSE SELECTOR LINE RECEIVERS—D A301 SEN :15 0 *also set by RST Figure 2.3 Custom Controller Block Diagram clock card display card clock‘card local m7c card 15 has been modified so that neither disk can be write-protected. This modification is necessary since the disks normally become write— protected when power is initially applied,(2) and the Real-Time Operating System must always be able to write on both disks. The DAS stores the automatically-gathered data from each sensor on the disks. The disks also contain the parameters which define each sensor. Chapter 4 gives the locations on each disk where the sensor data and definitions are stored. 2.2.3 Modem/Calling Units Two Vadic modem/calling units are included in the DAS.(3) They are interfaced to the minicomputer thru the Automatic Calling Unit Multiplexer (ACUM) and two Asynchronous Modem Controllers (AMC) in the minicomputer chassis. Each modem/calling unit is also connected to a separate dial—up telephone line via a Bell System CBT Data Coupler.(u) Each calling unit, when it receives the correct control signals from the ACUM, instructs its Data Coupler to initiate a telephone call. The calling unit then dials the digits of the telephone number presented to it by the ACUM. After all the digits are dialed, the calling unit transfers control to the associated modem when a data set answers the call. Data can now be exchanged between the processor and the modem via the AMC. The Real-Time Operating System uses the modem/calling units to communicate with a Remote Station when it is sampling a sensor and also to communicate with the 6500 Computer system when it is trans- ferring a 2” hour block of sensor data. Two modem/calling units are included so that Remote Stations can be called at the same time that 16 data is being transferred to the 6500. 2.2.4 Display Controller The Display Controller interfaces the Display Panel numeric readouts, indicators, and switches to the Custom Controller. The Custom Controller signals the Display Controller when certain output instructions are executed by the processor and transfers the data on the minicomputer data bus to the Display Controller. Numeric readouts on the Display Panel indicate the DAS time (hours, minutes, and seconds) and the day of the year. The status of the DAS is shown via three indicators: RUN, START, and FATAL ERROR. The green RUN indicator shows that the DAS is functioning normally; the yellow START indicator shows that the DAS is recovering from a power failure; and the red FATAL ERROR indicator shows that a disk error has occurred. The Display Controller also turns on a loud audible alarm and the red ALARM STOP indicator when the Custom Controller signals that a Fatal Error has occurred. Hhen the flashing red ALARM STOP indicator is pushed in, the Display Control- ler turns off the alarm. The Display Controller signals the Custom Controller when the blue RESET push button on the Display Panel is pushed in. A block diagram of the Display Controller is shown in Figure 2.4. i The fellowing instructions affect the operation of the Display Controller after they are decoded by the Custom Controller: OTA :15,3-— stores bits 0 thru 3 of the A register in a latch on the Display Controller card. The bits have the following significance: bit 0 controls the RUN indicator lights on the Local Teletype and the Display Panel, and when custom card custom card 17 ) LINE y RECEIVERS-A 12 BCD-TO- 7 SEGMENT CONVERTERS 21 A LED ) 7 SEGMENT *“V DISPLAYS LATCHES .l RUN AND INDICATORS DRIVERS ' ' START INDICATORS 5 SONALERT LINE RECEIVERS-B L ALARM ‘ STOP PUSH BUTTON I RESET 1 PUSH BUTTON Figure 2.4 Display Controller Block Diagram OTA OTA OTA OTA :15,4-- :15,5 " :15,6- :15,7 '- 18 set turns off the audible alarm and the ALARM STOP lighted push button switch on the Display Panel; bit 1 controls the START indicator lights on the Local Tele- type and the Display Panel; bit 2 controls the FATAL ERROR indicator lights on the Local Teletype and the Display Panel, and when set turns on the audible alarm and the flashing ALARM STOP lighted push button switch on the Display Panel; and bit 3 controls the RESET indicator light on the Display Panel. sets the seconds readout on the Display Panel from the A register. Bits 0 thru 3 must be set with the BCD code for the units digit, and bits 4 thru 7 must be set with the BCD code for the tens digit. sets the minutes readout on the Display Panel from the A register. Bits 0 thru 3 must be set with the BCD code fer the units digit, and bits 4 thru 7 must be set with the BCD code for the tens digit. sets the hours readout on the Display Panel from the A register. Bits 0 thru 3 must be set with the BCD code fer the units digit, and bits 4 thru 7 must be set with the BCD code for the tens digit. sets the days readout on the Display Panel from the A register. Bits 0 thru 3 must be set with the BCD code fer the units digit, bits 4 thru 7 must be set with the BCD code fer the tens digit, and bits 8 thru 11 must be set with the BCD code for the hundreds digit. 19 2.2.5 Local Modem/Controller The Local Modem/Controller interfaces both the Local Teletype and the Remote Teletype to the Teletype port of the processor. The Custom Controller instructs the Local Modem/Controller to select which Teletype is active. Hhen the Remote Teletype is selected, the modem translates the digital signal from the Teletype port into an audio frequency signal which is then sent to the Remote Modem/Con- (5’6) The remote modem then troller via a dedicated telephone line. converts the received audio frequency signal into a digital signal which the Remote Teletype can accept. The use of modems and a dedicated telephone line allows the Remote Teletype to be located as far away as desired from the Central Station rack cabinet. The Local Modem/Controller also generates the DCl control character when the Local REQUEST button is pushed. This character is sent to the Teletype port of the processor if the circuit.was enabled by the Custom Controller. The Local Modem/Controller turns the Local Teletype on and off when the Custom Controller sends it the proper signals. Hhen the Local Teletype is first turned on, the Printer Enable Delay circuit insures that no data is sent to the Teletype printer fbr 600 msec. This delay allows the motor to come up to full speed first. A block diagram of the Local Modem/Controller is shown in Figure 2.5. The Custom Controller decodes the fOllowing instructions which affect the operation of the Local Modem/Controller: SEL :13,0- turns off the carrier that the local modem transmits to the remote modem. The remote modem detects the absence of a carrier, turns off the RUN indicator light on the Remote Teletype, and then turns on the START indicator 20 . TTY input LINE INPUT ORIGINATE ort DRIVER SELECTOR MODEM P __.. , Dedicated MONOSTABLE Telephone Line fl T DEBOUNCER UART '0 ——I TRANSMITTER R LINE u -—-——lI j; 4, < E RECEIVERS—A g ——> I 9 REQUEST u —I PUSH CLOCK P BUTTON MANUAL SEND POWER CONSTANT R222¥VER szTCH SPACE TTY output LINE OUTPUT -- DgiggER -———-—-OI _ A. port RECEIVER B SELECTOR LATCH PRINTER MULTIPLEXER L. DRIVERS—A Tinter PRINTER AND ENABLE INTERFACE DE y i TELETYPE LINE Telet e I W KEYBOARD 2:38 .— BUSY keyboard INTERFACE INDICATOR TELETYPE REQUEST Telet e _ ower RELAY DRIVERS B INDICATOR p DRIVER relay Figure 2.5 Local Modem/Controller Block Diagram SEL SEL SEL SEL SEL SEL SEL SEL :13,l.- :13.2 ‘ :1333" :13,4- :13,5 " :13p6 '- :15,0- :15.1 " 21 light. turns on the carrier that the local modem transmits to the remote modem and resets it for normal data communi- cation with the Remote Teletype. The remote modem turns off the START or FATAL ERROR indicator lights, if they were on, and then turns on the RUN indicator light on the Remote Teletype. causes the local modem to transmit a constant space to the remote modem. The remote modem detects this, turns off the RUN indicator light on the Remote Teletype, and then turns on the FATAL ERROR indicator light. turns on the LINE BUSY indicator light on the Local Teletype and prevents the local REQUEST switch from generating the DCl control character. turns off the LINE BUSY indicator light on the Local Teletype and allows the local REQUEST switch to generate the D01 control character when it is pushed. connects the Local Teletype keyboard to the Teletype port of the processor and disconnects the Remote Tele— type. (The Local Teletype printer is always connected to the Teletype port.) disconnects the Local Teletype keyboard from the Tele- type port of the processor and connects the Remote Teletype. turns on the Local Teletype. turns off the Local Teletype. 22 2.2.6 Battery Real-Time Clock The Battery Real-Time Clock is a battery-operated clock which continues to run during a power failure. Hhen power is restored, the Real-Time Operating System reads the Battery Real-Time Clock to determine the current time. The DAS requires the current time to complete the restart procedure. The Custom Controller reads the Battery Real-Time Clock and transfers the time to the minicomputer data bus when the correct sequence of instructions is executed. The Clock can also be set from the minicomputer data bus by the Custom Controller when another sequence of instructions is executed. A block (11an of the Battery Real-Time Clock is shown in Figure 2.6. The Battery Real—Time Clock responds to the following instruc- tions after they are decoded by the Custom Controller: INA :15,0- transfers the minutes and seconds time from the Battery Real—Time Clock to the A register. The seconds, in binary, are contained in bits 0 thru 5; the minutes, also in binary, are contained in bits 6 thru 11. The SEL :15,5 instruction must be executed first. INA :15,1 - transfers the hours and days time from the Battery Real- Time Clock to the A register. The hours, in binary, are contained in bits 0 thru 4; the days, also in binary, are contained in bits 5 thru 13. The SEL :15,5 instruction must be executed first. OTA :13,0- sets a new time, from the A register, into the seconds and minutes counters in the Battery Real-Time Clock. The seconds counter is set from bits 0 thru 5; the minutes counter is set from bits 6 thru 11. The SEL custom card custom card custom card 23 A I LINE (r1 _!, 1 14 MULTIPLEXER ( CBOO—CBl3 I DRIVERS 4 TA. TA. 14 M 12" LINE LEVEL RECEIVERS , 4A . ._l ::::::> I ) COUNTERS ] j CONVERTERS . AND v v r ' DBZOO- 14 26 AND D3213 LEVEL LATCHES CONVERTERS an. LINE I I LATCHES OSCILLATOR RECEIVERS Figure 2.6 Battery Real-Time Clock Block Diagram 24 :15,6 instruction must be executed first. OTA :l3,1 - sets a new time, from the A register, into the hours and days counters in the Battery Real-Time Clock. The hours counter is set from bits 0 thru 4; the days counter is set from bits 5 thru 13. The SEL :15,6 instruction must be executed first. SEL :15,5- sets up the Battery Real-Time Clock so that it can be read. This instruction must be executed before either INA :15,0 or INA :15,1 is executed. SEL :15,6 - enables the Battery Real-Time Clock to be set with a new time. This instruction must be executed befOre either OTA :13,0 or OTA :13,l is executed. SEL :15,7- sets the Battery Real-Time Clock for normal operation. This instruction must be executed after the Clock is read or set with a new time. 2.2.7 Remote Modem/Controller The Remote Modem/Controller interfaces the Remote Teletype to the dedicated telephone line. This dedicated telephone line connects the two Modem/Controllers and allows the Remote Teletype and the DAS to communicate with each other. The Remote Modem/Controller generates the 002 control character when the REQUEST button on the Remote Teletype is pushed. This control character is sent to the Local Modem/Controller over the dedicated telephone line. If the Remote Teletype is selected by the Local Modem/Controller, the control character is then sent to the Teletype port of the processor. The Remote Modem/Controller turns the Remote Teletype on and 25 off} it contains the same delay circuit that the Local Modem/Control— ler does. Data is not presented to the Teletype printer until 600 msec after the Teletype is turned on. This allows the motor to come up to full speed first. A block diagram of the Remote Modem/Control- ler is shown in Figure 2.7. The Remote Modem/Controller responds to the following ASCII control characters when they are received from the processor via the dedicated telephone line: DC3(:93)- turns on the Remote Teletype. DC4 (:94)-— turns off the Remote Teletype. DLE(:90)- turns on the LINE BUSY indicator light on the Remote Teletype. ETB»(:97)- turns off the LINE BUSY indicator light. NAK(:9S)- enables auto—echo at the Remote Teletype: anything typed on the Teletype keyboard is immediately printedion the Teletype printer. SYN (:96) - disables auto-echo. (8) 2.3 329233 Station Organization A Remote Station consists of a rack cabinet and a single Data Coupler. A block diagram of a Remote Station is shown in Figure 2.8. The modem is connected to a Bell System CBT Data Coupler. The Central Station begins the process of sampling a sensor by calling the Remote Station on a dial-up telephone line. The Data Coupler at the Remote Station detects the ringing signal on the telephone line and signals the modem. The modem then instructs the Data Coupler to take its telephone off-hook and establishes a data connection. The Central Station next requests the Remote Station to sample a 26 REQUEST I UART DEBOUNCER HTRANSMITTER | Dedicated ' ' ’ Telephone RESET ——-§ Line CIRCUIT [ CLOCK TRANSMIT UART r-qILULTIPLEXER RECEIVER DECODER L. DECODER AND RUN AND DRIVERS L-.. INDICATOR "' LATCHES FATAL IN3¥2§$OR ERROR DRIVERS-A INDICATOR A TELETYPE L--—-DLUPRINTI~:R _ LINE Telet e t yp PRINTER LTIPLEXER H. BUSY Printer AND ENABLE INTERFACE INDICATOR Telety e TELETYPE AUTSAESEE MANUAL keyboard KEYBOARD OVERRIDE POWER INTERFACE SWITCH Teletype I TELETYPE _ 1 REQUEST %wer 1 RELAY DRIVERS B INDICATOR 9° DRIVER I relay , - , Figure 2.7 Remote Modem/Controller Block Diagram 27 Channel 32 input and rear panel connector 8 8-BIT D/A CONVERTER RECEIVER Channel 0 input and rear-panel 64:1 TIPLEXER TRANSMITTER CBT DATA Sensor COUPLER ON—LINE switches 2:1 Telephone MULTIPLEXER Line Station ON—LINE switch 32:1 ANALOG MULTIPLEXER 32:1 DIGITAL MULTIPLEXER 12-BIT A/D CONVERTER CID”. 2 CWOII Digital Analog input input channels channels Figure 2.8 Remote Station Block Diagram 28 particular sensor by transmitting five ASCII characters to the Remote Station: : C1 C2 3 7 The modem converts the received audio frequency tones from the telephone line into a digital signal which is sent to both the transmitter and receiver. The receiver decodes Cl and C2, ASCII digits between 0 and 7. The lower three bits from these two which are characters are concatenated to form a six-bit address to select one of the 64 sensor input channels. Five of these bits select one of the 32 digital inputs and one of the 32 analog inputs. The most significant bit selects between the output of the digital multi- plexer and the output of the analog to digital (AID) converter. The six bits also select one of the 64 ON-LINE switches on the front panel of the Remote Station. The transmitter then decodes the ? sent by the Central Station and co-ands the A/D converter to begin the conversion process. Hhen the conversion is complete the transmitter begins transmitting five ASCII characters back to the Central Station. The first four ASCII characters contain the 12 bits of sensor data which are selected by the multiplexers. If the selected sensor's front panel switch is in the ON-LINE position, the four transmitted characters are ASCII digits between 0 and 7. The first character contains the three most- significant bits of the sensor data while the fourth character contains the least significant three bits. Otherwise, to indicate an off-line condition, bit 7 of each transmitted character is set, resulting in alphabetic characters being transmitted to the Central Station. The fifth character sent by the’ transmitter is a stop character; it must be sent for correct transmitter operation. 29 After the transmitter has completed sending the five characters to the Central Station, the Central Station may request the Remote Station to sample another sensor via the same sequence of'characters. Hhen the Central Station terminates the telephone connection, the modem at the Remote Station detects the loss of the carrier and puts its telephone on—hook. The Remote Station is now ready to accept another call. The Remote Station includes a data path integrity check which allows a data pattern to be received from the Central Station and then transmitted back to the Central Station as a check on the operation of the Remote Station. This test feature is activated when the Remote Station receives the character string: = P1 P2 C1 C2 3 ? C1 and C2 have the same function as explained above. The low-order 4 bits of P1 and P2 are concatenated to ferm an 8-bit test pattern, with the 4 bits from P1 comprising the most significant half. The receiver decodes P1 and P2 and presents the 8-bit test pattern directly to channel 32. The test pattern also appears on the channel 32 connector on the rear panel of the Remote Station and is simultap neously converted to an analog voltage by a digital to analog (D/A) converter. This analog voltage is connected to channel 0 and also appears on the rear panel channel 0 connector. The ? causes the transmitter to encode the channel selected by C1 and C2 into five ASCII characters which are sent to the Central Station, as before. The Central Station can then compare the received and transmitted data pattern to determine if any errors occurred at the Remote Station. If C1 and C2 select a channel other than 0 or 32, a jumper cable must be connected between either the channel 0 or the channel 30 32 connector and the selected sensor input connector fer the data path integrity check to function correctly. CHAPTER III SYSTEM OPERATION 3.1 Introduction The DAS has three basic modes of operation: Automatic Mode, during which the sensors at the Remote Stations are sampled and the data stored at the Central Station; Dump Mode, during which the accumulated sensor data is transferred to the 6500 Computer system; and the Manual Mode, during which an operator is able to access the DAS via one of the Teletypes. Any two, or all three, of these basic modes may be occurring simultaneously. In addition there are two error modes: The Disk Error Mode is entered if an error in one of the disk units occurs; the Power Restart Mode is entered when power is restored fellowing a power failure. Both of these error modes lock out all other modes and do not allow normal DAS operation until they have finished. Each of these five modes is explained in detail in this chapter. 3.2 Automatic Acguisition 5222. The Automatic Acquisition Mode is entered every fifteen minutes. The DAS»checks the definitions for each sensor to determine which should be supled. If any sensors at a particular Remote Station should be sampled, that station is called on a dial-up telephone line and a data connection is established. The Central Station then requests the Remote Station to sample each required 31 sensor and stores the received segsor data in the correct sensor data block on a floppy disk. The received data is also checked against the tOlerance parameters for that sensor. An error message, indicat- ing which sensors returned out-of-tolerance data, is printed on the Teletype(s) after the Automatic Acquisition Mode has completed sampling all the required sensors. A transmission error may occur; the Central Station detects this and requests the Remote Station to retransmit the individual sensor's data. Three attempts are made to sample each sensor; if transmission errors occur all three times, a missingedata flag is written into that sensor's data block and the next required sensor at the Remote Station is sampled. If transmission errors prevent the Central Station from receiving data from three sensors at one Remote Station, the Central Station writes missing-data flags into the sensor data blocks fOr all remaining sensors that should be sampled at that Remote Station. The next Remote Station is then called if any sensors at it should be sampled. Missingedata flags are also written into a sensor data block if the sensor was placed off-line at either the Remote Station or the Central Station. The telephone connection to a Remote Station may be accidental- ly broken due to equipment malfunction at the telephone company. In this instance the Central Station redials the Remote Station and attempts to reestablish a data connection. Missingpdata flags are added to the appropriate sensors' data blocks if this attempt is unsuccessful. Hhen the Automatic Acquisition Mode has completed sampling the required sensors, it prints any accumulated error messages on the Teletype(s) as soon as they are available, since an operator may be 33 using one to access the DAS. Error messages are always printed on the Remote Teletype. They are also printed on the Local Teletype when the blue PRINT ERRORS push button switch on the Local Teletype is turned on. This switch locks in and lights up to indicate that it is turned on. Pushing the button a second time disables the local error listing. A typical error listing is shown below. The time and date of the Automatic Acquisition is printed on the first line. The first number in each pair listed under the "OUT OF TOLERANCE" heading is a station number, and the second number is the sensor at that station which is out of’tolerance. Data received from these sensors is still stored in the sensor data blocks. Sensors at the stations listed under the "NO REPLY" heading, which should have been sampled, have missingedata flags written into their sensor data blocks. If the Automatic Acquisition Mode cannot sample all the required sensors in 15 minutes, the message "NOT ENOUGH TIME TO SAMPLE ALL SENSORS" is printed and missingedata flags are written into the sensor data blocks of the sensors which could not be sampled. 14:30 6/30/77 THESE SENSORS ARE OUT OF TOLERANCE: 1,05 6,04 6,05 6,06 NO REPLY FROM THESE STATIONS: 8 NOT ENOUGH TIME TO SAMPLE ALL SENSORS 3.3 2222 Eggs This mode is entered every weekday morning after the 9:00 Automatic Acquisition Mode has finished. During the DumpIMode, a 34 24-hour block of data from each sensor is transferred to the 6500 Computer system. The 6500 is called on a dial-up telephone line, and a data connection is established. The DAS scans the 6500 header message and sends the password, problem number, and user ID at the correct time. After the 6500 has responded and completed logon procedures, the DAS requests the 6500 to begin executing the input processing program. This program prompts the DAS to send a condensed version of the sensor data line by line. The actual fermat used to transmit the sensor data is given in Chapter 4, section 4.8. Trans- mission accuracy is insured by including two checksum characters at the end of each line sent to the 6500. The 6500 recomputes the checksum for the line; if it doesn't match the checksum transmitted with the line, the 6500 requests the DAS to retransmit the same line. If any one line must be retransmitted five times, the DAS terminates the data connection to the 6500. The DAS then redials the 6500 and retransmits the same 24-hour block:of sensor data from the beginning. Hhen all the sensor data from one 24-hour block is transferred, the DAS requests the 6500 to add the sensor data to the data base. The DAS logs off the 6500 when this operation is completed. This procedure is then repeated if any more 24-hour blocks of sensor data must be sent to the 6500. More than one 24-hour block of sensor data is transferred if the 6500 was not available the previous day; this occurs on Monday mornings. Seven days of sensor data are automatic- ally stored at the Central Station if the 6500 is continuously unavailable. If the 6500 is still not available on the eighth day, the oldest 24-hour block of sensor data is erased to store the sensor data from the past 24 hours. 35 3.4 Disk Error Mode This error mode is entered if’either floppy disk drive generates an error. Hhen an error occurs, all the other modes that may have been active are immediately terminated. All normal DAS activities are suspended until the disk error is manually corrected. An error message, reproduced below, is printed on both Teletypes, and the red FATAL ERROR indicator lights on both Teletypes and the Display Panel of the Central Station are turned on. Additionally, a loud audible alarm is activated at the Central Station. This audible alarm may be silenced by momentarily pushing the flashing red ALARM STOP button on the Display Panel. After the cause of the disk error has been determined and corrected, pushing the blue RESET button on the Display Panel causes the DAS to check the operation of both disk drives. If they function correctly, the DAS enters the Power Restart Mode to begin restart processing. Appendix B contains a list of the error codes generated by the disk controller. $333 $333 FATAL SYSTEM CRASH 15:34 6/30/77 $$$$ NOTIFY SYSTEM SUPERVISOR AS SOON AS POSSIBLE $$$$ 3.5 £9335 Restart Mggg The DAS detects when a power failure is about to occur and halts all processing. Hhen power is restored, the DAS immediately enters the Power Restart Mode, but waits one minute before beginning restart processing in case another power failure occurs. After the minute has elapsed, the DAS reads the correct time from the Battery Real- Time Clock. Using this time, it adds missing-data flags to the 36 appropriate sensor data blocks to update them to the correct time. Hhen restart processing is completed, the DAS prints the message below on both Teletypes and resumes normal processing. The DAS is able to correctly recover from a power failure that occurs while it is doing restart processing from a previous power failure. The yellow START indicator light on both Teletypes and the Display Panel of the Central Station indicates when the Power Restart Mode is active. $$$$$ RECOVERY COMPLETED 12:32 7/1/77 3.6 mm me: The Manual Mode allows an operator to access the DAS via either of two Teletypes; only one Teletype may be in use at a given time. To request access, the blue REQUEST button on a Teletype is pushed. If the other Teletype is not in use, the DAS turns on the Teletype and prompts for a command by typing an asterisk ('). The operator may then type any one of the valid command letters. Typing an invalid command letter causes the DAS to prompt for a command again. The Teletype is automatically turned off if nothing is typed within 30 seconds. Hhen one of the Teletypes is in use, the white LINE BUSY indicator light on the other Teletype is turned on; pushing the REQUEST button on that Teletype has no effect. The current status of the DAS is displayed by three indicator lights on each Teletype. The green RUN light indicates that the DAS is functioning normally; the yellow START light shows that the DAS is in the Power Restart Mode; and the red FATAL ERROR light indicates that a disk error has occurred. The Manual Mode can be entered only when the green RUN light is on. 37 Two levels of security are provided to protect against unautho- rized modifications of DAS parameters. The Level 1 password is requested if the operator attempts to place a sensor on-line or off- line at the Central Station, or if he attempts to change the Level 1 password itself. The Level 2 password is requested when new stations and sensors are defined, when existing stations and sensors are deleted, and when the Level 2 password itself is changed. Once the correct Level 2 password is entered, commands requiring the Level 1 password are automatically allowed. As soon as a correct password has been entered, any of the commands protected by that password may be executed without reentering the password, as long as the Manual Mode is not terminated. Once the DAS turns off the Teletype, the password(s) must be reentered during the next Manual Mode access. Each of the valid commands is explained in detail in the following sections. The underscored characters are those typed by the operator. 3.6.1 A Command This command places sensors on-line at the Central Station; data received from a sensor during the Automatic Acquisition Mode is then stored at the Central Station (if the sensor is also on-line at the Remote Station). If the sensor is off-line (see D command), a missing-data flag is stored in the sensor's data blockzwhenever it is time to automatically sample the sensor. The A command allows the letter "A" to be entered instead of a sensor number; this causes all sensors at the designated Remote Station to be placed on—line at the Central Station. Note that the back-arrow ((-) is used to correct a typing error; sensor 27 at 38 station 8 is therefore placed on-line. The DAS checks that the requested station and sensor exist and prints an error message if a nonexistant station or sensor number is entered. This command is terminated by typing a period or escape (ESC) instead of a station number. Level 1 authorization is required to execute the A command. ' A STA: 1__ SEN: _5__ STA: 9. SEN: 3. STA: 8 SEN: 24+? STA: 9 SEN: ;§_DOESN'T EXIST STA: 3.6.2 2 Command The D command places sensors off-line at the Central Station. Hhen the Automatic Acquisition Mode samples a sensor which is off- line, a missing-data flag is stored in its sensor data block. The usage of the 0 command is identical to that of the A.command. Level 1 authorization is likewise required before this command can be exe- outed. 3.6.3 5 Command This command prints the sensor data which was automatically gathered by the Automatic Acquisition Mode during the previous 24 hours fer a selected group of sensors. The data from a maximum of six sensors may be printed at the same time. The list of requested sensors is ended by following the last sensor number by a period rather than a space, or by entering a period and then a space for the following station number. The time and date that the listing begins is printed at the top of each page. A second page is automatically may be terminated at any time by typing (ESC); 39 printed if all the data cannot fit on a single page. The printing the current line finishes printing, and the DAS then prompts fer another command. Note the nussingedata flag for sensor 5 at station 1 at 7:00; it indicates that the sensor was off-line at that time or that invalid data was received. ' H STA: 1 SEN: IUI STA: §_SEN: gl— STA: . 09:12 TIME 09:00 08:30 08:15 08:00 07:30 07:00 06:45 3.6.4 §_Command HNSP-IOM MILES/HR +8.17E+OO +7.35E+OO +4.0QE+OO +5.54E+OO -MD- 06/30/77 TEMP-30M DEG-FRET +7.41E+Ol +7.18E+01 +7.04E+Ol +6.89E+Ol This command allows the Level 1 password to be changed. The new password must contain four alphanumeric characters. ledges the new password by printing "OK". required befOre the command can be executed. The DAS acknowe Level 1 authorization is 4O ' K TYPE LEVEL 1 PASSHORD: g!!! TYPE NEH LEVEL 1 PASSHORD: Illl OK 3.6.5 §_Command This command prints the current value of any specified sensor. The Central Station calls the correct Remote Station, establishes a data connection, and requests the Remote Station sample the speci- fied sensor. The scaled and labeled value of the physical parameter is then printed on the Teletype. The error message "LINE 1 OCCUPIED" or "LINE 2 OCCUPIED" is printed if the telephone line is in use when the DAS expects it to be available. Both the Dump Mode and the Automatic Acquisition Mode may be using the telephone lines; in this case, the message "BOTH LINES IN USE" is printed. The P command may be attempted again in a few minutes. After either one of these two conditions occur, the DAS aborts the P command and prompts for a new command. If the Remote Station's telephone line is busy or the Remote Station doesn't answer, the message "STATION UNAVAILABLE" is printed. A data connection may be correctly established to the Remote Station, but no data is received from the requested sensor; the message "NO RESPONSE FROM SENSOR" is then printed. A data connection remains established to a Remote Station until the operator requests the value of’a sensor at another Remote Station or until the DAS automatically turns the Teletype off after 30 seconds of inactivity. Thereforé} any sensor at the connected Remote Station may be sampled without waiting;for the DAS to call the Remote Station again. A sensor may be sampled by the P command as often as desired. This command is terminated by typing a period or (ESC) instead of a station number. * 2. STA: I_SEN: §_BOTH LINES IN USE STA: I_SEN: 5 HNSP-lOM +1.27E+Ol MILES/HR STA: 1_SEN= 5 HNSP-IOM +1.21E+Ol MILES/HR STA: l_SEN= 34 DOESN'T EXIST STA: 1_SEN= 7 NO RESPONSE FROM SENSOR STA: LSEN: 2__LINE 2 OCCUPIED STA: LSEN: .2_Z_TENP-3m : +7.63E-t01 Dm-FHRT STA: LO_SEN: 1:5— STATION UNAVAILABLE STA: 3.6.6 ‘S Command This command prints a status report which lists the defined Remote Stations. If all the sensors at a Remote Station were off- line at the Remote Station during the most recent Automatic Acquisi- tion Mode, a single asterisk is printed after the station number. Two asterisks are printed after a station number to indicate that all the sensors at that Remote Station were placed off-line at the Central Station (by the 0 command). The status of the individual sensors at any Remote Station may be determined by entering the 42 station number. The single and double asterisks printed after the sensor numbers have the same meaning as explained above. In the example below, sensors 3 and 8 at Remote Station 2 were placed off- line at the Remote Station, while sensor 4 was placed off-line at the Central Station by the D command. . § STATIONS 1" 2 8' 15 STA: l SENSORS gen 7!! gas 9!: STA: 2 SENSORS II I—‘ N 3e use 5 6 7 3! STA: L 3.6.7 I Command This command prints the time and the date; the time is given in the 24 hour format. After the line finishes printing, the DAS prompts for a new command. ' I 09:46 07/01/77 3.6.8 g Command This command changes the Level 2 password. The new password must consist of four alphanumeric characters. The DAS checks the new password and acknowledges it by printing "OK". In the example below, the first attempt to enter a new password included an illegal character and was rejected. The second attempt was successful. Level 2 authorization is required to execute this command. 43 ' U TYPE LEVEL 2 PASSWORD: !!!! TYPE NEH LEVEL 2 PASSHORD: !!!! INVALID PH IC TYPE NEH LEVEL 2 PASSWORD: IIII OK 3.6.9 !_Command This command defines a new Remote Station. Each Remote Station must be given a unique identifying number between 1 and 16 inclusive. Up to 14 digits (including the letter "A”, as explained below) may be entered for the Remote Station's telephone number. Typing_"Y" in reply to "OK?" then adds the Remote Station. Typing'"N" aborts the V command and the DAS then prompts for another command. The DAS is able to dial thru more than one telephone exchange when calling a Remote Station. The letter "A” is typed in the telephone number at the point where a second dial tone is expected. In the example below, when the Central Station calls Remote Station 1, it first takes its telephone off-hook, waits for the first dial tone, dials a 9, waits for the second dial tone, and then dials the remainder of the number: 13138868449. The back-arrow is again used to correct an operator typing error. Level 2 authorization is required to execute this command. 44 N V l-STA: L 2-PHONE: 9A1313888é-68449 OK? I ADDED 3.6.10 H Command This command deletes an existing Remote Station. Typing a "Y" in response to "OK?" deletes the specified Remote Station, while typing an "N" aborts the H command. All of the sensors at a Remote Station are automatically deleted at the same time the Remote Station itself is deleted. Consequently, if the same Remote Station is later redefined (by the V command), each of the sensors at the Remote Station must also be redefined (by the X command). Once a Remote Station has been deleted, all of the data stored from the sensors at that station can no longer be accessed by any Mode. Accordingly, all the sensor data that has not yet been transferred to the 6500 Computer system will be lost. The way to insure that sensor data is not lost is to first place the entire Remote Station off-line at the Central Station (using the D command). and then later remove the Remove Station with the H command, after the Dump Mode has completed the next data dump to the 6500. This will occur on the next weekday morning the 6500 is available. The DAS aborts the H command if‘either the Automatic Acquisition Mode or the DumpIMode is processing data from the Remote Station that is to be deleted. In this case, the command may be attempted again in several minutes. The H command also aborts if an attempt is made to remove an undefined Remote Station. In the example below, 4S attempting to remove Remote Station 9 caused the DAS to abort H; after several minutes the H command was reexecuted, and this time Remote Station 9 was successfully deleted. Level 2 authorization is required to execute this command. ' Y REMOVE STATION l-STA: 2_ABORT ' E TYPE LEVEL 2 PASSHORD: !!!! REMOVE STATION 1-STA: 9_ OK? I DELETED 3.6.11 X_Command This command defines a new sensor. An example of the X command is given at the end of this section. After the sensor number (0 to 63 inclusive) is entered, the DAS checks if the sensor is already defined and aborts the X command if it is. The third entry, the sampling interval (SI), is a number between 1 and 96 inclusive. It gives the interval, in 15 minute units, between the times when the sensor is sampled by the Automatic Acquisition Mode. Fer example, with SI = 5, the sensor is automatically sampled every 75 minutes, with the first sample of each day occurring at midnight. The fourth, fifth, and sixth entries give the location on disk unit 0 where the sensor data block begins. The CYL entry must be between 11 and 26 inclusive, the SEC entry between 1 and 26 inclusive, and the HORD 46 entry between 0 and 63 inclusive. After the HORD entry is typed, the DAS checks that the new sensor data block does not overlap any sensor data block(s) already defined on the disk. If overlap would occur, the X comand is aborted. For more information on placement of the sensor data blocks on the disk, consult Chapter 4, section 4.5. The seventh entry (UT) and the eighth entry (LT) specify the upper and lower tolerances, respectively, for the sensor. The data received from all sensors is in the form of an integer between 0 and 4095. If the data a sensor sends to the Central Station during the Automatic Acquisition Mode is equal to or greater than the upper tolerance, or equal to or less than the lower tolerance, an error message indicat- ing an out-of-tolerance condition is printed on the Teletype(s). The data is still entered into the sensor data block, however. The ninth entry is the multiplier (MULT). The actual value of the physical parameter is computed by multiplying the received integer (O to 4095) by the multiplier and then adding the offset (OFFS), entry ten, to the result. The multiplier and offset are entered in floating point notation; the acceptable formats are given in Figure 3.1. The eleventh entry is the LABEL that identifies the sensor when the II or P commands are executed. Any eight printing characters may be entered for the label. The twelfth entry is the UNITS, which also contains eight printing characters and is also printed by the H or P command. After these 12 parameters are entered, the DAS asks if it should add the sensor by printing "ONT". Typing ”Y" adds the sensor with the parameters as just entered. However, if an error in typing any of the parameters is now discovered, it can be corrected by typing the line number of the parameter; the DAS then requests that 47 parameter again. If it is desired instead to abort the comand, typing "N" will do so. The escape key (ESC) may be struck at any step in the definition process and the command then also aborts. Level 2 authorization is required to execute this command. ' I DEFINE SENSOR 9—MULT: 2.53-02 lO-OFFS: m ll-LABEL: wNSP-IOM 12-UNITS: MILES/HR OKT-gL lO-OFFS: 112.32. OK? .13... lZ-UNITS: MILES/HR OK? 1 ADDED 48 +1.2578984 : 12,578.9 9.43-3 : 0.0094 1.25789EO4 12,578.9 ~9.4000OOE-3 = -0.0094 The absolute value of all floating;point numbers must be between +1.701411E+38 and +1.70l4llE-38. Figure 3.1 Floating Point Format 3.6.12 Y Command This command deletes a sensor. After the Remote Station number and sensor number are entered, the DAS verifies that the sensor does exist. If it does not, the Y command is aborted, as shown in the first example. The Y command also is aborted if either the Automatic Acquisition Mode or the Dump Mode is processing data from the same Remote Station that the sensor is located at. In this instance, the command may be reexecuted in a few minutes. Otherwise, typing "Y" in response to 40K?" deletes the desired sensor. Typing an ”N" causes the Y command to abort, and the DAS then prompts fOr another command. Level 2 authorization is required to execute this command. * I REMOVE SENSOR 1-STA: g_ 2-SEN: 13_ABORT * Y. REMOVE SENSOR 1-STA: IN 2-SEN: ILA) OK? I DELETED CHAPTER IV SOFTWARE ORGANIZATION 4.1 Introduction The software is designed to implement a Real-Time Operating System. Each of the three basic modes--Automatic Acquisition Mode, Dump Mode, and Manual Mode--may be active simultaneously. This type of operation can be achieved because the speed of the minicomputer processor is several orders of magnitude faster than external events which interface to the minicomputer. For example, the Automatic Acquisition Mode may be processing data from a Remote Station when a character is received from the 6500 Computer system. The software first saves the machine status of the minicomputer befOre allowing the Dump Mode to input the character just received. Hhen the Dump Mode finishes inputting the character and any other processing it must do, it restores the saved machine status. By saving and then restoring the machine status, the Automatic Acquisition Mode will continue executing at the same point it was at when the character from the 6500 was received. This ability to switch from one mode to another in response to external stimuli makes extensive use of the interrupt facility of the minicomputer. 4.2 Interrupts An interrupt is a signal sent to the processor indicating that some external event has occurred. Typing a character on the Teletype generates an interrupt, as does receiving a block of characters from 49 50 a Remote Station. The software can instruct the processor to ignore certain interrupts and accept other interrupts. Once the processor is enabled to recognize a particular interrupt, it executes one instruction from a fixed location in core memory when that interrupt occurs. This instruction is usually a jump and store instruction to a routine. Typically, the routine first saves machine status so that the program which was interrupted can correctly resume when the interrupt routine finishes. The routine then does whatever process- ing is required, restores machine status, and returns to the inter- rupted program. The program resumes executing as if the interrupt had not occurred. By restricting the amount of time that the interrupt routine is executing, it is possible to return to the interrupted program with only a small time loss. The Real-Time Operating System minimizes this time loss so that each of the three basic modes may be active simultaneously, with no loss of received data and no excessive time delays. 4.3 Station Definition B12255 There may be a maximum of 16 Remote Stations; each one of these stations has its own station definition block in the core memory of the minicomputer. Eight consecutive words Dorm each of these blocks; the blocks occur consecutively, starting with the Station 1 block. The beginning of this block is labeled with the name SlNUMB. The first word in each station definition block is an ID word. Bits 0 thru 7 of this word are set to :FF if the Remote Station isn't defined. If it is defined, these bits contain :00, and then bits 8 thru 15 contain the number of digits in the Remote Station's tele- phone number. The second thru eighth words of the station definition 51 block contain the digits of the telephone number; there may be a maximum of 14 digits, each represented in binary form. The first digit is in the upper byte (bits 8 thru 15) of the second word, the second digit is in the lower byte (bits 0 thru 7) of the second word, the third digit is in the upper byte of the third word, and so on. 4.4 Sensor Definition Blocks Each of the 16 Remote Stations contains inputs fOr 62 sensors and two test channels. Each one of these possible inputs has two words reserved for it in core memory. The first word contains the disk address, which is the location on disk unit 0 where the sensor data block begins. Bits 0 thru 5 of this word are the word address (0 thru 63), bits 6 thru 10 the sector address (1 thru 26), and bits 11 thru 15 the cylinder address (11 thru 26). If the sensor isn't defined, this disk address word contains :FFFF. The second word is the sensor ID word. Bit 0 is set if the sensor is off-line at the Central Station (set by the operator using the 0 Command); bit 1 is set if the sensor was off-line at the Remote Station the last time the Automatic Acquisition Mode sampled it. Bits 8 thru 15 contain the sampling interval fer the sensor, which indicates how often the Automatic Acquisition Mode will sample the sensor. This is a binary number between 1 and 96 and indicates, in 15 minute units, the time between samples. The disk address word of sensor 0 at station 1 is labeled SENOAD; the two words for each sensor follow consecutively by sensors at a station, and then consecutively station by station. 4.5 Floppy Disk Organization Two floppy disks are utilized by the Central Station. Each disk is divided into 78 cylinders, labeled from 0 thru 77. Each cylinder 52 in turn is divided into 26 sectors, labeled from 1 thru 26. Each of these sectors contains 64 words, labeled from 0 thru 63. The smallest unit of information that may be read from or written to a disk is a sector. Cylinders 1 thru 10 of both disks contain the same sensor definition blocks. There is one of these blocks for each of the 1024 possible sensor and test inputs. Each block contains 16 words; fOur blocks are stored per sector. The sensor definition blocks are arranged consecutively, with the definition block fOr sensor 0 at station 1 occupying the first 16 words of sector 1 of cylinder 1. The first two words of each sensor definition block contain the disk address of the sensor data block and the sensor ID word, respective- ly. The disk address wordion the disk has the same format as the disk address word in core memory. The sensor ID word on the disk contains only the sampling interval in bits 8 thru 15. If a sensor is undefined, the entire sensor definition block for that sensor con- tains undefined data. The third and fourth words are the upper and lower tolerances, respectively. Hhen the sensor is automatically sampled by the Automatic Acquisition Mode, any data that is outside of the tolerance parameters will cause an error message to print on the Teletype(s). The fourth and fifth words contain the multiplier, which is represented in floating point format. The sixth and seventh words contain the offset, also expressed in floating point fbrmat. The actual value of the physical parameter is computed by'multiplying the received data by the multiplier and then adding the offset. The eighth thru eleventh words contain the eight ASCII characters com- prising the label for the sensor, while the twelfth thru fifteenth words contain eight ASCII characters for the sensor's units. 53 The two disks are further divided into a total of eight sec- tions. Section 1 consists of cylinders 11 thru 26 on disk unit 0. This section contains the current sensor data blocks for all defined sensors. An individual sensor data block contains one word of sensor data for each time the sensor was automatically sampled in the previous 24 hour period, plus one word which contains the time the sensor was last sampled by the Automatic Acquisition Mode. The sensor data block begins with the time word, followed by the most recent data word. The data words then follow consecutively, from the most recent to the oldest, which is the last word in the sensor data block. For example, if a sensor has a sampling interval of 2 (30 minutes), the sensor data block then contains 49 words. A sensor data block is automatically set up on each floppy disk when a new sensor is added via the X command. Sensor data blocks may be placed anywhere in section 1, but must not overlap. The X command does not allow a new sensor to be added if its sensor data block would overlap the blocks for sensors already defined. 4.6 Real-Time Clock The minicomputer processor contains a real-time clock option which generates interrupts at fixed intervals of time. Connector J1 on the rear chassis of the minicomputer is jumpered to cause this interrupt to occur 120 times per second in synchronization with the power line frequency. The real-time clock interrupt causes the processor to execute the instruction at location :18, which is an increment and skip on zero instruction. Location :19 contains a negative number which is incremented each time the interrupt occurs. As long as the number in location :19 remains negative, only the 54 increment instruction is executed, and the interrupted program then immediately resumes executing. Hhen the number in location :19 is incremented and the result is zero, the real-time clock generates a sync interrupt, which then calls RTCLK. RTCLK first saves machine status. It then stores the number -120 in location :19 so that the real-time clock sync interrupt will again call RTCLK in one second. RTCLK stores the current DAS time in several variables: SEC, MIN, HOUR, DAY, MTH, and YEAR. Every time that RTCLK is called, it increments this stored time by one second. Once a day, at midnight, RTCLK calls BATUPD, which transfers the DAS time to the Battery Real- Time Clock. This insures that if a power failure occurs during the day the time of the crystal-controlled battery-operated clock will be extremely close to the actual time when power is restored. Each time RTCLK is called it checks if PFSKIP is set. This flag variable is set if the Power Restart Mode is still doing restart processing. In this instance, RTCLK only updates the time displays on the Display Pane1,by calling DISPLY, and then restores machine status and returns to the interrupted program. If PFSKIP isn't set, RTCLK checks PFSCAN. This flag variable is also set by the Power Restart Mode and indicates that the Automatic Acquisition Mode can resume normal operation when the DAS time reaches the Restart Time, which was set by the Power Restart Mode in variables RSIIN and RSHOUR. Hhen the DAS time is the same as the time stored in these two variables, RTCLK resets PFSCAN and PFFLG. The Automatic Acquisition Mode is enabled if this call to RTCLK causes the minutes variable, MIN, to increment to 0, 15, 30, or 45. RTCLK first checks DASFLG to see if the Automatic Acquisition Mode is already active. If so, RTCLK sets the terminate flag DASTRM, which SS signals the Automatic Acquisition Mode to write missing-data flags into the sensor data blocks for any sensors which still have not been sampled. The Automatic Acquisition Mode then begins sampling the required sensors for the current sampling period. If the Automatic Acquisition Mode is not already active, RTCLK sets DASFLG, which enables the call to DASIGR from the PHRUP routine. At exactly 9:00, RTCLK also sets DUMPEN and DSKCEN; DUMPEN enables the Automatic Acquisition Mode to copy section 1 of the disk into another section for the Dump Mode, and DSKCEN enables the Automatic Acquisition Mode to begin the Dump Mode if it is a weekday. RTCLK next checks if the time is 20:00 or later. If it is, RTCLK resets DMPFLG, which causes DMPMGR to terminate the Dump Mode, if it is still active, the next time DMPMGR is called. RTCLK next checks if any time-outs are enabled. Hhen the Manual Mode expects to receive data from a Remote Station, it sets the negative of the maximum time, in seconds, it can wait for the data in variable MSMOUT; it then enables the time-out by setting MOFLG. RTCLK increments MSMOUT when MOFLG is set and then checks if MSTOUT is zero. If so, data from the Remote Station wasn't received within the time limit, and RTCLK calls P6. P6 stores the machine status saved by RTCLK, so that the program RTCLK interrupted may be correct- ly resumed when P6 finishes executing. In a similar fashion, the Dump Mode sets the negative of the maximum time it can wait for data from the 6500 Computer system in variable DDMOUT; it then enables the time-out by setting DOFLG. If RTCLK didn't call P6, it now incre- ments DDMOUT, if DOFLG is set, and checks if DDMOUT is zero. If so, the Dump Mode didn't receive the data from the 6500 within the time limit, and RTCLK calls DTO to handle this error condition. DTO also 56 stores the machine status which was saved by RTCLK. The Manual Mode also sets a maximum time limit in variable TTMOUT; it enables it by setting TOFLG when it is waiting for the operator to type something on one of the Teletypes. If RTCLK didn't call DTO, it increments TTMOUT'when TOFLG is set and checks if TTMOUT'is zero. If it is zero, the operator waited too long to type a character, and RTCLK calls OFF to terminate the Manual Mode access to the DAS. RTCLK next checks TMFLG. TMFLG is set by the Automatic Acquisition Mode when it has finished sampling all the sensors; it indicates that the error messages may be printed on the Teletypes. Hhen TMFLG is set, and TTYFLG is reset, indicating that the Manual Mode isn't accessing the DAS, RTCLK calls E, which again transfers the machine status from RTCLK and supervises the printing of the error messages on the Teletype(s). If RTCLK didn't call one of these other routines, it restores machine status itself and returns to the interrupted pro- gram. A flow chart of the Real-Time Clock is shown in Figure 4.1. 4.7 Automatic Acquisition Mode The Automatic Acquisition Mode is always entered from a loop in routine PHRUP. The flag variable DASFLG is continuously checked in the loop. Every quarter-hour RTCLK sets this variable. The next time thru the loop, PHRUP detects that DASFLG is set; PHRUP then calls DASMGR to supervise the Automatic Acquisition Mode. DASMGR first calls ERRINT, which writes the current time into the error buffer. Any errors detected during the Automatic Acquisition Mode will follow this time flag in the error buffer. DASMGR then checks each station ID word in core memory to determine if that Remote Station is defined. If a station is defined, TMSAMP is called. 57 l‘ Real-Time Clock Sync interrupt BATUPD J DISPLY J ___. to interrupted program P6 , I; I DMPMGR J r—. to interrupted program DTO : I DMPMGR J RTCLK fl _L_l_ Hill .__. to interrupted program on I TIME R0 OFF , I ,l ".3 t.__; Figure 4.1 Real-Time Clock Flow Chart 58 TMSAMP checks all the defined sensors at the given Remote Station to determine if it is time to sample any of them. If none of the sensors are to be sampled, TMSAMP returns to DASMGR, which then checks the next station. TMSAMP also checks if all the sensors that must be sampled are off-line at the Central Station (bit 0 of the sensor ID word set). In this instance, TMSAMP returns to a different location in DASMGR, which then sets a flag variable, ABFL, so that missing- data flags will be entered into the correct sensor data blocks. Once DASMGR determines that a Remote Station must be called, it checks the status of modem/calling unit #1. This modem/calling unit may be in use by the Manual Mode; DASMGR then sets a request flag, MlAREO, and continuously checks the modem busy flagg MlBSY, until it is reset by the Manual Mode. DASMGR then resets its request flag, MlAREn, and sets the addresses of the Automatic Acquisition Mode Asynchronous Modem Controller (AMC) and Automatic Calling Unit (ACU) interrupt routines at the correct base page locations. DASMGR next checks if the Manual Mode is connected, via modem/calling unit #2, to the same Remote Station that must be called. If it is connected, DASMGR sets a request flag, M2AREQ, to notify the Manual Mode to terminate its connection. DASMGR then continuously checks MZAREQ until it is reset by the Manual Mode when it disconnects the dialed station. DASMGR then dials the Remote Station by calling DIALA. DIALA obtains the Remote Station's telephone number from the appropriate station definition block in core memory and sets up a block output instruction to send the telephone number to the ACU. DIALA.issues a call request and then goes into a loop which checks if either DSSlFL or ACRlFL are set. If an Abandon Call and Retry (ACR) interrupt is generated by the ACU, DIS is called. DIS saves machine 59 status, sets ACRlFL, restores machine status, and returns to the interrupted program. Hhen DIALA goes thru the loop again, it detects that ACRlFL is set and jumps out of the loopu DIALA then attempts to redial the Remote Station a second time. If the second attempt is also unsuccessful, DIALA returns to DASMGR. The Data Set Status (038) interrupt from the ACU calls routine D16. D16 saves machine status, sets DSSlFL, and stores the number of digits remaining to be dialed in CNlTST. 016 then restores machine status and returns to the interrupted program. The next time thru the loop DIALA detects that DSSlFL is set and jumps out of the loop. CNlTST is zero if the call was successfully completed, and then DIALA waits 3 seconds for the telephone line to clear before returning to DASMGR. Otherwise DIALA redials the station a second time, as above. DASMGR sets ABFL if the call to the Remote Station was unsuc- cessful. DASMGR then checks the sensor ID word in core memory fOr each sensor at the Remote Station to determine which sensors are defined. The sampling interval for each defined sensor is used to determine if it should be sampled. If it isn't time to sample the sensor, DASMGR checks the next sensor at that station. DASMGR checks ABFL if it is time to sample the sensor. If ABFL is set, or if the sensor is off-line at the Central Station (bit 0 of the sensor ID word in core memory set), a missing—data flag must be added to the sensor data block. DASMGR begins this process by calling DSKRD. DSKRD begins executing and checks if another Mode is using the disk controller. If the disk controller is busy, DSKRD keeps checking the disk busy flag, DSMBSY, until the other Mode resets it. DSKRD then seizes control of the disk and reads the correct sensor data block from section 1 of the disk. The address of the sensor 60 data block is obtained from the sensor disk address word in core memory. After the read operation is completed, DSKRD returns to DASMGR, which then calls UPDATE. UPDATE operates on the copy of the sensor data block in core memory. First the oldest data sample, obtained 24 hours previously, is deleted. Then the remaining data samples are moved down one word, and the new data sample, in this case a missing— data flag (:FFFF), is added to the top of the list. Finally UPDATE writes the time the Automatic Acquisition Mode began into the first word of the sensor data block and returns to DASIGR. DASMGR then calls DSKHR. The Automatic Acquisition Mode still has control of the disk controller since DSKRD didn't release it. DSKHR immediately writes the updated version of the sensor data block from core memory back to its correct location in section 1 of the disk. After the write operation is completed, DSKHR checks DSDRm to find out if the Dump Mode has a request in for the disk controller. If DSDREO is set, DSKHR executes a jump and store instruction to the address at location DSDADR. This transfers control to the Dump Mode. Hhen the Dump Mode finishes with the disk, it returns to DSKHR. DSKHR then checks DSIREO to see if the Manual Mode requested the disk. If DSMRm is set, DSKHR executes a jump and store instruction to the address at location DSMADR. This transfers control to the Manual Mode. The Manual Mode returns to DSKHR when it finishes with the disk. DSKHR then returns to DASIGR. DASMGR calls LINE, which sets bit 1 of the sensor ID word in core memory to indicate that the sensor is off-line at the Remote Station. LINE returns, and DASMGR continues with the next defined sensor at the Remote Station. Hhen it is time to sample a sensor which is on-line at the 61 Central Station and ABFL is zero, DASMGR calls ST'D. STD begins executing and calls SAMPLE. SAMPLE first checks that the connection to the Remote Station was not broken. If it was, SAMPLE immediately returns to STD, which then returns to DASIGR. DAS‘ICR calls DIALA to dial the same Remote Station again. However, the Remote Station is not called again if the connection was broken three times for the same Remote Station. In this case DASMGR sets ABFL, which causes missing- data flags to be written into the sensor data blocks for the remaining sensors that must be sampled at that station. If the Remote Station is still connected, SAMPLE sets up a block output instruction to send five characters to the Remote Station to request it to sample the desired sensors. A block input instruction is also set up to receive the five characters the Remote Station sends back. SAMPLE then enables AMC receive and transmit interrupts and enters a time-out loop. Two flag variables are checked in this loop: EXClFL and leBF. EXClFL is set in 018, which is called when the AMC generates an exception interrupt. D18 saves machine status, sets EXClFL, and inputs the AMC status word and saves it in AMClSH. 018 then restores machine status and returns to the interrupted prog‘am. The exception interrupt is generated when a disconnect occurs or when an error in data transmission occurs. If an exception interrupt does occur, SAMPLE detects it when it checks EXClFL during the loop. SIMPLE then jumps out of the 100p and checks the AMC status word. If AMClSH indicates a disconnect occurred, SAMPLE returns to STD, as before. If only a data transmission error occurred, SAMPLE does a 1.5 second time-out and then repeats the transmission to the Remote Station. If the received data contains errors again, SAMPLE returns to STD, which 62 calls LINE to set the sensor off-line at the Remote Station (bit 1 of the sensor ID word set). STD then calls DSKRD, which reads the sensor data block from section 1 of the disk. DSKRD completes the read operation and returns to STD, which calls DSKHR to write the updated sensor data block from core memory back to its correct location in section 1 of the disk. STD then returns to DASMGR. RlEOBF is the other variable checked in the time-out loop. It is set in 017, which is called when the AMC generates a receive end- of-block interrupt. DI7 saves machine status, sets RlEOBF, then restores machine status, and returns to the interrupted program. SAMPLE checks RlEOBF each time it goes thru the time-out loop and jumps out of the loop when RlEOBF is set. SAMPLE then determines if the sensor is off-line at the Remote Station, which will be the case if bit 6 of each character received is set. In this case SAMPLE returns to STD. Otherwise SAMPLE first reformats the five characters received from the Remote Station into a single word containing the 12 bits of data from the sensor and then returns to STD. STD updates the off-line bits in the sensor 10 word; bit 1 is set if the sensor is off-line and reset if the sensor is on-line. STD uses the same procedure explained above to add either a missing-data flag or the sensor data word to the sensor data block. However, if the sensor is on-line, STD checks the returned data against the sensor tolerance parameters which DSKRD reads from the sensor definition block on the disk. If the data is less than or equal to the lower tolerance, or greater than or equal to the upper tolerance, STD calls ERROR. ERROR writes the station and sensor number and the code for the out-of- tolerance condition into the error buffer. lIROR then returns to STD, which returns to DASMGR. 63 SAMPLE may repeat the time-out loop without EXClFL or RlEOBF being set. This occurs if the Remote Station doesn't send the five characters fast enough. If neither flag variable is set within 2 seconds, SAMPLE exits the loop, resets the AMC interrupts, and then repeats the transmission to the Remote Station. 1f the time-out also elapses the second time, SAMPLE returns to STD, which writes a missing-data flag into the sensor data block, as explained above. DASIGR keeps track of how many sensors at a station could not be sampled because of data transmission errors. If three sensors at a given station cannot be sampled for this reason, DASMGR sets ABFL and calls ERROR to write the station number and this error code number into the error buffer. Hhen ERROR returns, DASMGR then writes missing-data flags into the sensor data blocks of any remaining sensors at that station. After all the sensors at a Remote Station have been processed, the connection to that Remote Station is terminated. DASMGR then resets ABFL and other flags and repeats this sequence of events fer the next Remote Station. DASMGR checks if the flag variable DASTRM is set after it samples each sensor. This variable is set by RTCLK if the Automatic Acquisition Mode has been active fer longer than 15 minutes. Hhen DASTRM is set, DASMGR writes missingrdata flags into the sensor data blocks for all the sensors that must still be sampled. This insures that the next automatic acquisition can begin as soon as possible. After all the required sensors at all Remote Stations are sampled, DASMGR releases modem/calling unit #1. It then checks if DSKCEN is set. This flag variable is set by RTCLK at 9:00 every morning. Hhen DSKCEN is set, DASMGR copies the entire section 1 of the disk, which contains the current sensor data blocks, to one of 64 the other section on the disks. This copied version of the sensor data blocks is then used by the Dump Mode to transfer the sensor data to the 6500 Computer system. DASIGR searches for the first available section (#2 thru #8) and then calls DSKCPY to copy section 1 into that section. If all of the sections are filled, DASMGR instructs DSKCPY to overwrite the section containing the oldest sensor data blocks. DSKCPY interacts with the disk controller via the same sequence of instructions that DSKRD uses. Hhen DSKCPY returns DASMGR checks the dump enable flag, DUMPEN, which is also set by RTCLK at 9:00 every morning. If DUMPEN is set, and it is a weekday, DASIGR sets the dump flag, DMPFLG, and calls DMPMGR. DMPMGR begins execut- ing; it starts the Dump Mode processing and then returns to DASIGR. DASMGR next sets TMFLG to enable the printing of any error messages accumulated during the Automatic Acquisition Mode, resets DASFLG, DSKCEN, and other flags, and returns to the loop in PHRUP to wait for RTCLK to set DASFLG again. A flow chart of the Automatic Acquisition Mode is shown in Figure 4.2. 4.7.1 .9291”. Messag M Routine E prints the error messages, which were generated during the Automatic Acquisition Mode, on the Remote Teletype and optionally on the Local Teletype. E executes as a Manual Mode routine, in that it prints on the Teletypes, but it is initially called from RTCLK. Hhen the Automatic Acquisition Mode finishes processing, it sets TMFLG to indicate that the error buffer is complete. RTCLK checks TMFLG when it is called every second; when TMFLG is set and TTYFLG is reset, indicating that the Manual Mode isn't accessing the DAS, RTCLK calls E. E begins executing and first transfers the machine status which 65 PHRUP DASMGR “continued) Modem/Calling Unit #1 L I I ACR interrupt ERRINTJ TI DSS interrupt RCV EOB interrupt ~ fl . DSKRD H FDISK: :l7 —.r FATAL J [ DIS dUPDATE J r DI9 Exception interrupt IT W TRN EOB interrupt IT FDISK: J r -'- -- fl DSDADR I DSKWR t _ _ _ _ J r - - - - 1 ' DSMADR I L - - - — J LINE ‘—" I- mm I III LINE 1 STD V V (continued) ~ DSKRD HFDISK: l Figure 4.2 Automatic Acquisition Mode Flow Chart (continued) DASMGR 66 (continued) FATAL UPDATE J STD . FDISK:J '----‘ I DSDADR I L ....._ - J DSKWR r'- -'-'- 1 DSMADR ' L-_.._J ERROR J ERROR I c. DSKCPY DMPMGR Figure 4.2 WK 1 _.[ I L FATAL ] ----‘ DSDADR ' ----1 DSMADR . —-_-J (cont'd) was saved by RTCLK. E then resets age TTY input interrupts so that the Manual Mode cannot gain access to the DAS. E also writes the address of a second entry point, E7, into location MPOUT. E next checks the error buffer to determine if any error messages must be printed. If the error buffer doesn't contain any error codes, E enables TTY input interrupts; subsequently pushing one of the Tele- type REQUEST push buttons will cause a TTY input end—of—block interrupt and initiate Manual Mode access. E then restores the transferred machine status and returns to the interrupted program. Hhen the error buffer does contain error codes, Eienables output to the Remote Teletype (SEL :l3,6). E then checks if the error messages should also be printed on the Local Teletype by sensing if the PRINT ERRORS push button switch on the Local Teletype is acti- vated (SEN :13,0). If it is, the Local Teletype is turned on (SEL :15,0). E next obtains the time that the Automatic Acquisition Mode began. This time is written into two words in the error buffer at the start of the Automatic Acquisition Mode by ERRINT; E keeps track of what location it should check in the error buffer by the variable ERRD. The first block of output sent to the Teletype(s) contains the control codes to turn the Remote Teletype on (:93) and disable auto- echo at both Teletypes (:96). This block also includes a line containing the time and date that the Automatic Acquisition Mode started processing. E then sets up the block output instruction, enables TTY output interrupts, restores the transferred machine status, and returns to the interrupted program. After the line finishes printing, the TTY output end—of—block interrupt calls TTYOUT, which then calls E thru the E7 entry point. 68 E checks the error buffer for any out-of-tolerance error codes. A single word is used to represent each sensor which was out of tolerance during the Automatic Acquisition Mode sampling. Bits 0 thru 5 of‘each error code word contain the sensor number, bits 6 thru 10 contain the station number, bit 12 is set, and bits 13 thru 15.are zero. The error code for the out-of-tolerance condition is indicated by this pattern in bits 12 thru 15. The error buffer might not contain any'out-ofhtolerance error codes; E then checks the next type of error code. However, if E does find any of these codes in the error buffer, it sets up a block output instruction to print the message "THESE SENSORS ARE OUT OF TOLERANCEz”. E then enables TTY output interrupts and returns thru TTYOUT to the interrupted pro- gram. After the message finishes printing, E is called from TTYOUT and locates each out-ofztolerance error code in the error buffer. The station and sensor numbers are converted into ASCII characters which can be printed. Anioutput buffer is then set up which contains the ASCII characters fbr the station and sensor numbers. A maximum of ten station and sensor numbers are added to the output buffer. E then sets up a block output instruction, enables TTY output inter- rupts, and returns to TTYOUT, which restores machine status and returns to the interrupted program. When the line finishes printing, the TTY output end-of-block interrupt calls TTYOUT, which calls E thru the E7 entry point. E then checks if any more out-of-tolerance error codes remain in the error buffer. If there are more, it formats another line of output as explained above. Otherwise E checks if there are any error codes in the buffer for Remote Stations which didn't respond to the Automatic Acquisition Mode request to sample a sensor. The station 69 number is again contained in bits 6 thru 10 of the error code word, but now bits lZand 13 are set and bits I" and 15 are zero. If any of these error codes are feund in the error buffer, E sets up a block output instruction to print the message "NO REPLY FROM THESE STATIONS:". TTY output interrupts are then enabled, and E returns to TTYOUT, which returns to the interrupted program. When this message finishes printing, TTYOUT calls E thru the E7 entry point, E then searches the error buffer for all the error codes for stations which didn't reply. E next sets up an output buffer which contains the ASCII codes for these station numbers. E then sets up the block output instruction, enables TTY output interrupts, and returns to TTYOUT, which returns to the interrupted program. Hhen E is called again from TTYOUT, it checks if the error buffer contains the code word which the Automatic Acquisition Mode writes if it doesn't have enough time to sample all the sensors before the next sampling period must start. The error code word for this condition has bits 12, 1“, and 15 zero and bit 13 set. If E finds this code, it sets up a block output instruction to print the message "NOT ENOUGH TIME TO SAMPLE ALL SENSORS". E then enables TTY output interrupts and returns to TTYOUT, which returns to the interrupted program. After this line finishes printing, TTYOUT calls E thru the E7 entry point. E first erases all of the error codes it Just processed from the error buffer and then updates ERRD. E next calls OFF to turn both Teletypes off and reset the LINE BUSY indicator lights. OFF returns to E, which returns to TTYOUT, which then returns to the interrupted program. After OFF finishes executing, the Manual Mode may again access the DAS. 7O “.8 Dump Mode The Dump Mode begins when DASMGR calls DMPMGR at 9:00 every weekday morning. DMPMGR first checks the modem/calling unit #2 busy flag, M2BSY. If modem/calling unit #2 is being used by the Manual Mode, and the idle flag, MZIDLE, isn't set, DMPMGR sets its request flag, MZDREO, and returns to DASMGR. When the Manual Mode finishes with modem/calling unit #2, it calls DMPMGR, which then proceeds. If the idle flag is set, the Dump>Mode immediately seizes modem/calling unit #2. DMPMGR first initializes it and sets the addresses of the Dump Mode Asynchronous Modem Controller (AMC) and Automatic Calling Unit (ACU) interrupt routines at the correct base page locations. DMPMGR then checks which section of the disk is to be transferred to the 6500 Computer system and saves the section number. DMPMGR next checks the status of the telephone line. If it is occupied (i.e. the handset is off-hook), DMPMGR sets a 10 second time-out in RTCLK and returns. When 10 seconds have elapsed, RTCLK calls DTO, which transfers the machine status already saved by RTCLK. DTO resets modem/calling unit #2 and then calls DMPMGR, which repeats the check of the telephone line. When DMPMGR returns to DTO, machine status is restored, and the interrupted program resumes executing. Once the telephone line is clear, DMPMGR sets up a block output instruction, which the ACU uses to dial up the 6500 Computer system. DMRMGR enables the ACU interrupts and returns. The ACU will then generate either an Abandon Call and Retry (ACR) interrupt or a Data Set Status (DSS) interrupt. The ACR interrupt is initiated if the call is not completed within approximately lIO seconds. The ACR interrupt calls DACU3, which first saves machine status. DACUB then resets ACU #2, enables a 5 second time-out in RTCLK, and restores 71 machine status. The interrupted program then resumes executing. when five seconds have elapsed, RTCLK calls DTO, which then calls DMPMGR, as before. The 6500 is then redialed via the same procedure. The ACU may also generate a 088 interrupt. In this case, DACU is called and saves machine status. DACU then checks if all the digits in the phone number were dialed. If they weren't, the call was unsuccessful and DACU sets a 5 second time-out in RTCLK, as was done for the ACR interrupt. DACU then restores machine status and returns to the interrupted program. If'all the digits were dialed, DACU sets up a block output instruction, which generates an end-of-block interrupt after fbur control characters are sent to the 6500. The four control characters inform the 6500 that data transmission will be at 300 baud. DACU also resets the exception interrupt enable flag variable, DEXCEN, so that any exception interrupts generated will be ignored. DACU then writes the address of routine DUMPl into location DRCV, sets a 2 minute time-out in RTCLK, enables AMC transmit interrupts, restores machine status, and returns to the interrupted program. After the four control characters are sent to the 6500, the AMC transmit end-of-block interrupt calls DAMCl. DAMCl saves machine status, enables the AMC receive interrupts, restores machine status, and returns to the interrupted program. Hhen the first character is received from the 6500, the AMC receive end-of-block interrupt calls DAMC. DAMC first saves machine status and then calls the routine whose address is stored in location DRCV. DUMPl therefore begins executing. It first sets DEXCEN so that the AMC status word is checked whenever an exception interrupt occurs. It then checks if the character Just received from the 6500 is the last one in the 72 standard 6500 sign-on message. If there are still more characters, DUMPl sets up a block input instruction to generate an end-of-block interrupt when another character is received from the 6500. DUMPl then returns to DAMC, which restores machine status and returns to the interrupted program. Hhen DUMPl is called and detects the last character of the sign-on message, it disables the 2 minute time—out which was set in RTCLK and sets up»a block:output instruction to send the password, problem number, and user ID to the 6500. DUMPl also sets up a block input instruction to receive one character from the 6500. The address of routine DUMPZ is then written into location DRCV. DUMPl sets and enables a 3 minute time-out in RTCLK, enables AMC transmit interrupts, and returns to DAMC, which restores machine status and returns to the interrupted program. After the password, problem number, and user ID are sent to the 6500, the AMC generates a transmit end-of-block interrupt. DAMCl is called; it enables AMC receive interrupts and returns to the inter- rupted program. When the 6500 sends a single character, the AMC generates a receive end-of—block interrupt which calls DAMC. DAMC saves machine status and then calls DUMP2. DUMP2 immediately calls DREADY, which scans each character received from the 6500 to deter- mine when the standard "READY" message has been received. If‘all the characters of the "READY" message have not been received, DREADY sets up.a block input instruction to receive another single character from the 6500 and returns to DUMPZ, which returns to the interrupted program thru DAMC. Nhen DREADY is called and detects that all the characters of the "READY" message, except the last one, have been received, it returns to a different location in DUMPZ, which then sets the address of'a second entry point, DUMPZB, into location DRCV. 73 DUMPZ returns to the interrupted program thru DAMC. Hhen the next character is received, the AMC receive end-of-block interrupt calls DAMC, which then calls DUMPZB. DUMPZB resets the time-out and sets up a block output instruction to send a command to the 6500. This command instructs the 6500 to begin executing the program which reads the characters sent by the Dump Mode. DUMPZB then sets the address of DUMP3 at location DRCV and again sets up>a block input instruction to generate an end—of—block interrupt when one character is received. DUMPZB then enables a 3 minute time-out in RTCLK, enables AMC transmit interrupts, and returns to DAMC, which restores machine status and returns to the interrupted program. The AMC transmit end—of—block interrupt again calls DAMCl, which enables AMC receive interrupts and returns to the interrupted program. Nhen the first character is received from the 6500, the AMC receive end-of-block interrupt calls DAMC, which calls DUMP3. DUMP3 checks the character to see if it is a ":" (:3A) or a "7" (:3P). If neither of these characters was received, DUMP3 sets up a block input instruction to receive another single character from the 6500 and then returns thru DAMC to the interrupted program. DUMP3 continues to check each character received until it encounters a ":" or "7", or until the 3 minute time-out occurs. The 6500 inputting program sends back a ":" when it begins executing. DUMP3 is called by DAMC, detects the ":", and resets the time—out in RTCLK. It then calls DDISK to read the section header from the disk. DDISK begins executing and checks the disk busy flag, DSKBSY. If another Mode is using the disk controller, DDISK sets a second entry address at location DSDADR and sets its request flag, DSDREO. It then returns to DUMP3, which returns thru DAMC to the interrupted program. Hhen 74 the other Mode is finished with the disk, it checks the Dump Mode request flag. Since it is set, the other Mode executes a Jump and store instruction to the address in location DSDADR, which then transfers control back to DDISK. DDISK writes the return address in the first location of DUMP3 so that it will correctly return to the other Mode. DDISK then reads the section header from the disk and sets up a buffer containing the ASCII characters for the month, day, and year that section 1 was copied. Hhen this is completed, DDISK checks if the Manual Mode has requested the disk. If the Manual Mode disk request flag, DSMREQ, is set, DDISK executes a Jump and store instruction to the address in location DSMADR. This transfers control to the Manual Mode, which then accesses the disk. Hhen the Manual Mode is finished with the disk, it returns to DDISK, which returns to DUMP3. DUMP3 next sequentially checks each station ID word in core memory to determine which stations exist. If a station does exist, DUMP3 sequentially checks the sensor ID words in core memory to determine which sensors at that station are defined. Hhen DUMP3 locates a defined sensor, it calls DDISK to read the sensor data block off the correct section of the disk; DDISK gains access to the disk controller by the procedure explained above. DDISK also reads the sensor definition block from the disk to obtain the multiplier and offset for the sensor. It then converts the multiplier and offset into a string of twelve ASCII characters and returns to DUMP3. DUMP3 sets up an output block instruction to send 81 characters to the 6500. The eight ASCII characters comprising the section header are placed in the output buffer first, followed by two ASCII characters for a "a" (:El). These two characters mark the beginning 75 of each sensor's data as transmitted to the 6500. The next two ASCII characters added to the output buffer represent the station number and the sensor number. These are followed by the twelve characters into which the sensor's multiplier and offset are coded. The next two characters contain the sampling interval fer the sensor. Each data point in the sensor data block is then converted into two ASCII characters, which are placed consecutively into the output buffer, until it contains 78 ASCII characters. DUMP3 then calls CKSUM, which computes a checksum based on the 78 ASCII characters in the output buffer. CKSUM converts the checksum into two ASCII characters, places them into the output buffer, and then adds a carriage return to the end of the buffer. CKSUM returns to DUMP3, which sets up a block output instruction to send all 81 characters to the 6500 and sets up a block input instruction to receive one character from the 6500. DUMP3 then sets and enables a 3 minute time-out in RTCLK, enables AMC transmit interrupts, and returns. The interrupted program then resumes executing. After all 81 characters are transmitted, the AMC transmit end- of-block interrupt calls DAMCl, which enables AMC receive interrupts and then returns. The 6500 inputting program receives the line of 81 ASCII characters and computes the checksum for the first 78 charac- ters. If the newly computed checksum doesn't match the checksum contained in the 79th and 80th received characters, a transmission error occurred. The 6500 inputting program then sends a ”?' to the Dump Mode. DAMC calls DUMP3 every time a single character is received from the 6500. When DUMP3 is called and detects the "T", it sets up a block output instruction to retransmit the same line of 81 ASCII characters to the 6500. DUMP3 then sets and enables a 3 minute 76 time—out in RTCLK, enables AMC transmit interrupts, and returns via DAMC to the interrupted program. Hhen the line is correctly received by the 6500 inputting program, the checksums match, and then the program sends a "z” to the Dump Mode. DUMP3 is called, detects the “:“, resets the time- out, and then fbrmats the next line of 81 ASCII characters. This line contains the remainder of the sensor data points, represented again as pairs of ASCII characters. If all the data points in the sensor data block are added to the output buffer before it contains 78 characters, DUMP3 checks the sensor ID words to locate the next defined sensor at the same station. If there are none, it begins checking the sensor ID words at the next defined station. Hhen it finds the next defined sensor, it.calls.DDISK to read the sensor data block and the sensor definition block from the disk; DUMP3 then adds two ASCII "a's to the output buffer, followed by the new station number and sensor number, the twelve multiplier and offset ASCII characters, and the ASCII-coded sampling interval, as before. The ASCII representations of the data points are then added to the output buffer until it contains 78 characters. DUMP3 calls CKSUM again, sets up the input and output block instructions and the 3 minute time-out in RTCLK, and then enables the time—out and the AMC inter- rupts. DUMP3 returns and the interrupted program resumes executing. This process continues until all the defined sensor data blocks have been transmitted to the 6500. Hhen the two ASCII characters representing the last data point from the last defined sensor at the last defined station have been added to the output buffer, DUMP3 fills the remainder of the output buffer (thru character 78) with "a's. DUMP3 then sets the end flag, 77 DENDFL, and calls CKSUM. The input and output block instructions and the 3 minute time-out are set up, and then the time-out and AMC transmit interrupts are enabled. DUMP3 returns, and the interrupted program resumes executing. Hhen the next AMC receive end-of-block interrupt occurs, and the character received is a ”:", DUMP3 writes the termination character, ’ (:EO), and a carriage return into the output buffer. DUMP3 then writes the address of DUMP‘I into location DRCV, sets up the input and output block instructions and the 3 minute time-out, and then returns thru DRCV to the interrupted program. The inputting program executing on the 6500 terminates after it receives the :E0 code. The 6500 then sends the "READY" message. As each character is received, DMAC calls DUMP“, which calls DREADY. As explained above, DREADY checks each character as it is received and returns to a different location in DUMP3 when all the characters of the "READY" message, except the last one, have been received. DUMP“ then writes the address of a second entry point, DUMPIIB, into location DRCV and returns to DAMC, which restores machine status and returns to the interrupted program. When the last character of the "READY” message is received, DAMC calls DUMPIIB, which resets the time-out in RTCLK and resets the disk section flag to indicate that the section was successfully transmitted. DUMPIIB then sets up a block output instruction to send a comand to the 6500. This command instructs the 6500 to execute a program which adds the sensor data Just transferred to the 6500 data base. DUMPIIB then writes the address of DUMP5 at location DRCV and sets up a block input instruction to generate an end-of-block interrupt when one character is received. DUMPIIB then enables a 30 minute time-out and the AMC transmit interrupts and returns to DRCV, which restores M‘n 0' ”409'- 78 machine status and returns to the interrupted program. After the 6500 data base program finishes executing, the 6500 sends the "READY" message to the Dump Mode. DUMPS is called by DAMC as each character is received, and in turn calls DREADY. DREADY again returns to a different location in DUMPS when all the charac- ters of the "READY" message, except the last one, have been received. DUMPS then sets the address of a second entry point, DUMPSB, into location DRCV and returns to DAMC, which restores machine status and returns to the interrupted program. Hhen the final character-of the "READY” message is received, the AMC receive end-of-block interrupt calls DAMC, which calls DUMP'SB. DUMPSB resets the 30 minute time-out in RTCLK and sets up a block output instruction to send the logout message to the 6500. DUMPBB also writes the address of DUMP6 into location DRCV. DUMPSB then sets up a block input instruction which generates an input end-of-block interrupt when 30 characters have been received from the 6500. DUMPSB sets and enables a 2 minute time-out in RTCLK, enables AMC transmit interrupts, and returns thru DAMC to the interrupted program. After the logout message has been transmitted, the AMC transmit end-of- block interrupt calls DAMCl, which enables AMC receive interrupts. When the 30 characters of the logout message have been received, the AMC receive end-of-block interrupt calls DAMC, which then calls DUMP6. DUMP6 resets the time- out in RTCLK and resets modem/calling unit #2. MP6 then calls DMPMGR, which checksif any more sections of the disks are filled. If they are, DMPMGR sets up and enables a call request to the ACU to dial up the 6500. DMPMGR then returns to DUMP6, which returns thru DAMC to the interrupted program. If all the filled sections were transferred, DMPMGR resets the modem/calling unit #2 busy flag, 79 MZBSY, and returns to DUMPG, which again returns thru DAMC to the interrupted program. The Dump Mode terminates until DMPMGR is again called by DAach. An exception interrupt, signifying either a broken telephone connection or incorrect data transmission, may occur at any time. This interrupt calls DAMCZ. DAMCZ first saves machine status and then inputs the status word from the AMC. If the telephone connec- tion was broken, and the exception enable flag, DEXCEN, is set, DAMCZ resets modem/calling unit #2 and then sets the time-out in RTCLK for one second. DAMCZ restores machine status and returns to the interrupted program. Hhen one second elapses, RTCLK calls DT'O, which calls DMPMGR to set up another telephone call to the 6500. The entire section of 21! hours of all the sensor data is then retransmit- ted. If a data transmission error occurs or if the exception enable flag, DEXCEN, is reset, DAMCZ simply restores the machine status and returns to the interrupted program. The data transmission error is subsequently detected by the time-out in RTCLK or by the checksum procedure. Each timethat DMPMGR is called it checks if DMPFLG is still set. RTCLK resets this flag variable at 20:00. If DMPMGR is called and DMPFLG is reset, it releases modem/calling unit #2 and terminates the Dump Mode. The Dump Mode will resume when DMPMGR is called by DASIGR at 9:00 the next weekday morning. A flow chart of the Dump Mode is shown in Figure 10.3. 10.9 Disk Error Mode This Mode is entered if an error occurs in one of the disk units. The disk controller detects the error, and then the routine 80 DASMGR DUMP6 P2 P4 P5 P6 DMPMGR I DTO from RTCLK o interrupted program DMPMGR Modem/Calling Unit #2 I DACU3 I: ACR interrupt I DACU I ; DSS interrupt I DAMCl I ; TRN EOB interrupt IDAMCZ I Exception interrupt DAMC RCV EOB interrupt r _ — DUMPl DRCV :1 DUMPIE ] DUMPZ HUMAN I Kcontinued) ‘ _ Figure 4.3 Dump Mode Flow Chart 8] |(continued) a DUMPZB J DRCV | . ,.—_’[ m. $21 DRE... DUMP3 ,___’ DSDADR return point ____.4 DSDADR entry point FDISK: I DDISK - —-DL FATAL I r‘- -- -'1 a . I DSMADR I I. - _ .. .. a CKSUM I FM“ 7 r—‘Im mm 1 mm] I I__ _ flimflm I: DMPMGR I Figure 4.3 (cont'd) 82 accessing the disk calls FATAL. FATAL reads the disk status word and outputs it to the minicomputer console data register so that the type of error may be determined. See Appendix B for the error codes. FATAL then turns on the 0V lite, which is also on the minicomputer console, if disk unit 1 caused the error, and turns the 0V lite off if disk unit 0 caused the error. Both modem/calling units are then reset, and the TTY controller is initialized. All other Modes are terminated until the disk error condition is corrected and the DAS has restarted itself. FATAL next loads the A register with :C and executes an OTA :15,3 instruction. This turns on the audible alarm at the Central Station and lights the red FATAL ERROR indicator lights on the Local Teletype and on the Central Station Display Panel. The alarm may be silenced by momentarily pushing the flashing red ALARM STOP push button on the Display Panel. The FATAL ERROR indicator lights remain on. FATAL now turns on the LINE 808! indicator light on the Local Teletype (SEL :13,3), enables output to the Remote Teletype (SEL :13,6), and turns on the Local Teletype (SEL :15,0). FATAL then calls PFRl to print each line of the Fatal System Crash message on both Teletypes. The first line contains the control codes :93 and :90, which turn on the Remote Teletype and light the LINE BUSY indicator light on the Remote Teletype, respectively. PFRl writes the address of PFRZ into location MPOUT, sets up a block output instruction, and resets PRNTFL. PFRl then enables T'TY output interrupts and continuously checks PRNTFL. Hhen the block of characters is finished printing, the TTY controller generates an end-of-block interrupt which calls TTYOUT. TTYOUT saves machine status and calls PFRZ, which sets PRNTFL. PFR2 returns to TTYOUT, 83 which restores machine status and then returns. PFRl detects that PRNTFL is set and returns to FATAL. Each line of the message is printed by a call to PFRl. The final line sent to the Teletypes contains the control codes :9“ and :97, which turn off the Remote Teletype and the Remote LINE BUSY indicator light, respectively. FATAL then turns off the Local Teletype (SEL :15,1) and resets the Local LINE BUSY indicator light (SEL :l3,h). FATAL next instructs the modem/controller to send a constant space to the modem/control- ler at the Remote TeletYpe (SEL :13,2). The remote modem/controller senses this constant space and turns off the green RUN indicator light on the Remote Teletype and lights the red FATAL ERROR indicator light. FATAL then continuously checks the status of the blue RESET push button switch on the Display Panel of the Central Station. After the cause of the disk error is determined and corrected, the operator pushes the RESET button. FATAL detects this and calls the disk controller to check each disk drive. If either disk unit now generates an error, FATAL again sends the unit number and the error code to the minicomputer console and reactivates the alarm. The disk controller rechecks both disk units when the RESET button is again pushed. Once both disk drives check out successfully, FATAL turns off the FATAL ERROR indicator lights on the Local Teletype and the Display Panel and turns on the yellow START indicator lights by setting the A register to 2 and executing an OTA :15,3 instruction. FATAL then turns off the TTY carrier (SEL :13,0), which causes the remote modem/controller to light the yellow START indicator light on the Remote Teletype. FATAL next calls PHRUP, which restarts the DAS as if a power failure had occurred. A flow chart of the Disk Error 84 Mode is shown in Figure n.4, “.10 29:35 Restart 5293 The Power Restart Mode is entered when power is restored fellowing a power failure. All other Modes are suspended until the DAS has restarted itself. The minicomputer processor detects when a power failure is about to occur and generates a Power-Down interrupt. This interrupt calls PHRDN, which disables the recognition of any more interrupts. Nhen power is restored to an acceptable level, the processor generates a Power-Up interrupt, which calls PHRUP. PHRUP first checks if the Disk Error Mode was active when the power failed. If it was, FTLFLC is set, and PHRUP then calls FATAL thru the FTLENT entry point. Otherwise PHRUP turns the remote TTY carrier off (SEL :l3,0), which causes the remote modem to light the yellow START indicator light on the Remote Teletype. PHRUP then turns on the START indicators on the Local Teletype and the Display Panel of the Central Station by setting the A register to 2 and executing an OTA :15,3 instruction. PHRUP next checks PFFLG to determine if the Power Restart Mode itself was active when the power failure occurred. If it wasn't, PHRUP saves the time and date that the power failure occurred. Otherwise PHRUP uses the time computed when PHRUP was executing before the most recent power failure. PHRUP then resets the time variables in RTCLK to zero and sets PFSKIP. The real-time clock is then enabled; PHRUP continuously checks MIN until it is incremented, which occurs in exactly one minute. PHRUP waits one minute before doing any restart processing in case another power failure should occur immediately after the original one. After the minute has elapsed, PHRUP resets the real-time clock and turns on the DSKCPY DDISK PFR6 STD H2 P5 22 85 TTY output TTYOUT EOB interrupt I If. MPOUT l i I PFRZ I L--_-J , Figure 4.4 Disk Error Mode Flow Chart 86 remote TTY carrier (SEL :l3,1). PHRUP next prints the Power Failure message on both Teletypes. The first line of the message includes the control code to turn the Remote Teletype on (:91). The Local Teletype is automatically turned on when system power is restored. PHRUP calls PFRl to print each line of the message. When the entire message is printed, PHRUP resets all three disk flags (DSDREQ, DSMREQ, and DSKBSY) and then checks DCPFLG to determine if the Automatic Acquisition Mode was copying section 1 of the disk when the power failure occured. If a copy was in progress, PHRUP calls DSKCPY to redo the copy. PHRUP then resets DCPFLG and DASFLC. If the Power Restart Mode was active before the power failed, PHRUP now checks if it was updating the sensor data blocks on section 1 of the disk when the power failure occurred. If it was, PHRUP calls PFR6. PFR6 adds the correct number of missing-data flags to all defined sensor data blocks to update them to the Restart Time computed before, which is stored in RSMIN, RSHOUR, and RSDAY. PFR6 uses the same routines used by the Automatic Acquisition Mode to access the disk and update the sensor data blocks. Nhen PFR6 complete the update, it returns to PHRUP. If PHRUP was copying section 1 of the disk to another section when the power failure occurred, it now repeats the copy operation by calling DSKCPY. When these operations are completed, or if PHRUP wasn't active before the power failure, it reads the current time from the batteryb operated back—up clock by calling BTTIME. PHRUP then computes how much time elapsed while the power was off and updates the time variables used by RTCLK to keep the DAS time. PHRUP then calls BAT'UPD to set the newly computer time into the battery-operated 87 clock. This is necessary since the day-of-the-year counter in the battery-operated clock must be reset if a new year started during the power failure. PHRUP then checks if the power was off long enough for the Automatic Acquisition Mode to miss a sampling time. If no sampling times were missed, PHRUP starts up the real-time clock and Jumps to finish the restart procedure. However, the Automatic Acquisition Mode may have been active when the power failure occurred or the Automatic Acquisition Mode may have missed a sampling time. In these cases PHRUP determines how much time was lost and then begins one of three possible restart sequences. Restart Sequence 1 is executed if the power was off at 9:00, when section 1 of the disk should have been copied into another section by the Automatic Acquisition Mode. PHRUP first calls PFR3, which sets the Restart Time (RSJIN, nsaoun, and RSDAY) to 9:15 and then enables the real-time clock. PFR3 returns and then PFR6 is called. PFR6 adds a sufficient number of missing-data flags to each sensor data block on section 1 of the disk so that each block is updated to 9:00. PFR6 then returns, and PHRUP calls PFR7. PPR? copies the entire section 1 of the disk into an unused section so that the Dump Mode may later transfer the sensor data to the 6500 Computer system. PFR7 calls DSKCPY to do the actual copy operation. PFR‘I returns, and then PHRUP calculates the actual Restart Time. This Restart Time is ahead of the current DAS time. Hhen the actual time reaches the Restart Time, RTCLK enables the Automatic Acquisi- tion Mode every quarter hour. After the Restart Time is computed, PHRUP calls PFR6, which again adds the correct number of missing-data flags to all the sensor data blocks on section 1 of the disk to 88 update them to the Restart Time. PFR6 returns and PHRUP Jumps to finish the restart procedure. Restart Sequence 2 is executed if the 9:00 section 1 copy operation was not missed while the power was off. PHRUP first starts up the DAS real—time clock and then calls PFRII to set the actual Restart Time. PFRII returns, and then PFR6 is called to update section 1 of the disk. As before, a sufficient number of missing- data flags are added to each sensor data block to account for the number of samples that the Automatic Acquisition Mode missed during the power outage. Hhen PFR6 returns, PHRUP Jumps to finish the restart procedure. Restart Sequence 3 is executed if more than one 9:00 section 1 disk copy operation was missed. In this case power was off for more than 211 hours. PHRUP first calls PFR3 to set the Restart Time to 9:15 and enable the real-time clock. PFR3 returns, and then PHRUP calls PFR6 to add enough missing-data flags to the sensor data blocks on section 1 of the disk, as before. PFR6 returns, and then PFR7 is called. PFR7 copies section 1 of the disk to another section for the Dump Mode and then returns. PHRUP next calls PFRII to set the actual Restart Time. PERU returns, and then PHRUP calls PFR6, which fills each sensor data block with missing-data flags. PFR6 returns, and then PHRUP finishes the restart procedure. PHRUP finishes up the restart procedure by resetting all the disk and modem flag variables and initializing the Automatic Acqui- sition Mode error buffer. PFSKIP is then reset and PFSCAN set, so that RTCLK checks the Restart Time against the actual DAS time. Hhen the two times match, RTCLK resets PFSCAN and then sets DASFLG every quarter hour. PHRUP next prints a message on both Teletypes 89 indicating that the Power Restart is complete. PFRl is called to print each line of the message and returns to PHRUP as each line finishes printing. After the last line is printed, PHRUP calls OFF to turn both Teletypes off. Operator access via the Manual Mode is now possible. PHRUP then sets DUMPEN if the DAS time is later than 9:00 and earlier than 19:00. This enables DASMGR to call DMPMGR to begin the Dump Mode, if it is a weekday. PHRUP then enters the Automatic Acquisition Mode sense loop. It continuously checks the flag variable DASFLG and calls DASMGR to supervise the Automatic Acquisition Mode when DASFLG is set. RTCLK sets DASFLG every quarter hour, once the actual DAS time reaches the Restart Time. A flow chart of the Power RestartMode is shown in Figure ”.5. n.11 m 1033 A Manual Mode access to the DAS may be initiated from either the Local Teletype or the Remote Teletype. Both Teletypes are connected to the TTY port of the minicomputer processor option card. Logic circuits on the Custom Card allow the software to select which Teletype will be active. These software commands are detailed in Chapter 2. A Manual Mode access begins when an operator pushes the REQUEST button on either one of the Teletypes. These REQUEST buttons are designed to send a control character to the processor. The Local REQUEST button sends :11, while the Remote REQUEST button sends :12. The processor receives this input and generates a TTY input end-of- block interrupt. This interrupt calls TTYIN, which first saves the status of the machine and then resets the TTY input interrupts so they cannot occur until set again. TTYIN next executes a Jump and store instruction to the address contained in location MPIN. This 9O I FATAL I 1"____ Power Up interrupt TTY output P———.L FTLENT J TTYOUT EOB interrupt DISPLY ] " ' ' " I MPOUT ' PFR2 j L _ _... _.J Power Down R0 PWRDN interrupt PFRl ] PWRUP TIME I I FDISK: I DSKCPY , _ FATAL I u DSKRD t: FDISK: J __.I FATAL iI PFR6 UPDATE (continued) DSKWR m FDISK: I Figure 4.5 Power Restart Mode Flow Chart 91 (continued) BTT LME BATUPD PFR8 PFR3 —'I PWRUP L—fl 7 FDISK: J DSKCPY PFR7 FATAL I PFR4 HPFRS J OFF j DASMGR Figure 4.5 (cont'd) 92 location has previously been set with the starting address of routine ON. ON therefore begins executing and checks the character Just inputted thru the TTY port. TTYFLG is set to 1 if the Local REQUEST button was pushed and set to 2 if the Remote REQUEST button was pushed. ON also resets both Level 1 and Level 2 authorization keys. If the Local Teletype requested access, 0N turns the Local Teletype on (SEL :15,0) and enables output to the Remote Teletype (SEL :l3,6). It then sets up a block output instruction to send six control characters (:90) to the Remote Teletype. This control character turns on the LINE BUSY indicator light on the Remote Teletype. Six characters are sent to allow the Local Teletype motor to come up to full speed before the prompt asterisk is printed. The blue REQUEST button on the Local Teletype lights up to indicate that the Teletype is on. GR also sets the address of a second entry point, DNA, at location MPOUT. 0N then enables the TTY output interrupts and returns to TTYIN. TTYIN restores machine status and returns to the interrupted program. After all six characters are sent to the Remote Teletype, a TTY output end-of-block interrupt is generated by the TTY controller, and TTYOUT is called. It saves the machine status, disables the TTY output interrupts so they cannot occur until set again, and then executes a Jump and store instruction to the address contained in location MPOUT. MPOUT is defined in routine TTYOUT and was set with the address of ON“. ON is entered thru the ON” entry point and enables the Local Teletype (SEL :13,5). It also stores its return address at the first location of PROMPT and then Jumps to the second location of PROMPT. If the Remote Teletype requested access, 0N turns the local LINE BUSY indicator light on (SEL :13,3) and enables output to the Remote 93 Teletype (SEL :l3,6). It then sets up a block output instruction to send six characters (:93). This is the control code to turn on the Remote Teletype. Six control characters are sent to allow the Remote Teletype motor to come up to full speed before the prompt asterisk is printed. As with the Local Teletype, the REQUEST button lights up when the Remote Teletype is on. 0N then sets the address of PRGIPT in location MPOUT, enables TTY output interrupts, and returns to TTYIN. TTYIN restores machine status and returns to the program in progress when the interrupt occurred. After all the characters are sent to the Remote Teletype, a TTY output end-of-block interrupt is generated, and TTYOUT is called. Machine status is saved, and then PRQIPT is called since its address was written in location MPOUT. PRGIPT begins executing and loads the output buffer with a carriage return, line feed, and a number of rubouts. The number of rubouts which follow a carriage return is dependent on the type of terminal used. For the standard Teletype, two rubouts are sufficient to allow the carriage to return before beginning the next line of type. The variable ROFLG is set to one—half the number of rubouts desired. Thus ROFLG equals one for Teletypes. Following the rubouts, PRmPT then adds a control character to enable auto-echo at the Teletype (:95), an asterisk and a space. The Teletype controller on the minicomputer processor option card always operates in the full-duplex mode, with its auto-echo feature suppressed. Sending :95 to either Teletype enables an auto-echo feature at that Teletype, so that whatever is typed there is also automatically printed. PRCHPT then sets up a block output instruction and stores the address of a second entry point, PRU, at location MPOUT. The TTY output interrupts are enabled, and PRQIIPT returns to TTYOUT. TTYOUT 94 restores machine status and returns to the interrupted program. Hhen all the characters are sent to the appropriate Teletype, a TTY output end—of-block interrupt is generated, and TTYOUT is called. It saves machine status and calls PRCMPT thru the PM entry point. PRmPT then sets up a block input instruction which gives an input end-of- block interrupt after a single character is typed on the Teletype. PRQ‘IPT also sets the address of SCAN at location MPIN and enables a 30 second time-out in RTCLK. If 30 seconds elapse before anything is typed on the Teletype, RTCLK calls OFF, which then turns off the Teletype and terminates the Manual Mode access to the DAS. PRmPT then enables TTY input interrupts and returns to TTYOUT, which restores machine status and returns to the interrupted program. Hhen a character is typed on the Teletype, TTYIN is called and saves machine status; SCAN then begins executing. It inputs the character Just typed and checks if it is a valid command letter. If an invalid command letter was typed, SCAN stores its own return address at the first location of noun and then Jumps to the second location of PROMPT, which requests another command, as described above. If a period or escape (ESC) was entered, SCAN calls OFF. OFF resets TTYFLG and checks if the Manual Mode was using either modem/ calling unit and resets it if necessary. It then enables output to the Remote Teletype (SEL :13,6) and sets up a block output instruc— tion to turn the Remote Teletype off (:91!) and to reset the LINE BUSY indicator light on the Remote Teletype (:97). OFF also sets the address of a second entry point, OF‘I, at location MPOUT. OFF enables TTY output interrupts, returns to SCAN, which returns to TTYIN, which then returns to the interrupted program. After the two characters are 95 sent to the Remote Teletype, a TTY output end-of—block interrupt is generated. TTYOUT is called and saves machine status, and then enters OFF thru the OFA entry point. It resets the local LINE BUSY indicator light (SEL :13,lI), turns the Local Teletype off (SEL :15,1), and sets the address of routine ON at location MPIN. OFF then enables TTY input interrupts so that routine ON will be called when one of the REQUEST buttons is pushed. OFF returns to TTYOUT, which returns to the interrupted program. If one of the commands that doesn't require a password is requested, SCAN calls that routine immediately. For commands that require a Level 1 password, SCAN saves the beginning address of the command routine in local variable MANENT, and then checks if either the Level 1 or Level 2 password has already been entered during this Manual Mode access. Commands requiring Level 2 authorization also have their starting address saved in MANENT, but SCAN checks only if the Level 2 password was already entered. If the correct password was entered, SCAN calls the command routine by executing a Jump and store instruction to the address contained in location MANENT. However, if the correct password was not already entered, SCAN calls the K routine to request it. Entry to K is made thru the KlV entry point for the Level 1 password and thru the K2V entry point for the Level 2 password. K sets its starting address in MPIN and MPOUT so that it will be called when a TTY input or output end-of-block interrupt occurs. K then calls KEY, which sets up the block output instruction to print the message on the Teletype requesting the operator to enter the password. KEY enables the TTY output interrupts and returns to K, which returns to SCAN. SCAN then returns to TTYIN, which restores 96 machine status and returns to the interrupted program. Hhen the password request message is finished printing, an output end-of-block interrupt is generated, and K is called from TTYOUT. K then calls KEY, which sets up a block input instruction to accept the password, enables the 30 second time-out in RTCLK and the TTY input interrupts, and then returns to K. K returns to TTYOUT, which returns to the interrupted program. Hhen four characters have been typed by the operator, the TTY input end-of-block interrupt is generated, and K is called from TTYIN. K then calls KEY, which checks the password and returns to K. If the password was valid, K loads the starting address of the con-sand routine, and calls the couand routine. For an invalid password, K sets up a block output instruction to print the "INVALID PH” message on the Teletype and sets the address of PRQWT in location MPOUT. K then enables the TTY output interrupts and returns to TTYIN, which returns to the inter— rupted program. After the "INVALID PH" message is finished printing, PRQIPT requests a new comand, as explained before. A flow chart of the Manual Mode is shown in Figure 18.6. A.ll.l _A_ Command The A comand sets sensors and stations on-line at the Central Station. They are then automatically sampled by the Automatic Acquisition Mode. The A command begins executing by entering routine AD thru the A entry point. ADDFLG is then set to indicate that the requested sensors will be placed on—line. Hhen AD is first called, the starting address of AD is stored in locations MPIN and MPOUT so that the routine will be called when either a TTY input or output end-of-block interrupt occurs. AD then TTYIN/ TTYOUT ON I I ‘ _ I r-——1’{ 0N4 I I I I PROMPT I +21 j I I I I I I _ I I I MPIN/ I MPOUT | l I I SCAN I I l I I I I l I ' II- | | ‘ I(continued) I (continued) 97 IL__. K1V KEY Figure 4.6 Manual Mode Flow Chart R0 OB I(continued)| (continued) II T I - m-‘r J I" - - — I- 1 | MANENT I L — — -— — J 1 I EL _ I F""fI |I|||| RO I I KEY I I||||| OB I MPIN/ I _ MPOUT , I I J K R0 , I I . OB I | I l l I - - - _ I MANENT l I I I. - .. _ ._ J I I I - HCKIN 1 AD * '_ I I ~ I'IIII PROMPT I l l I I 4 OB J I I E - ' I II- m I '(continued)' (continued) ' Figure 4.6 (cont'd) l(continued)| |(continued)| MPIN/ MPOUT 99 I-———oI (continued) 7 R0 E » II- ow ] I.__.. DSMADR return point 1 H1 H HCKIN I —.F DSMADR entry point FDISK: J H2 ’ —-O{i FATAL ] r - --'- 1 I. I DSDADR I H I I. - - - — J ‘ .I TIME ] H3 OB ] ___4 R0 J HCKPR I H4 R0 I (continued) (continued) OB ] Figure 4.6 (cont'd) I(continued)| MPIN/ I MPOUT (continued) (continued) 100 (continued) I—"""ILIT""""— H4 ; EI HUPDTA I PROMPT I I— R0 I Pl ‘ HCKIN I P2 IZI DMPMGR I P3 I __.r Figure 4.6 - DMPMGR 1 P4 - PROMPT 7 (cont'd) I MPIN/ I MPOUT I |(continued) I (continued) H I IOI OB VWXY R0 ——.I R0 I I r— 03 I I ‘—’I II: no I I o I 52 - OB 1 I 5 It ‘ HCKIN I I o I —‘.I on I 53 I - R0 J I I"— PROMPT J I—"I I- on | | I I T In: R0 I I I I- m J I , I ' I I...— I ‘I 21 I (continued) Figure 4.6 PDSMADR return point (cont'd) I(continued)| (continued) 102 ZOL J Ill mm I:—_’I ASP I HCKIN I I I DSMADR entry int I o MPIN/ 21 I MPOUT I I FDISK: I I 22 e I I L—i FATAL J I I —’. 129;); I I ' I ”—‘ " ‘ ‘ " ‘ I I 'I' 03 I I I I- no 5 — —III‘—I , _ [* OFF I RTCLK ISAMC RCV EOB interrupt P5 ___.DSMADR return point DMPMGR I (continued) DSMADR entry point Figure 4.6 (cont'd) 103 (continued) I FDISK: I FATAL I r - - - - 1 .I I DSDADR ‘- — - - - J I- OB I P5 m I I; :I m» I m 1 FASM m FAS I from RTCLK to interrupt program P6 DMPMGR I ACU ACR interrupt P7 P2 :1 DMPMGR I Figure 4.6 (cont'd) 104 P8 ACU DSS interrupt Figure 4.6 (cont'd) 105 sets up a block output instruction to print the "STA: " message. It also sets upIa block input instruction to generate an input interrupt when one character is typed on the Teletype. AD then writes the code for the instruction to disable the TTY output interrupts (SEL 7.7 : :IIOBF) at the location of the TTY output end-of-block interrupt. Thus, when the block of output finishes printing, the end-of-block interrupt only resets the output interrupt, and TTYOUT is not called. The interrupted program continues immediately after the reset instruction is executed. AD next enables the 30 second time-out in RTCLK and the TTY input and output interrupts and returns. The interrupted program then resumes executing. After the message is finished printing and the operator types a single character, the TTY input end-of-block interrupt calls TTYIN, which calls AD. AD then calls HCKIN, which checks the character Just typed. If an escape (£80) or a period was typed, HCKIN indicates this by returning to a different location in AD. In this case, ADcalls prompt, which requests a new command, as before. AD then returns thru TTYIN to the interrupted program. If a digit was typed, HCKIN stores it and returns to AD, which sets up a block input instruction to input another single character. AD then returns to TTYIN, which returns to the interrupted program. HCKIN deletes the most recently entered character when a back-arrow (<—) is typed. This process continues until three characters, not including;deleted characters, are entered or until a space is typed, whichever comes first. BCKIN then fbrms the digits into a binary number and returns to a different location in AD. HCKII recognizes if any non—numeric characters were entered and returns to a still different location; AD then sets up a block output instruction to repeat the request for a station number, and the whole 1cIJI‘II'ocess repeats itself. AD also repeats the request for a station number if the station requested isn't defined. Once a correct station number is completely entered, AD sets up another block output instruction to request the sensor number. It also sets up a block input instruction, as before, to accept a single character from the Teletype. AD then enables TTY input and output interrupts and returns to TTYIN, which returns to the interrupted program. The input interrupt again causes TTYIN to call AD, which calls HCKIN. The same steps that were used to input the station number are then repeated for the sensor number, with one exception. If the letter A is typed, HCKIN indicates this to AD, and then AD adds all the sensors at the requested Remote Station. After the sensor number is completely entered and verified, AD places the requested sensor(s) on-line by resetting bit 0 of the appropriate sensor ID words in core memory. AD then sets up a block output instruction to request the next station number and returns to TTYIN, which returns to the interrupted program. This process continues until the operator types an escape (ESC) for a station or sensor number or a period for a station number. u.11.2 2 Command The D command sets sensors and stations off-line at the Central Station. Hhen it is time for the Automatic Acquisition Mode to sample those sensors which are off-line, a missing-data flag is written into their sensor data blocks. The D command begins executing by entering AD thru the D entry point. ADDFLG is reset to indicate that the requested sensors will 107 be placed off-line. AD then executes as explained for the A command. The requested sensors are placed off-line by setting bit 0 of the sensor ID words in core memory. H.11.3 Ifl Command The H command prints the sensor data which was collected by the Automatic Acquisition Mode during the previous an hours for an operator-selected group of sensors. The data from a maximum of six sensors may be listed in a single printout. When the H command is first called, it calls 81, which initiali- zes various flags and also sets the address of H in locations MPOUT and MPIN. H1 then sets up a block output instruction to print the message "STA-.- " and a block input instruction to generate an inter- rupt after one character is typed on the Teletype. [-11 also writes the code for the instruction to disable the TTY output interrupts (SEL 7,7 = :IIOBF) at the location of the TTY output end-of-block interrupt, as was done for routine AD. H1 enables TTY input and output interrupts and then returns to H. The interrupted program resumes executing. After the message is printed and a single character entered, the TTY input end-of-block interrupt calls TTYIN, which calls H, which in turn calls 81. H1 then calls HCKIN, which inputs the character and checks it. The characters for the station and sensor numbers are inputted as described for the A command. After the complete sensor number is verified, Bl checks how many station/sensor number pairs have been entered. If six pairs were entered, Hl writes the address of HS into location MPIN, sets up a block input instruction, and then enables the TTY input interrupts. H5 is called after a single character is typed; it sets HESFLG if the 108 character is an escape and then returns to the interrupted program. HESFLG is checked in HR to see if the listing should be terminated. After enabling the TTY input interrupts, Hl returns to a different location in H, which then calls H2. This same sequence of instruc- tions is also fbllowed if a period, rather than a space, terminates the previous sensor number. Otherwise Hl requests more station and sensor numbers. H2 checks the disk flag, DSKBSY, to see if the disk controller is being used by another Mode. If the disk controller is busy, H2 sets the Manual Mode request flag, DSMREQ, and writes the address of a second entry point into H2 at location DSMADR. H2 then returns to H, which returns to the interrupted program. When the other Mode finishes using the disk controller, it checks DSMREQ to see if a request is in. Since there is one, the other Mode executes a jump and store instruction to the address at location DSHADR. This transfers control to H2, which writes the return address to the other Mode into the first word of routine H. H2 then reads the sensor definition blocks and sensor data blocks from disk unit 0 for each sensor fOr which a history listing is requested. H2 also copies the sensor data block fer each of the requested sensors to a storage area in core memory. Hhen this is completed, Hz checks the Dump Mode disk request flag, DSDREQ. If the Dump Mode has requested the disk, H2 executes a Jump and store instruction to the address at location DSDADR. Control is then transferred to the Dump Mode. When the Dump Mode is finished with the disk, it returns to H2, which then returns to H. H calls H3, which sets up a block output instruction to print the time and date the history was requested. H3 enables TTY output interrupts and returns to H. H returns, and the interrupted program 109 then resumes executing. When the line finishes printing, the TTY output end-ofbblock interrupt calls TTYOUT, which calls H, which calls H3. H3, via the same steps, prints two more lines: one with the labels for each of the requested sensors and the second with the sensors' units. H3 also sets up several flags which are used by the HQ routine. After the line containing the sensors' units finishes printing, the TTY output end-of-block interrupt calls TTYOUTfl which calls H. H checks if HESFLG has been set by an escape (ESC) typed on the Teletype. If so, it calls PROMPT to request a new command and then returns thru TTYOUT'to the interrupted program. If HESFLG isn't set, H calls H“. H“ calls HCKPR, which checks the time of the most recent data from the sensors that are to be listed. HR then assembles an output block containing this time, as well as the data for those sensors that were sampled at the time. The raw sensor data is obtained from the individual sensor data blocks, which were copied into core memory by H2. The multiplier and offset are obtained from the sensor definition blocks, which were also copied into core memory by H2. Hh calls FLT to convert the raw sensor data into a floating point number and then calls FM? to multiply the result by the multiplier. FAD then adds the offset to this result. FASM is called to convert the final floating point number into ASCII characters which can be printed. Each sensor data point is processed in this manner. When a full line is computed, H” calls HUPDTA to update the flags that an uses to keep track:of which data point from each sensor is up next for printing. HR then sets up a block:output instruction, enables TTY output interrupts, and returns to H. H then returns to TTYOUT, which returns to the interrupted program. 110 Hhen this line of output finishes printing, the TTY output end-of-block interrupt calls H thru TTYOUT. H checks HESFLG and calls HII to format the next line of output if termination wasn't requested by the operator. If HBSFLG is set, H calls PRmPT to request a new command and then returns thru TTYOUT to the interrupted program. When the history listing exceeds a full page, HII adds enough line feeds after the last printed line to create a new page. HM then sets a flag in the H routine so that the sensor labels and units will be printed by H2 when H is called the next time. Hhen HII sets up the output block for the final line of a history listing, it returns to a different location in the H routine. H then loads the address of P304?! into location MPOUT, so that a new command will be prompted for when the output end-of-block interrupt occurs. ".11.“ 5 Comand The K comaand allows the operator to enter a new Level 1 password. It was previously described how the Level 1 password was requested from the operator and verified by the K routine. This description assumes that authorization has already been obtained to execute the K command. The K routine is then entered thru the KlH entry point. X first stores its starting address at location MPIN and MPOUT. It then calls KEY, which sets up a block output instruction to print the message requesting the new password. KEY enables TTY output interrupts and returns to K. K returns, and the interrupted program resumes executing. After the message is fin- ished printing, the TTY output end-of—block interrupt calls TTYOUT, which calls K, which then calls KEY again. KEY now sets up a block input instruction which generates an input end-of-block interrupt 111 after four characters are typed on the Teletype. KEY enables the 30 second time-out in RTCLK and the TTY input interrupts and returns to K. K returns to TTYOUT, which returns to the interrupted program. Hhen the four characters are typed, the TTY input end-obelock interrupt calls TTYIN, which then calls K. K now checks the fbur characters entered to insure that they are only alphabetic or numeric characters. If all four characters satisfy this condition, they become the new Level 1 password. K then sets up a block output instruction to print the message ”OK". If illegal characters were entered, K sets up a block output instruction to print the message "INVALID PH". K then writes the address of PRCMPT into location MPOUT and enables TTY output interrupts. K returns to TTYIN, which then returns to the interrupted program. The PRCHPT routine requests a new command, as explained before, when the message finishes printing. II.ll.5 2 Comand The P comand prints the current value of any specified sensor. A telephone connection to the correct Remote Station is automatical- ly established, and the requested sensor is then sampled. The correctly scaled sensor value, including its label and units, is printed on the Teletype. The P comand begins executing by calling P, which calls P1. P1 sets the address of P in locations MPIN and MPOUT and initializes flags used by the P routines. Pl then requests the operator to enter a station and sensor number via the same sequence of instructions the AD routine uses. Once a valid station and sensor number are entered, Pl saves them and returns to P. P then calls P2, which checks if a 112 modem/calling unit is already being used by the Manual Mode. If it is not, P2 checks the modem/calling unit busy flags, M138! and MZBSY, to determine if they are being used by the Dump Mode or the Automatic Acquisition Mode. If both modem/calling units are in use, P2 writes the address of PRCHPT in location MPOUT and sets up a block output instruction to print the message ”BOTH PHONE LINES IN USE” on the Teletype. P2 then enables TTY output interrupts and returns to P, which returns to TTYIN, which returns to the interrupted program. After the message finishes printing, PRQ‘IPT requests a new command. One of the modem/calling units may be available; in this case, P2 sets that modem/calling unit's busy flag and then writes the addresses of the Manual Mode Automatic Calling Unit (ACU) and Asynchronous Modem Controller (AMC) interrupt routines into the correct interrupt locations in the base page. The base page inter- rupt locations are listed in Appendix C. If a modem/calling unit is already attached to the Manual Mode, P2 checks if it is connected to the requested station. If it is, P2 returns to P, which then calls P3. If not, or if the modem/calling unit was Just attached to the Manual Mode, P2 reads the station definition block in core memory to get the telephone number of the requested Remote Station. P2 then initializes the ACU and the AMC and checks that the telephone line is clear. If it isn't, P2 does a 3 second time-out and checks it again. If the line is still occupied (telephone handset off-hook), P2 sets up a block output instruction to print the message ”LINE 1 OCCUPI." or ”LINE 2 OCCUPIED", depending on which line was occupied. P2 then enables TTY output interrupts and returns to P, which returns to TTYIN, which returns to the interrupted program. After the message finishes printing, the TTY output end-of-block interrupt calls 113 TTYOUT, which calls P. P then calls PII, which releases the modem/calling unit that was being used by the Manual Mode. If modem/calling unit #2 was attached to the Manual Mode, PII checks M2an to see if the Dump Mode has a request in for it. If it does, PII executes a Jump and store instruction to DMPMGR. After DMPMGR finishes executing, it returns control to PII, which returns thru TTYOUT to the interrupted program. After the unoccupied telephone line is initialized, P2 sets up a block output instruction to send the digits comprising the Remote Station's telephone number to the ACU. It then enables the Am and returns to P, which returns thru TTYIN to the interrupted program. The call to the Remote Station may be unsuccessful, due to a busy number or no answer within approximately IIO seconds. These condi- tions cause the ACU to generate an Abandon Call and Retry (ACR) interrupt. P7 is called iI-ediately and saves the machine status. It then resets the correct modem/calling unit and calls P2. P2 sets up a block output instruction to print the message ”STATION UNAVAIL- ABLE", enables TTY output interrupts, and returns to P7. P? then restores machine status and returns to the interrupted program. Hhen this message finishes printing, P1 is called and requests another station and sensor number, as explained above. A Data Set Status (DSS) interrupt may also be generated by the ACU. This interrupt calls P8 directly. P8 saves the machine status and then checks that all the digits in the telephone number were dialed. If they were not, P8 resets the modem/calling unit and then calls P2, which again sets up a block output instruction to print the message "STATION UNAVAILABLE”. P2 then enables TTY output inter- rupts and returns to P8, which restores machine status and returns to 114 the interrupted program. Pl again requests another station and sensor number when the message finishes printing, as above. Provided all the digits were dialed, P8 calls P3. P3 first sets up a block output instruction which sends a string of characters to the Remote Station to request it to sample the desired sensor. P3 then sets up a block input instruction to receive the five characters sent back from the Remote Station and enables a 3 second time-out in RTCLK. P3 enables AMC receive and transmit interrupts and returns to P8. P8 restores machine status and returns to the interrupted program. In case three seconds elapse before the sensor data is received from the Remote Station, RTCLK calls P6. P6 transfers the machine status saved in RTCLK and then resets the AMC receive interrupt. PG next checks if either the Dump Mode or the Automatic Acquisition Mode have requested the attached modem/calling unit. If the Automatic Acquisition Mode has a request in, P6 simply resets the modem/calling unit and the request flag, M2ARm. However, if the Dump Mode requests the attached modem/calling unit, P6 resets it and then executes a Jump and store instruction to DMPMGR. After DMPMGR finishes executing, it returns to P6, which sets up a block output instruction to print the message "NO RESPONSE PRO! SENSOR". P6 then enables TTY output interrupts, restores machine status, and returns to the interrupted program. After the message finishes printing, P1 is called to request another station and sensor number. Usually the five characters containing the sensor data are received from the Remote Station within three seconds. The AMC receive end-of-block interrupt then calls P5 directly. P5 saves machine status and checks if either the Dump Mode or the Automatic 115 Acquisition Mode have requested the attached modem/calling unit. If so, the request is handled as explained in the above paragraph. Otherwise, P5 sets the correct modem/calling unit idle flag, MlIDLE or MZIDLE. This allows the Dump Mode or the Automatic Acquisition Mode to seize the modem/calling unit from the Manual Mode without requesting it first. PS then checks if the sensor Just sampled is the same one previously sampled by the P command. If it isn't, P5 checks the status of the disk controller. In case the controller is busy, P5 fellows the same procedure outlined for the H command to gain access to the disk. Hhen PS does have access, it reads the correct sensor definition block from disk 0 to obtain the label, units, multiplier, and offset for the sensor that was Just sampled. P5 then formats the output line, which contains the sensor's label, the correctly scaled value of the sensor, and the units. P5 next sets up a block output instruction to print the line, enables TTY output interrupts, restores machine status, and returns to the interrupted program. After the line has finished printing, the TTY output end-of-block interrupt calls TTYOUT, which calls P. P then calls P1 to request another station and sensor number. The Manual Mode is terminated if the P'command has to wait more than 30 seconds fer the operator to type a character. RTCLK detects when 30 seconds have elapsed and calls OFF. OFF executes as explained befbre. The operator may intentionally terminate the P command by typing a period when a station number is requested or by typing an escape (ESC) in place of either the station or sensor number. Pl then returns to P, which calls P“ to terminate the P command. PH checks the other Modes to see if’they have requested the attached modem/calling unit and handles their requests as explained 116 above. PII next calls PRCHPT to request a new comand and then returns to P. The interrupted program resumes executing. I-I.ll.6 _S_ Command The S comand lists all the defined Remote Stations and the defined sensors at particular operator-selected Remote Stations. The 8 command begins executing by calling S, which calls 81. $1 writes the address of S into location MPOUT and then checks each of the station definition blocks in core memory to determine which Remote Stations are defined. For each defined station, 81 checks the sensor ID words in core memory to determine if all the defined sensors at that station are off-line at either the Central Station or the Remote station itself. 81 then sets up a block output instruc- tion to list those stations which are defined. If all the sensors at a station were placed off-line at the Remote Station, the station number is followed by a single asterisk. If all the sensors were placed off-line at the Central Station (by the D command), 81 types two asterisks after the station number. A maximum of ten station numbers are listed on one line. 81 then enables TTY output inter- rupts and returns to S. The interrupted program resumes executing. Hhen the output end-of-block interrupt occurs, TTYOUT calls 8, which calls 81 again if a second line of station numbers must be printed. 81 sets up this output block, enables TTY output inter— rupts, and returns to the interrupted program. Otherwise, if all the defined station numbers are printed, S calls 32, which sets up the block instructions to request a station number from the operator, as described for the A command. After a valid station number is entered, 82 returns to S, which calls 83. 83 sets the address of 117 routine H5 at location MPIN and enables TTY input interrupts. If an escape is typed by the operator, HESFLG is set in H5. 83 next sets up a block output instruction to list each of the sensors defined at the requested station. Again, a single asterisk follows a sensor number if that sensor was placed off-line at the Remote Station (bit 1 of the sensor ID word in core memory set) and two asterisks if it was placed off-line at the Central Station (bit 0 of the sensor ID word set). Ten sensor numbers are listed per line. 83 then enables TTY output interrupts and returns to S, which returns thru TTYOUT’ to the interrupted program. The TTY end-of-block interrupt calls TTYOUT when the line finishes printing, and TTYOUT then calls S. S checks HESFLG to see if the operator typed an escape while the line was being;printed. If HESP'LC is set, 8 calls PRmPT to request a new cor-land and then returns thru TTYOUT’to the interrupted program. If HESPLG isn't set and more sensors at the requested station have to be listed, S calls S3, which sets up the next line of output, as before. Hhen the last line of sensor numbers is finished printing, the TTY output end-of- block interrupt calls TTYOUT, which then calls S. S now calls 82 to request another station number. The S command can also be terminated by typing an escape when a station number is requested. This causes S2 to return to S, which then calls PROMPT. PROMPT requests a new command and returns to S, which returns thru TTYOUT to the interrupted program. M.ll.7 .1 Command The T command prints the DAS time and date on the Teletype. The T command begins executing by calling T. T calls TIME, which reads 118 the time variables (MIN, HOUR, DAY, MTH, and YEAR). TIME then fills the output buffer with the ASCII representations of these variables and returns to T. T sets up a block output instruction and writes the address of PROMPT in location MPOUT. T then enables TTY output interrupts and returns. The interrupted program resumes executing; PRmPT requests a new command when the line finishes printing. l6.11.8 31 Command The U comand allows the operator to enter a new Level 2 password. The procedure the DAS uses to request the Level 2 password was previously explained; it is assumed that Level 2 authorization has already been obtained to execute this command. The 0 command begins executing by entering the K routine thru the KZM entry point. The U comand then executes the same sequence of instructions that the K command does to change the Level 1 password. lL11.9 ! Co-and The V command defines a new Remote Station. It begins executing by entering the WXY routine thru the V entry point. WK! sets its beginning address at location MPOUT and then sets up a block output instruction to send a carriage return, line feed, and rubouts to the Teletype. VHXY enables TTY output interrupts and returns. The interrupted program then resumes executing. Hhen the TTY output end- of-block interrupt occurs, TTYOUT calls WXY, which then sets up another block output instruction to print the message "DEFINE STATION". VHXY enables TTY output interrupts and returns to the interrupted program thru TTYOUT. This message finishes printint, and the TTY output end-of-block output interrupt calls TTYOUT, which again calls WXY. This time WXY sets the address of routine 21 at 119 locations MPOUT and MPIN and then sets up a block output instruction to send a carriage return, line feed, and rubouts to the Teletype. WXY also sets a flag variable, ZRFLG, that is used by 21 to determine which section it should execute. VHXY then enables TTY output interrupts and returns to the interrupted program thru TTYOUT. 21 is called from TTYOUT when the TTY output end—of-block interrupt occurs and sets up a block output instruction to print the message "STA: ". 21 also sets up a block input instruction to input a single character from the Teletype. 21 then sets and enables a 3 minute time-out in RTCLK, enables TTY input and output interrupts, and returns thru TTYOUT to the interrupted program. The station number is read in, character by character, as described for the A command, with the exception that the time-out in RTCLK is always set for 3 minutes. The station number is then checked; if it's already defined, 21 sets up a block output instruction to print the "ABORT" message and writes the address of PRQAPT at location MPOUT. 21 then enables TTY output interrupts and returns. The interrupted program resumes executing; the PRCMPT routine requests a new comand when the "ABORT“ message finishes printing. In the event the Remote Station isn't already defined, 21 sets up a block output instruction to send a carriage return, line feed, and rubouts to the Teletype. Zl enables TTY output interrupts and returns thru TTYIN to the interrupted program. Hhen the TTY output end-of-block interrupt occurs, 21 is again called from TTYOUT and sets up another block output instruction to print the message ”PHONE: ". Again, 21 sets up a block input instructionto»read one character from the Teletype. TTY input and output interrupts are 120 enabled, and 21 returns thru TTYOUT to the interrupted program. 21 is then called as each character is typed. When 21 is called after a space is typed, it sets up a block output instruction to send a carriage return, line feed, and rubouts to the Teletype. 21 then enables TTY output interrupts and returns thru TTYIN to the inter- rupted program. Hhen the TTY output end-of-block interrupt calls 21 thru TTYOUT, it sets up another block output instruction to print the message "OK?" and also sets up a block input instruction to read a single character from the Teletype. Zl enables TTY input and output interrupts and returns thru TTYOUT to the interrupted program. After a single character is typed, 21 is called from TTYIN. If a "Y" wasn't typed, 21 sets up a block output instruction to print the "ABORT” message and writes the address of PRmPT into location MPOUT. TTY output interrupts are then enabled, and 21 returns to TTYIN, which returns to the interrupted program. Typing a "Y" causes 21 to add the new Remote Station to the DAS. First 21 computes the number of digits that were entered for the Remote Station's telephone number and writes this number, along with the telephone number itself, into the correct station definition block in core memory. 21 then sets up a block output instruction to print ”ADDED", writes the address of PRmPT at location MPOUT, and enables TTY output inter- rupts. 21 returns, and the interrupted program resumes executing. Hhen the message finishes printing, PRCMPT begins executing and requests a new command. h.ll.lo E Command The H command removes a Remote Station. It begins executing by entering the WXY routine thru the H entry point. WXY then executes 121 the same sequence of instructions that it does for the V command. The two exceptions are that the message printed for the H command is "REHOVE STATION" and ZRPLG is set for a different entry point into 21. After the message finishes printing, 21 begins executing as described for the V command. However, 21 only requests the station number for the V command. After the station number is completely entered, 21 verifies that the requested Remote Station is already defined. In the instance it is not, 21 aborts and calls PRmPT to request a new command, as described for the V command. Otherwise 21 asks if it should go ahead and remove the Remote Station. Again, the sequence of instructions is the same as those executed for the V comand. Typing "N" aborts 21 and calls PRCMPT, while typing ”Y" causes 21 to check if either the Dump Mode or the Automatic Acquisi- tion Mode is processing data from the requested Remote Station. If this is the case, 21 aborts the H command. The H command may then be attempted again in a few minutes. If neither Mode is processing data from the requested Remote Station, 21 removes it by writing :FFFF into its disk address word in core memory. 21 then sets up a block output instruction to print the message "DELET." and writes the address of PRmPT at location MPOUT. 21 enables TTY output inter- rupts and returns thru TTYIN to the interrupted program. (when the message is finished printing, PRmPT begins executing and requests a new command . ll.11.ll _x Comand The X command defines a new sensor. It begins executing by entering the VHXY routine thru the X entry point. VHXY then executes 122 as described for the V command, with the exception that the message printed on the Teletype is "DEFINE SENSOR". ZRFLG is also set for a different entry point into 21. 21 then begins executing and prints each line and inputs the typed characters as described for the V command. After the station number and sensor number are completely entered, 21 checks the sensor disk address word in core memory to determine if the sensor is already defined. If this is the case, 21 aborts, and the DAS then prompts fbr a new command, as explained for the V command. Other- wise, if the sensor doesn't already exist, 21 requests the sampling interval (”B-SI: ") and the disk address of the sensor data block ("u-CYL: ", "S-SEC: ", "6-HORD: "). The limits on these parameters are given in the description of the X command in Chapter 3. After the complete disk address is read in, 21 calls 20L to check if this new sensor data block would overlap any sensor data blocks already defined. 20L checks the sensor data block of every sensor which is defined to insure that no overlap occurs. If the sensor data blocks would overlap, 21 aborts, and the DAS prompts for a new command, as before. Otherwise, 21 requests the upper tolerance ("7—UT: ”) and the lower tolerance ("B-LT: "). Each individual character typed on the Teletype to set these first eight parameters is read in by HCKIN, which 21 calls when each character is typed. For the next two parameters, the multiplier ("9-MULT: “) and the offset ("10- OFFS: ”), 21 is again called when each character is typed on the Teletype, but then 21 calls MASIN to input each of these floating point numbers. After both of these parameters are fully read in, 21 requests the label ("ll—LABEL: ") and the units ("lZ-UNITS: ") for the sensor. Again, 21 is called as each character is typed on the 123 Teletype and stores the character in a buffer. After the eight unit characters are entered, 21 asks if it should add the sensor by printing "OK?". A similar sequence of instructions is used here that the V command uses. However, for the X command, the operator may enter a number between 1 and 12, followed by a space, as the response. 21 is called as each character is typed, and when it detects the space following the final digit it checks if the number entered is within the range of 1 thru 12. If it is, 21 sets up a block output instruction to send a carriage return, line feed, and rubouts to the Teletype. 21 then enables TTY output interrupts and returns to the interrupted program. The TTY output end-of-block interrupt calls 21, which then sets up a block output instruction to print the request for the parameter whose number was entered. 21 also sets up a block input instruction to read one character from the Teletype. 21 then enables TTY input and output interrupts, the 3 minute time-out in RTCLK, and returns thru TTYOUT to the interrupted program. 21 is again called as each character of the parameter's value is typed by the operator. When the complete value is entered, 21 again asks if it should now add the sensor to the DAS. The operator may also abort the X command by typing "N" in response to the "OK?" message, as described for the V command. However, if ”Y" is typed as the response, 21 then calls 22 to add the sensor. 2 begins executing and first gains control of the disk control- ler as described for the H command. When 22 does have control, it constructs the sensor definition block from the parameters which were read in via 21. 22 then writes the sensor definition block onto both disks. 22 next writes the new sensor's data block onto all 124 eight sections of the disks. All eight copies of the sensor data block are filled with missingrdata flags at this time, and the time of the most recent sample, contained in the first word of the sensor data block is set to midnight. 22 writes the sensor data block to all eight sections in case one or more of the sections contains copied sensor data blocks which the DAS is waiting to transfer, via the Dump Mode, to the 6500 Computer system. As soon as all disk operations are completed, 22 writes the correct sensor ID word and sensor disk address word into core memory. This completes the addition of a sensor. 22 then checks DSDREO to see if the Dump Mode has requested the disk. If so, 22 executes a Jump and store instruction to the address contained at location DSDADR. When the Dump Mode finishes with the disk, it returns control to 22, which then returns to 21. 21 prints the ”ADDED" message and calls PROMPT to request a new command, as detailed fer the V command. 11.11.12 1 Command The Y command removes an individual sensor. It begins executing by entering the VHXY routine thru the Y entry point. VHXY then executes the same sequence of instructions that it does for the V command. In this case, however, the message printed is "REMOVE SENSOR", and ZRFLG is set fer a different entry point into 21. The remainder of the Y command operates in an analagous fashion to the H command, which removes an entire Remote Station from the DAS. For the Y command, however, the sensor number as well as the station number is requested by 21 via the same sequence of instruc- tions used by the V command. After the station and sensor number are 125 entered, 21 verifies that the sensor is already defined. If it is not, 21 aborts, and PROMPT then requests a new command, as befbre. Otherwise, 21 checks if the Dump Mode or the Automatic Acquisition Mode is processing data from the Remove Station at which the sensor is located. If so, 21 aborts the Y command, and PRCMPT again requests a new command. The Y command may be attempted again in a few minutes. Hhen Y is called and neither the Dump Mode nor the Automatic Acquisition Mode are processing data from the requested station, 21 removes the sensor by writing :FFFF into its disk address word in core memory. 21 then proceeds to print the "DELETED” message and calls PROMPT, as explained for the H command. CHAPTER V CONCLUSION S . 1 Objectives This research has been directed towards developing a _D_ata _A_cquisition System (DAS) for a specific large-scale, distributed, physical system: the Water Quality Management Facility of the Institute of Water Research at Michigan State University. The DAS was to consist of a centrally-located data logger (Central Station) and several widely-distributed groups of sensors, connected via communication channels. ‘Data from the sensors was to be automatical- ly recorded at fixed intervals of time. Once a day this data was to be transferred to a main computer via a dial-up telephone line. Additionally, an operator was to be able to easily'obtain the current value of any sensor, obtain the data antomatically gathered from a sensor during the previous 2“ hours, add or remove a sensor, and check the overall status of the DAS. Operator access to the DAS was to be possible both from the location of the data logger and from the Hater Quality Management Facility. Finally, the DAS was to be able to correctly restart itself after a power failure had occurred. 5.2 Accomplishments A Data Acquisition System (DAS) which fulfulls all the design objectives has been designed, constructed, and tested. A mini- computer was selected to implement the function of the data logger 126 127 (Central Station). The communication channels which link the data logger to the remotely-located groups of sensors were realized as dial-up telephone lines. Each group of sensors is interfaced to a separate telephone line via a Remote Station, which samples a sensor and transmits the data to the Central Station when the Central Station sends it the correct command. A Real-Time Operating System (RTOS) has been written in assembly language for the minicomputer. The RTOS controls the entire data acquisition process. It is designed so that several different operations may be in progress at the same time: sensors can be automatically sampled while a block of sensor data is being trans— ferred to the main computer and an operator is using one of the Teletypes. The RTOS requires 16K of core memory in the minicomputer. The Central Station sends the data it has automatically gathered from the sensors to the main campus computer. This data is transferred via a dial-up 300 baud telephone line every weekday morning at 9:00. A compact format for sending the data to themain computer has been developed. Checksum characters are transmitted along with the sensor data to provide for error detection. Trans- mission errors cause the Central Station to retransmit the data to insure that only valid data is entered into the main computer's data base. Operator access to and control of the DAS is provided by two Teletypes. A controller was designed, constructed, and tested which interfaces both Teletypes to the minicomputer. The Teletype at the Hater Quality Management Facility is connected to the minicomputer via a dedicated telephone line and two modem/controllers. An easy- to-use series of commands has been implemented via the R108 which 128 allows an operator to: add and remove sensors and Remote Stations, obtain the current value of any sensor, obtain a listing of the data automatically gathered from a sensor during the previous 2“ hours, and obtain the status of the DAS. The commands have been designed so that the operator is not forced to remember a complex set of rules to communicate with the DAS. Also, the RTOS allows the operator to correct typing errors by entering the back-arrow (€-). This con— siderably simplifies operator interaction with the DAS. A battery-operated Real-Time Clock has been designed, construc- ted, and tested. This Clock is interfaced to the minicomputer and permits the RTOS to determine the correct time after a power failure has occurred. The RTOS then automatically restarts the DAS by writing missing-data flags into the data blocks of those sensors which should have been sampled when the power was off. Thus only a minimal amount of sensor data is lost. At the present time, the Central Station and one Remote Station have been constructed. Final testing‘of the DAS in the laboratory is currently in progress. The cost of the equipment comprising the Central Station is $18,215.00, while the cost of the single Remote Station is $1955.00. (See Table 5.1) Approximately 300 hours were spent assemblingnand testing the hardware at the Central Station; the Remote Station would require approximately 120 hours to duplicate. All of the equipment at the Central Station, except the Bell System Data Couplers, the Teletypes, and a small (2u" X an" x 6") cabinet for the Remote Teletype controller is installed in a 6' high standard 19" rack cabinet. 129 Table 5.1 Cost Breakdown Central Station Minicomputer w/16K core memory Modem/Calling Units (2) (including interface cards) Dual Floppy Disk Unit (including interface card) Teletypes (2) Custom Controller Display Controller and Display Panel Local Modem/Controller Battery Real-Time Clock Remote Modem/Controller Power Supplies Cabinets Miscellaneous TOTAL COST Remote Station (8) Transmitter Card Receiver Card Digital Control Multiplexer Card Analog Signal Multiplexer Card Modem Card Power Supplies Cabinet Miscellaneous TOTAL COST $ u795. 3600. u3oo. 3uoo. 325. 210. 275. 220. 290. 300. 300. 200. $18215. 3 380. 330. 30. 350. 90. 300. 100. $1955. 00 OO 00 00 OO 00 OO 00 OO 00 OO 00 OO 00 00 00 00 OO 00 OO 00 375. 00 130 5.3 Overall Project Evaluation The Data Acquisition System described in this thesis effective- ly fulfills the data gathering requirements at the Hater Quality Management Facility. All of the design objectives have been satis- fied. Using a minicomputer for the data logger and dial-up telephone lines for the communication channels linking the data logger (Central Station) and the groups of sensors have proved to be a cost- effective solution to a difficult data-gathering problem. However, changes can be made in the design of the Remote Stations, which interface the groups of sensors to dial-up telephone lines. The Remote Stations were constructed utilizing several SERDEX circuit modules, which are manufactured by Analog Devices Inc. (9’10’11) Today it would be less expensive to design and construct a Remote Station utilizing a microprocessor rather than the SERDEX modules. This change would also allow faster, and therefore more efficient, exchange of data between the Central Station and the Remote Stations. The two Teletypes provide adequate operator access to the DAS. However, full sensor history listings require several minutes to be printed. Operator access could be improved by replacing the Tele- types by CRT terminals and line printers. This improvement would allow long data listings to be obtained much faster. Operator access could be expanded by interfacing additional dial-up telephone lines to the Central Station. The RTOS could then be modified to allow a user to call the DAS to obtain current sensor data. The RTOS currently restarts the DAS after a power failure by adding missing-data flags to the correct sensor data blocks. An Uniterruptable Power Supply could be used to power the Central 131 Station; this would permit it to sample sensors even when commercial power was unavailable. This would be a desirable addition if it was critical to always record data from the sensors. The DAS now derives the time and date from the power line frequency, via the Real-Time Clock option installed in the minicom- puter. A receiver tuned to the National Bureau of Standards time station WVB could be interfaced to the minicomputer. This time signal has much better long-term accuracy than the power line frequency. The RTOS could then be modified to check the HHVB time once a day and correct the DAS time if necessaryu With this addition the DAS would always have the correct time. APPENDICES APPENDIX A BLOCK DIAGRAM COMPOSITION This appendix lists the integrated circuits which are contained in each functional block on the block diagrams in Chapter 2. Tables are presented for the Custom Controller, the Local Modem/Controller, the Display Controller, the Battery Real-Time Clock, and the Remote Modem! Controller . Table A.1 Custom Controller Block Diagram IC Composition Function Block Name Decoders and Latches Device Address Decoder Line Drivers A Line Drivers B Line Drivers C Line Drivers D Line Drivers E Line Receivers A Line Receivers B Line Receivers C Line Receivers D Sense Selector 132 Included Integrated Circuits 1/2 13, 1/2 1“, 3/fl 25, 26, 27, 28, 29, 30, 1/4 37, 1/2 39, ”2, 56. 1/3 72 2/3 6, ll” 13, 1/3 17, 18 2. 3. u. 5. U" 13 1/3 38, ll“ 39, 1/2 ”9, 1/2 50, 1/2 51, 1/2 52, 1/2 61, 1/2 66, 1/2 67 1/3 38, 1/1! 39, 1/2 149, 1/2 50, 1/2 51, 1/2 52, 1/2 61, 1/2 66 110, 1/6 ‘11, 2/3 53, 511 1/6 Ill 61% 15, 16, 1/3 17 1, 1/3 6, 1/6 17 1/6 17, 1/3 38 ll” 111, ll" 37, 1/2 72 133 Table A.2 Local Modem/Controller Block Diagram IC Composition Function Block Name Auto Echo Clock Debouncer Decoder and Latch Drivers A Drivers B Input Selector Line Driver Line Receivers A Line Receiver B Manual Power Switch Monostable Originate Modem Output Selector Printer Multiplexer and Enable Delay Send Constant Space Teletype Keyboard Interface Teletype Printer Interface Teletype Relay Driver UART Receiver UART Transmitter Included Integrated Circuits ll“ 20 13 u, 8, 1/3 9, 1/6 11 l/2 12, 15, 1/3 16, 17, 1/2 18, 19 1/2 22 1/2 22 1/2 10, 1/6 11 1/3 9, 1/6 21 l/3 11, 1/3 12 1/6 12 ll“ 20 l/2 23 1, 2, 3, 5, 6, 7 ll“ 10 1/6 16, 1/2 18, II“ 20, 1/2 23. 3/N 25 1/3 9 1/3 11 1/6 21 1/6 16, 1/6 21 1/2 1” 1/2 In 134 Table A.3 Display Controller Block Diagram IC Composition Function Block Name Included Integrated Circuits BCD to7-segnent Converters 15, 18, 20, 23, 26, 29, 31, 311, 36 Latches and Drivers 2, 6, 7, 8, 1/2 9, 2/3 10, 11, 3/16 12, 16, 17, 19, 21, 22, 2a, 25, 27, 23, 30. 32. 33. 35, 37 Line Receivers A 3. '1 Line Receivers B 5/6 5 Table A.“ Battery Real-Time Clock Block Diagram IC Composition Function Block Name Included Integrated Circuits Counters 1/2 3, 1/2 n, 2/3 5. 6, l/2 7, 1/3 8, 9, 10, 11, 12, 13, 1“, 15, 16, 17, 1/u 19, 1/3 “5, 1/6 “8, 1/6 "9, 1/2 50 Latches l/6 “9, 51 Level Converters and Latches 23, 2‘4, 25, 26, 1/3 27, 28, 29, 30, 31, 32, 111, 112, 1/2 50 Line Drivers 1/3 ‘15, 116, 117 Line Receivers 5/6 188, 1/6 119 Line Receivers and Level 18, 3/‘1 19, 311, 143, 1/3 115 Converters Multiplexers 37, 38, 39, HO Oscillator 1, 2, 1/2 3, ll“ n, 1/9 7, 1/6 27, 1/6 33, 1/2 52 135 Table A.5 Remote Modem/Controller Block Diagram IC Composition Function 2.1-23532919. Included Integrated Circuits AnswerModem l, 2, 3, 5, 6, 7 Auto Echo and Manual Override 1/‘4 15, 1m 17, 1/14 18 Clock 10 Debouncer M, 12 Decoder and Drivers :32 9, ll!) 13, 111, l/3 19, 1/2 22, Decoder and Latches 8, 3/11 15, 16, 1/2 17, 1/14 18, 1/2 19, 1/2 20, 25 Drivers A 1/2 21! Drivers B 1/2 22 Manual Power Switch 1/11 13, m: 18 Printer Multiplexer and 1/14 17, 1/2 20, 27, 1/2 28 Enable Delay Reset Circuit 1/2 9, 26 Teletype Keyboard Interface 1/ 6 l9 Teletype Printer Interface 1/6 21 Teletype Relay Driver 1/6 21 Transmit Multiplexer ll“ 13, ll" 18 UART Receiver 1/2 11 UART Transmitter 1/2 11 An error condi APPENDIX B DISK ERROR CODES tion in either floppy disk drive causes the DAS to terminate all processing. The cause of the error must then be determined and manually corrected. To help determine the cause of the error, the disk status word is displayed in the console data register on the front panel of the minicomputer. Each bit, when set, indicates the following conditions: Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit 10 Bit 11 Bit 12 Bit 13 Bit 1” Bit 15 \oooqoxuwzwmr-oo selected unit not ready DMA rate error end of media attempt to write on write-protected unit no ID compare ID CRC error data CRC error sync error non-deleted data encountered deleted data encountered done, operations complete cylinder zero sensed illegal parameter controller not present hardware error (timeout) write protected unit The CV lite is set if disk unit 1 caused the error, and reset if’unit 2 caused the error. 136 APPENDIX C BASE PAGE INTERRUPT LOCATIONS The interrupt structure of the minicomputer is utilized by both modem/calling units, the Teletypes, the real-time clock, and the power line monitor. The fbllowing list shows the location in the minicomputer's memory where each particular interrupt is vectored. A single instruction at that address is executed when the correspond- ing interrupt occurs. :00 Power Up :02 Teletype Output :06 Teletype Output End-Of-Block :18 Real-Time Clock :lA Real-Time Clock Sync :lC Power Down :18 Console/Trap :22 Teletype Input :26 Teletype Input End-Of-Block :60 ACU #1 - Abandon Call and Retry (ACU) :62 ACU #l - Data Set Status (DSS) :6“ ACU #1 - Present Next Digit (PND) :68 ACU #2 - ACR :6A ACU #2 - DSS :6C ACU #2 - PND :80 AMC #l - Receive :8“ AMC #l - Transmit :88 AMC #2 - Receive :8C AMC #2 - Transmit :92 AMC #1 - Exception :9“ AMC #1 - Rec1e3i7ve End-Of-Block :96 :9A :9C :95: AMC #1 AMC #2 AMC #2 AMC #2 138 Transmit Ehd—Of—Block Exception Receive End-Of-Block Transmit End-Of-Block LIST OF REFERENCES 10. 11. REFERENCES Utilization 9_f_: Natural Ecosystems for Wastewater Renovation- Final Report, prepared by the Institute of Water Research, Michigan State University (March, 1976) Floppy Disk Subsystem User's Manual, prepared by Computer Auto- mation, Inc. (August, 1975), p. G-“ Installation Instructions-Standalone 390 BPS Modem/Dialer Com- bination, prepared by the Vadic Corporation, (December, 1975) Bell System Technical Reference-Data Couplers CBS and CBT fer Automatic Terminals, prepared by American Telephone and Tele- graph Company, (May, 197“) Low-Spged Modem Fundamentals (AN-731 , prepared by Garth Nash, Computer Systems Engineering, Motorola Semiconductor Products, Inc., (August, 197“) MC6860L 0—600 BPS Digital Modem-Advance Information, prepared by Motorola Semiconductor Products, Inc. NAKED MINI/ALPHA LSI Series Computer Handbook, prepared by Com- puter Automation, Inc., (July, 197“), p. 6—22 Krause, Gary 3., _A Minicomputer—Based Remote Data Acgisition System, Michigan State University, (1976) SERDEX User's Guide-Serial Receiver SRXlOOS and SCL1006, pre— pared by Analog Devices, Inc. SERDEX User's Guide-Serial Multiplexer SMX100“/SMC1007 and SCL1006, prepared by Analongevices, Inc. SERDEX User's Guide-Serial Transmitter STX1003 and SCL1006, prepared by Analog Devices, Inc. 139 HIM ! IHIIIHHIW NH 6 0 1 8 5 4 1 3 o 3 9 2 4| 3 H ll" " | I T. H H I... “Ii 1 ilHlHWlll