UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Camac-based nuclear data acquisition system Le Patourel, David Andrew 1972

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Notice for Google Chrome users:
If you are having trouble viewing or searching the PDF with Google Chrome, please download it here instead.

Item Metadata


831-UBC_1972_A6_7 L45.pdf [ 1.84MB ]
JSON: 831-1.0084848.json
JSON-LD: 831-1.0084848-ld.json
RDF/XML (Pretty): 831-1.0084848-rdf.xml
RDF/JSON: 831-1.0084848-rdf.json
Turtle: 831-1.0084848-turtle.txt
N-Triples: 831-1.0084848-rdf-ntriples.txt
Original Record: 831-1.0084848-source.json
Full Text

Full Text

A CAMAC-BASED NUCLEAR DATA ACQUISITION SYSTEM by DAVID ANDREW LE PATOUREL B . S c , University of British Columbia, 1971 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE in the Department . of Physics We accept this thesis as conforming to the required standard THE UNIVERSITY OF BRITISH COLUMBIA September, 1972 In p resen t i ng t h i s t h e s i s in p a r t i a l f u l f i l m e n t o f the requirements f o r an advanced degree at the U n i v e r s i t y of B r i t i s h Columbia, I agree tha t the L i b r a r y sha l l make i t f r e e l y a v a i l a b l e f o r reference and s tudy. I f u r t h e r agree t h a t permiss ion f o r ex tens ive copying o f t h i s t h e s i s f o r s c h o l a r l y purposes may be granted by the Head o f my Department or by h i s r e p r e s e n t a t i v e s . I t i s understood tha t copying o r p u b l i c a t i o n o f t h i s t h e s i s f o r f i n a n c i a l ga in s h a l l not be al lowed w i thou t my w r i t t e n pe rmiss ion . Department of Physics The U n i v e r s i t y o f B r i t i s h Columbia Vancouver 8, Canada Date 25> September, 1972* i l Abstract This paper describes a data acquisition system developed f o r an intermediate energy nuclear scattering experiment. Equipment standards of CAMAC and NIM were used together with a 12K minicomputer and an industry compatible magnetic tape d r i v e r . The higher l e v e l languages of BASIC and FORTRAN were equipped with subroutines that allow input/output communication with the CAMAC data ac q u i s i t i o n system. The BASIC-CAMAC system proved to be most useful to the experimenter only taking second place to the FORTRAN-CAMAC system when data handling speed was of paramount importance. i i i Contents Page 1. INTRODUCTION 1 2. REQUIREMENTS OF A DATA ACQUISITION SYSTEM AND THE CAMAC CONCEPT 2 2.1 Scope of Current Experiment 2 2.2 General Requirements of a Nuclear Data Acquisition System • 2 2.2.1 2 2.2.2 CAMAC 3 2.2.3 Hardware Structure of CAMAC h 3 . SYSTEM DESCRIPTION 6 3.1 6 3.2 System Hardware Interfacing 6 3 .2.1 NOVA/NIM Interrupt Unit 6 3.2.2 Branch Highway Driver 7 3 .2 .2 .1 Loading the BHD 7 3 .2 .2 .2 A CAMAC Cycle 7 3*3 Programming 8 3.3.1 BASIC 8 3 .3.1 .1 CAMAC Subroutines 8 3.3.1 .2 CALL h 9 CALL 9 9 3.3.1.U Physics Subroutines 10 3.3.2 FORTRAN 11 3.3 .2 .1 11 3.3 .2 .2 FORTRAN Subroutines 12 k. CONCLUSION Ik REFERENCES 15" APPENDIX A Design of the NOVA/NIM Interrupt Unit 16 APPENDIX B Operation of the CALL Statement 17 APPENDIX C CALL 9 The Magnetic Tape Subroutine 19 APPENDIX D A Brief Data Acquisition Program i n BASIC 23 APPENDIX E FORTRAN Examples 25 iv List of Figures To follow page... Fig . 1 Beam Line Configuration 2 Fig . 2 Data Acquisition Hardware 2 Fig . 3 Lines Used During A CAMAC Cycle 7 Fig . U CAMAC Command Bit Configuration 7 Fig . 5 Spark Chamber Readout 10 Fig . 6 Circuit Logic for The NOVA/NIM Interrupt Unit 15 V Acknowledgment For much of the preliminary work on both software and hardware for the existing system, I wish to thank the Controls Group at TRIUMF, University of British Columbia. I am also indebted to Dr. Quentin Ingram, U . B . C , for his continued interest in further software developmentj to Professor Garth Jones for the opportunity to build and run the system on his experiment at the Lawrence Berkeley Laboratory, and in particular to my advisor, Dr. Richard Johnson, for continued help and encouragement during the course of my studies. 1, Introduction This paper describes the data acquisition system (DAS) developed for a 50 MeV Tl*d scattering experiment uti l izing a NOVA 1200 computer* Section 2 describes the equipment used, and anticipates the problems involved in designing a DAS compatible with the hardware. Section 3 describes the necessary system interfaces, and the software developed for the experiment. The data acquisition program was in i t ia l ly developed using the BASIC interpreter. This commonly known interactive language allowed the experimenters involved to edit and expand the DAS easily. When a final configuration was reached for production running, a change to FORTRAN as the system language was initiated to speed up the data logging process. Generally applicable features of the DAS are described in the main portion of the text; detailed aspects specific to this experiment are discussed in the appendices. - 2 -2» Requirements of a Data Acquisition System and the CAMAC Concept 2.1 Scope of Current Experiment The purpose of the present experiment is to measure do/dn for elastic scattering of £0 MeV positive pions from deuterium over an angular range of 10 deg. to 170 deg. testing the predications of impulse approximation calculations. This low energy range has not previously been theoretically considered, and good data is scarce. A beam of known intensity strikes a liquid deuterium target and scattered particles are detected in a stopping plastic scinti l lator. Fig . 1 illustrates the beam line configuration, and F ig . 2 the electronic equipment used. The experiment embodies most of the nuclear detection techniques used today. The data acquisition system is generally applicable to these techniques. 2.2 General Requirements of a Nuclear Data Acquisition System (DAS) 2.2.1 Requirements of theacurrent system are typical of most nuclear scattering experiments: i) beam characteristics such as flux and energy must be monitored. The beam current is integrated or each incident particle is counted to obtain the estimate of flux. A counter (scaler) is required to record the measurement. A sample of the incident beam particles stopped in a scintillator are analysed with an analogue to digital converter (ADG). The beam energy distribution corresponds to the pulse height distribution obtained from the ADC. i i ) Scattered particles of experimental interest must be identified by a fast logic coincidence network that defines an event. This task is handled by fast nuclear electronics (NIM equipment). The basic speed of the electronics is several nano seconds. Figure 1 presents a logic diagram for this experiment. The event of interest is defined as EVENT = G^C^if^ Figure 1 Beam Line Configuration The pion beam is produced by the primary proton beam of the Berkeley 18U" cyclotron. It is taken off at a backward angle of 59 deg. and focussed achromatically onto a liquid deuterium target. Knowledge of an incident particle's position on the target and which hodoscope element i t passed through is sufficient for momentum determination. TT+ p r o d u c t i o n target ,/• 12 e l e m e n t hodoscope p r o t o n b e a m M: bending magnet Q: quadrupole C: plastic s c i n t i l l a t o r S : spark chamber stopping counter FIGURE 1 BEAM LINE CONFIGURATION F igure 2 Data A c q u i s i t i o n Hardware Enough instrumentat ion f o r the system ex i s t s to f i l l s eve ra l NIM b i n s j on ly the one powering the i n t e r rup t un i t i s diagrammed. The BHD i s shown i n a CAMAC c r a t e . Th is i s not necessary as the un i t can func t i on wi th jus t a +6v power supp ly . No back plane connections are needed unless more than seven CAMAC crates are used . C A M A C m o d u l e s crate controller & t e r m i n a t o r t e l e t y p e D G C N O V A 1 2 0 0 b r a n c h highway d r i v e r A m p e x T M Z t a p e t r a n s p o r t NOVA/NIM interrupt unit F I G U R E 2 DATA ACQUISITION H A R D W A R E - 3 -The NOVA/NIM unit presents an interrupt to the computer when such an event has occurred. i i i ) the scattered particles must be tagged with their trajectories, their energy and momentum. Particle trajectories are tagged by spark locations in several chambers in the beam path, as well as an array of finger scintillator counters (hodoscope). The energy is obtained from analogue to digital conversions of stopped particle scintillator pulse heights. Momentum is obtained through computation based on the trajectory or pulse height information. iv) Data associated with each event must be stored for later retrieval and analysis. v) Some display capability is required for diagnostic and monitoring purposes. A teletype is standard equipment. A CRT display is convenient and in this experiment is driven from two digital-to-analogue converters that are capable of driving an X-Y plotter. Use of small computers to aid data handling has resulted in a variety of interfaces designed to allow on-line control of experimental equipment, and i t is for this purpose the CAMAC specification has been developed. This hardware standard allows experimenters to build a generally applicable DAS, requiring most specialized changes for specific experiments to be made in the controlling software and not the hardware. Thus, consideration of a particular system illustrates a solution to a much wider problem. 2.2,2 CAMAC The CAMAC interface, called a BRANCH HIGHWAY DRIVER (BHD), allows the computer to perform a l l the tasks outlined in 2.2*1. Two-way communication with experimental equipment is achieved through . i t . Fast NIM equipment signals an event. The fast NIM event pulse is separately interfaced - k -to the NOVA as an interrupt (Sec. 3.2.1), Sixteen CAMAC scalers in the spark chamber system are read, for each event, along with a pattern recogniaer for the hodoscope and an ADC for the stopping counter on the exit arm. Fig . 2 presents a schematic sketch of this equipment. This is a l l the necessary information for trajectory, energy and momentum analysis, and is stored immediately on magnetic tape. Since multiply-dimensioned arrays are possible with the high level language used in the DAS multiple data binning can be done with incoming data that is not possible with a conventional hardwired multi-channel analyser. Display of these is accomplished with two CAMAC DAC's used to drive X and Y traces on a storage oscilloscope; data from core is simply read out to the units sequentially, so a continuous plot appears on the scope. Any two parameters from the data array can be used as coordinates. On-line calculations are undertaken for low event rates while the system waits between events. For example, spark chamber raw data is converted to an absolute geometric position and individual scattering angles are calculated. Sophisticated analysis depends only on available time and core. 2,2,3 Hardware Structure of CAMAC Detailed specifications for CAMAC are found in references 1 aril 3 2. A general description of CAMAC is available and a journal is devoted to U its applications. A brief presentation of the CAMAC structural hardware is included here for completeness• Hardware necessary for a CAMAC system is indicated in F ig . 2j up to seven CAMAC crates can be daisy chained to one BHD. Each crate has 2k stations for modules and the 2£th, or control station, for a crate controller type A (CCA) which interfaces modules in the crate to the BHD. Communication between computer and BHD is effected with the standard i /O cable for the machine used. - 5" -To address a module, and cause i t to perform some function, one must specify to the BHD, the module's crate number C, station number N, sub address A within the module, and some allowed function code F denoting the operation that is required of that section of the module. - 6 -3. System Description 3«1 The system was built from the idea of incorporating an easy to use, flexible programming language with the CAMAC specification. In particular, high level languages that are familiar to most scientists were used. Greater uti l i t y of the system follows from this standardization since both electronics and programming are specified. The system speed is limited by the CAMAC cycle time and more importantly the program language speed • E L - J Operating system details also limit the DAS speed. For example, computer cycle time affects the speed with which the CAMAC system can handle incoming data and hence limits count rates. The two distinct periods during an experiment, debugging and f u l l scale data acquisition, have different program requirements. Initially, ease of program editing is the most important considerationj later, speed of event handling replaces i t . Such a change has been met by using two different programming languages, BASIC and FORTRAN. 3.2 System Hardware Interfacing Two system interfaces are required; one, to translate a fast NIM coincidence signal to a computer interrupt signifying an event, the other the standard CAMAC interface. In principle, the standard CAMAC inter-face having an interrupt feature is capable of undertaking the event 5" interrupt task. 3.2.1 NOVA/NIM Interrupt Unit This unit, daisy-chained onto the NOVA I/O cable before the BHD is recognized by the computer as a separate peripheral. The "event definition" pulse (indicating a ^ ....Ccj coincidence has occurred) is input to i t , and causes this device to request servicing (see Appendix A); the service routine initiates transfer of experimental data from CAMAC to the NOVA. During the transfer, this unit outputs a NIM pulse, which can be used to inhibit functioning of any NIM unit in response to a new event. - 7 -This unit was designed as economically as possiblej however, use of the Look-At-Me (LAM) CAMAC feature provides an alternate way of signalling an event. Either the external LAM point on a crate controller or LAM point on a coincidence register can be used. This approach is equally 6 acceptable, and has been used in more complicated systems. 3.2.2 Branch Highway Driver The Master Branch Highway Driver is designed to interface a NOVA computer to a CAMAC system. It can drive up to 7 crates alone. However, i t can drive three Slave BHD's which in turn drive seven crates, thus bringing twenty-eight CAMAC crates under the control of the Master BHD. This is a non-standard CAMAC feature and necessitates a Branch Highway code in each command as well as the standard CNA. Loading the BHD In order to initiate a command to the CAMAC system the three sixteen-bit buffers labelled A,B,C of the BHD must be loaded from core as indicated in Fig . k* A command requires specification of a three-bit crate number C (1 to 7)j a five-bit station number N (usually numbered 1 to 2k) corresponding to the addressed module's position in the crate and a four-bit sub-address A to specify a device within a module (e.g. scaler 1 within a quad scaler). A five-bit function code F is also necessary to make the addressed unit perform some task, such as read or clear. A four-bit branch code must be specified i f the Master/Slave configuration is used; however, for this purpose, just a master BHD is used so the branch code is always 1110. Fig . k also illustrates the position of the twenty-four data bits which can be transferred either way. A CAMAC Cycle With the buffers loaded in the above manner a start pulse from the computer wi l l initiate a CAMAC cycle. F ig . 3 presents a Fig . 3 Lines Used During A CAMAC Cycle i) C,N,A,F lines are activated by BHD and the BTA timing reference pulse is generated, i i ) the crate controller activates a single N Line and the A and F lines. i i i ) the addressed module puts its data on the read (R) lines and generates a Q response to indicate its successful completion of the operation. iv) the strobe pulse SI puts the data into the controller which then generates the BTB timing reference pulse to indicate proper operation. v) the BHD terminates BTA and the crate controller generates strobe S2 to clear the R lines, vi) the BTB pulse is removed, causing the BHD to clear the C,N,A,F lines and the cycle is complete. Receipt of the Q and BTB pulses is checked under program control in each CAMAC cycle since lack of either indicates a program error or a hardware failure. B C N A CD o CO ZT < CD B r a n c h Highway S i g n a l s 7 B C R l i n e s (one p e r c r a t e ) 7 B T B l i n e s 5 B N l i n e s ( b i n a r y ) 4 B A l i n e s ( b i n a r y ) 5 B F l i n e s ( b i n a r y ) B T A B H D C o m m a n d R e g i s t e r s Dataway S i g n a l s 24 B R W l i n e s ( c o m m o n r e a d / w r i t e ) ( l o w 16 data bits r e t u r n e d to NOVA b u f f e r C ; h i g h 8 t o B ) B Q ( t o N O V A on receipt of allQs o —5 ft to O o — i o to" -< d e d i c a t e d A l i n e s F l i n e s 1 t  N l i n e r 4 5 S1 S 2 24 R ( r e a d only) l i n e s 24 W ( w r i t e only) l i n e s Q f r o m module then to B H D 0 ) CL CL —I (0 (fi ro Q-o > > o 3 o CL to" F I G U R E 3 L I N E S U S E D DURING A C A M A C C Y C L E Figure k CAMAC Command Bit Configuration This illustrates the standard designation of the U8 bits involved in a CAMAC cycle and their positions when loaded into the command registers. When a CAMAC sequence is built in core, three 16-bit words can be used for each entry, with the same configuration as drawn. (See 3*3.2.2). B U F F E R A 1 ! ! B 8 ^ 4 B 2 B 1 I I I c c c ^ 4 ^ 2 ^ 1 • i i i 1 i i i 1 1 1 ^ 8 ^ 4 ^ 2 ^ 1 i i i B U F F E R B | I I I 0 0 0 Ej6 F8 I i I I B U F F E R C i 1 1 r D 1 6 D 1 5 D K D 1 3 D * I I I I 5 11 F F 7 r1 D 1 0 D 9 D 8 J L i 1 r ^ 3 ^ 2 D 2 1 D 2 0 D 1 9 i i_ i i 1 1 1 1 D ? D 6 D 5 D 4 D 3 i I I l D 1 8 D 1 ? D 2 D 1 F I G U R E 4 C A M A C C O M M A N D BIT CONFIGURATION description of the operation. Data is sent to or from CAMAC and some CAMAC function is performed. An error flag is returned indicating the success or failure of the CAMAC cycle. 3.3 Programming 3.3.1 BASIC BASIC was chosen as the programming language to use during the system installation and commissioning phase of the experiment. BASIC is interactive. Programs can be halted, edited and restarted from a teletype at anjr time during execution without otherwise affecting them. Since BASIC is an interpretive system storing the teletype code program line-by-line i t is slow. Assembler language subroutines doing the CAMAC operations were added to the BASIC system. This was done using the CALL feature of DATAGEN BASIC.-: The CALL command is interpreted as a jump-to-subroutine r (JSR) command followed sequentially fay the adresses in core of each of the subroutine parameters classified as output (input) to (from) BASIC. She assembler routines are headed by a table in core specifying subroutine number, core entry point, and parameter l i s t . CAMAC Subroutines CALL 1, (C), (N), (A), (F), D, E executes a CAMAC read operation. The user enters decimal numbers for C N A and F to read or read and clear a module. Data is returned as variable D. A zero is returned in E for a successful CAMAC operation or a CAMAC error code is returned in E i f the operation is unsuccessful. CALL 2 (C), (N), (I), (F), (D), E is used analagously to write data into a module. Either operation takes about 1G msec although only 30 usee of that is the actual CAMAC cycle. Single CAMAC read or write instructions are used to check the • DATAGEN of CANADA, LTD. Hull, Quebec. Copywrite 1970. - 9 -operation of modules. However, even during commissioning the execution times of single CAMAC instructions have proven to be excessive. Sequences of CAMAC instructions can be defined by CALL U711> J, I, C, N, A, F, D where J is one of 5> allowable sequences and I is one of 10 allowed sequence elements. CNAFD bear the usual CAMAC significance. CALL 3> Z(J, 1), E allows the execution of the CAMAC sequence J with the resulting data returned to row J of array Z. A zero returned for E indicates a successful sequence execution while other E values denote CAMAC response errors during the sequence execution. The execution speed is much shorter (about 1 msec per CAMAC instruction) than single CAMAC instructions since an assembled program is used when the sequence is being executed. The time difference between this and the CAMAC cycle time is due to data conversion to the BASIC floating point format. CALL k BASIC responds to only teletype interrupts. CALL h is used to allow program access when evert interrupts occur. CALL it has no parameters. It takes program comtrol from BASIC and puts the system into a loop awaiting the arrival of an event interrupt from the NOVA/NIM unit. When an event interrupt occurs program control is returned to BASIC and CAMAC sequence reads are then executed to gather data associated with that event. One additional feature is associated with CALL U. Data acquisition may be stopped at a known point in the program. The CALL k loop checks front panel switches expecting to find only Switch Ik up. If the user puts i t down, a crate inhibit command is sent to CAMAC suspending CAMAC operation until the switch is again returned to an up position. CALL 9 A magnetic tape handler was incorporated into a separate - 10 -subroutine, Call 9. It is used primarily to write raw data from the Z array mentioned onto tape for later analysis, but is capable of any tape handling operation. Free format for recorded data was used so analysis of the tapes produced at a large computing center usually requires some specialized software to get data from the tapes. Writing onto tape considerably increases time to analyze an event. From start up to completion a tape write operation requires about 50 msec. Consequently data from 12 events are stored in the computer before the data is logged as a single record on magnetic tape. This reduces the net writing time to about 5 msec per event. Appendix G contains a l i s t of magnetic tape options available in Call 9. 3«3«1«U Physics Subroutines In order to speed up event analysis, assembler subroutines (CALL 21 and CALL 22) were developed to interpret the hodoscope reading and the spark chamber data for each event. The hodoscope reading is a 12 bit word, one bit for each of the scintillator fingers. CALL 22 is a bit-examining routine to see i f just one element, or possibly two adjacent elements fired. Any other result is interpreted as an error. Either multiple passage of particles through the hodoscope, or a failure of the equipment is possible. CALL 21 checks proper operation of a l l 8 spark planes. Each plane has associated with i t two scalers; after a successful f iring, a fiducial count should be held in the second scaler. An intermediate count wi l l reside in the first scaler, corresponding to the particles trajectory position in the spark plane. If this condition is not met, an error message results. F ig . 5 illustrates the spark chamber configuration and readout. The execution speed achieved by assembler coding these two program segments is considerable. CALL 21 requires 130g instructions and Figure 5* Spark Chamber Readout The pulse trains are from a 20 MHz clock. The fiducial pulse separation for each spark chamber is characteristic of the wand. The spark chamber system is typically 8$ per cent efficient in prolonged operation. XI Y1 X2 Y2 X4 Y4 f i r s t f i d u c i a l spark plane pulses event p u l s e s e c o n d f i d u c i a l •start both s c a l e r s s t o p f i r s t s c a l e r stop second s c a l e r * FIGURE 5 S P A R K C H A M B E R READOUT - 11 -is executed in about 100 usees. CALL 22 requires 53Q executes in about o 50 usees. Ten lines of BASIC are required for the BASIC equivalent of CALL 22 for an execution time of 100 msec. About 25 BASIC lines are required for a CALL 21 BASIC equivalent for an execution time of 250 msec. The net speed increase is over three orders of magnitude. The most rapid data acquisition program used with the BASIC/CAMAC system to date accepts data from CAMAC with sequence reads, performs CALL 21 and CALL 22 operations and records the data on magnetic tape, requiring about 200 msec per event. This is about the speed limit on this form of BASIC/CAMAC data acquisition. Appendix C contains the BASIC/CAMAC subroutine operating instructions, and Appendix D, a simple BASIC data acquisition program. 3.3.2 FORTRAN Several advantages are gained by a system change to FORTRAN as the DAS language. Primarily, the increase in speed of event handling justifies the change. FORTRAN-CAMAC sequence reads offer a time saving of up to an order of magnitude over BASIC-CAMAC sequence reads. Since single precision (16 bit) integer format can be specified for a l l variables in the main FORTRAN program, no time is used for conversion between fixed and floating formats. This has the added advantage that magnetic tapes written on with free-formatted binary integers are easy to read, so translation software necessary for data analysis is minimal. Assembler language subroutines are simple to incorporate, since the DATAGEN FORTRAN compiler accepts machine language instructions as part of a FORTRAN program. Although FORTRAN is not interactive, this feature is hardly missed after a system has reached its final configuration. The major drawback associated with FORTRAN is the sophisticated hardware necessary for quick compilation and execution. To prepare a - 12 -program for execution requires the loading of the compiler itself, assembler to produce a relocatable binary tape from the compiled output, and the library routines to supply the assembled program with the necessary mathematical subroutines (trigonometric, logarithmic, etc.) This represents about itOK words worth of paper tape, which even with a high speed reader, is rather tedious to load. A disc is the best fast storage and retrieval system to use for FORTRAN programming with a NOVA, but is expensive. Attempts to use the tape unit as a f i le storage system by means of DATAGEN's "MAGNETIC TAPE SIMPLE MONITOR" (SIMON) system have been disappointing since the tape unit simply has neither the speed nor the rel iabil i ty of a disc. Two changes to SIMON to make i t more compatible with magnetic tape may allow a complete conversion to a FORTRAN system. The first change is a rairainization of the necessary writing done by the system, particularly at start-up. The fewer opportunities the system has to destroy itself by overwriting, the fewer system crashes there wi l l be. The second change involves increasing to U192 from 256 the number of words written per block when the system is storing a f i l e . This reduces by a factor of 16 the number of times directory access is made, thus ensuring less wear on the tape, and less chance of overwriting the directory accidently. 3.3 .2 .2 FORTRAN Subroutines Subroutines written for CAMAC and tape unit handling are quite similar to their BASIC counterparts. Thus, CALL CYCLE (C,N,A,F,D(l),$n) does a single CAMAC operation, returning the low order sixteen bits in D(2) and the high order eight bits to D(1) . A hardware error causes return to line n in the main program. Similarly, a sequence operation is effected with CALL EXEC (X(l,l),N,$n). X is a 3 x N integer array. CNA is encoded into X(l , l ) as - 13 -the I command in the Sequence. F and the eight high order data bits are in X(2 , I ) , and the sixteen low order bits are returned in X(3»I)> just as in Fig . U's representation of the BHD buffers. Provision for just one long sequence of as many CAMAC operations as necessary is made; N is the number of commands in the sequence. The routine to build a sequence performs the same function as BASIC'S CALL U711. The hodoscope and magnetic tape routines are unchanged, but spark chambers are handled just with a FORTRAN subroutine. A brief data acquisition system program in FORTRAN which wi l l do the same analysis as the BASIC program in Appendix D takes no more than £0 msec per event, most of the time being required for the tape unit to write the data record. The immediately obvious improvement to this is one which was incorporated to the BASIC program as well; that is , multiple event logging. Data for 20 events is accumulated in a large array, then written onto tape so that the time required to record each event averages out to less than 2 .5 msec. An example of a FORTRAN sequence build is found in Appendix E . - l u -ll* Conclusion The approach adopted towards DAS development has been reasonably successful. A BASIC-CAMAC system certainly offers experimenters a simple way in which to reach a f inal configuration without much re-programming necessary. The system fails to be satisfactory, however, when events rates rase much above five per sec. A change to FORTRAN is the logical next step to preserve the f lexibi l i ty and ease of use offered by a high level language and increase the system speed to a point where the spark chambers wi l l limit the event rate to about twenty per sec. Since the FORTRAN data logging program described in section 3.3*2 occupies only $ msec (200 per second), the FORTRAN DAS is not computer limited. Additional calculation can be done during the nuclear electronics dead time. It has been demonstrated that a CAMAC system with a high level controlling language does offer wide applicability once the i n i t i a l system has been established. 715 -References 1) "CAMAC": A Modular Instrumentation System, Description and Specification", EURATOM Report EUR UlOOe, Luxembourg, 1969. 2) "CAMAC: Organisation of Multi-Crate Systems. Specification of the Branch Highway and CAMAC Crate Controller Type A - l " . EURATOM Report EUR U600e, Luxembourg, 1972. 3) IEEE Transactions on Nuclear Science NS-18. 2, (1971). k) CAMAC Bulletin, a journal of the ESONE Committee. 5) "TRIUMF/CAMAC Branch Highway Driver", W.K.Lacey and D.P.Gurd, TRIUMF Report No. TRI-1-71-2, May 1971 (unpublished). 6) Dollard, Marquardt, Gurd, Johnson, "Proceedings of the 6th Annual Accelerator Conference", July, 1972. (to be published). 7) How to Use the Nova Computers, Data General Corporation, Southboro, Massachusetts, April 1971. Figure 6 Circuit Logic for the N O V A / N I M Interrupt Unit The event input, labelled EVENT, is a negative NIM pulse converted to a positive-going TTL pulse. The CPU BUSY output is a TTL level which is converted to a NIM level before being used outside the unit. The unit has device code U-OQ • S T R T O C P U B U S Y RQENB D E \ M 0 S E L C L R F I G U R E 6 CIRCUIT LOGIC F O R THE N O V A / N I M I N T E R R U P T UNIT - 16 -APPENDIX A Design of the NOVA/NIM Interrupt Unit Figure 6 illustrates the logic associated with the interrupt unit. It is a simple device, designed to request a CPU interrupt when a NIM event pulse is input to i t . When the data acquisition program enters the CALL k subroutine a Start (STRT) pulse sets the BUST fl ip-flop (ff) and clears the DONE f f . An event NIM pulse in then clears BUSY and sets DONE. The leading edge of the next Request Enable (RQENB) pulse from the CPU sets the Interrupt Request (INT REQ) f f . The response of the interrupt service routine within the assembler subroutines (recall BASIC ignores a l l but teletype interrupts) to this request is simply to clear the DONE ff , and transfer program control back to BASIC. The next RQENB senses that DONE has been cleared, and so clears INT REQ. The BUSY f f is s t i l l clear and is not reset until the next CALL U is executed; the unit is then ready to accept the next event pulse. For the length of time that BUSY is clear, that i s , from receipt of event pulse to next execution of CALL U, a NIM signal is output from this unit to indicate that the computer is busy analysing an event. The signal is used to veto possible incoming events. A more detailed analysis of interface operation in general wi l l be found in reference 7 » - . 1 7 -APPENDIX B Operation of the CALL Statement The CALL statement implemented to BASIC has the general format CALL r,a,b,c,...,h where r i s the number of the assembler subroutine to be executed, and a,b,c,....(maximum of 8) are either input parameters passed from the BASIC program to the assembler routine, or output parameters, passed from the assembler routine to BASIC. The BASIC interpreter occupies the f i r s t UK of core, and at address 10g resides the s t a r t i n g address of the assembler subroutines. They are preceded by a three word table f o r each, specifying subroutine number, subroutine entry point, and a variable con-t r o l word which c l a s s i f i e s parameters as either input (coded IO2) or output (coded l l g ) . (Hence the eight variable r e s t r i c t i o n - 2 b i t s f o r each i n a 16 b i t word.) Input parameters are i n BASIC'S f l o a t i n g point format, and must be encoded as binary integers before being used i n the assembler routines. Output parameters are binary integers, which must be encoded as BASIC f l o a t i n g point numbers when passed back to BASIC. These processes are accomplished with the FIX and FLOAT routines within the BASIC Interpreter and probably require of the order of 100 usee each. (Use of FORTRAN'S integer format f o r data handling w i l l negate the need f o r such wasteful b i t shuffling.) Preceding these tables i s the address of the interrupt servicing routine which handles CAMAC, magnetic tape, interface and NOVA/NIM unit i n t e r r u p t s . This device service routine c a p a b i l i t y e x i s t s i n addition to BASIC'S own teletype servicing routine. An attempt to incorporate both together would require reasonably major ed i t i n g to the BASIC interpreter, which i s uneconomical when system requirements are i n a state of f l u x . - 18 -When the statement CALL r , a , b , c , . » # is executed, the following sequence "appears" to the assembler package: JUMP TO SUBROUTINE (JSR) r ADDRESS of a ADDRESS of b ADDRESS of c * • • ADDRESS OF LAST PARAMETER RETURN TO BASIC HERE . When the JSR instruction is executed, its location in core is stored in an accumulator, so the method of access to the parameters and to the return address is obvious. - 1 9 -APPENDIX C CALL 9 The Magnetic Tape Subroutine Interfaces for NOVA-compatible magnetic tape units such as the AMPEX Type TMZ transport are three buffer devices. The A buffer can hold one of seven possible tape command codes F: 0 (Read), 1 (Rewind), 3 (Space Forward), k (Space Reverse), $ (Write), 6 (Write End of Fi le) , 7 (Erase). Buffer B contains ant address A which is the start of a block in core, and buffer C contains a word count, N. For a Read or Write command, the user must specify both an N and an A as well as F . If the command is Write, the unit wi l l write on tape N 16 bit words from core, beginning at location A. If the command is Read, the unit wi l l read a record off tape, and deposit N words from i t onto core beginning at location A. For Space Forward or Reverse commands, the tape wi l l advance over or rewind over N records, positioning i tself at the start of a new record when complete. Subroutine Call 9, N,F,A,E,X is capable of a l l six possible tape functions. F is simply the function code, as described. X is a flag (either 0 or 1) to indicate whether the tape unit is going to read or write BASIC variables (32 bits) or an area of core (16 bit words). In the former case, A is interpreted as the beginning address of a BASIC array such as Z (0,0), and N is doubled to take into account the double word length of the parameters. In the latter case, A is interpreted as an absolute address in core. Thus, for example, the statement CALL 9, 5"0, 1, Z(0,0), E, 1 would write 5*0 BASIC variables (100 16 bit words) onto tape, beginning with Z(0,0) and ending with Z(li,£)» - 20 -E is a hardware error flag returned to BASIC from the subroutine. Any non-zero return indicates a fault in a particular record (parity or bad tape) or in the system itse l f . Any time data acquisition is halted, the user can inspect the data for any particular event by reversing over sufficient records and reading the desired record back into core. A simple way to organize data on tape is to write one record for each event, tagging i t with the run number, and separating runs with end of f i le (EOF) marks. - 21 -CALL 21 The Spark Chamber Subroutine After a sequence data read of the sixteen scalers associated with the eight spark planes, the counts from each scaler reside in absolute locations in core. The statement CALL 21,W3,F,1,L,U,WU wi l l test that the count contained in the first scaler (event pulse on Fig.5) on the first spark plane (XI) is non-zero, and less than the fiducial count F for that wand. The count from the second scaler (second fiducial on Fig . 5) must l ie within five of F to be accepted as the fiducial count. If i t is less, two event pulses presumed to have occurred. If greater, the scaler is assumed to have overrun. Each of these possibilities has a code number; the outcome of each test is returned in variable W3. A further restriction on the event pulse can be made. The user can test that i t lay within lower and upper bounds L and U. Variable Wii is returned as 1 i f this test is passed, and 0 i f failed. Any number of spark planes can be tested in this way with CALL 21; the essential operation of the spark chamber test in Appendix D's program should be clear. - 22 -CALL 22 The Hodoscope Subroutine Immediately after an event, the hodoscope pattern recognizer has bits set corresponding to the elements of the hodoscope which fired. The statement CALL 22,H,I,E causes the data word stored as BASIC variable H to be examined for set bits . A valid event is characterized by a single bit or two adjacent bits being set. I is a variable returned from the routine indicating which bit or bits were high. (For example, 1=20 indicates the tenth hodoscope element firedj 1=21 indicates both tenth and eleventh fired). E, the hodoscope quality flag is returned as 0 or 1 for these cases, respectively. Possible errors are hardware malfunctions, in which case 1=0, or multiple passage of particles through the channel, resulting in several bits being set. In that case I is returned as 1. Both errors cause an E return of 2. A practical example of the use of this subroutine is found in Appendix D. APPENDIX D A Brief Data Acquisition Program in BASIC As a specific example of a data acquisition program in BASIC, the following one is included, with a brief description of its operation: 1000 CALL h 1020 LET Z(0,10) = Z(0,10)+l 10U0 CALL 3,1,Z(1,1),E1 10la CALL 3,2,Z(2,1),E2 10U2 CALL 3,3,Z(3,l),EO 10U3 CALL 3,U,Z(U,1),E3 1060 CALL 9,50,1,Z(0,9),W1,1 1100 CALL 22,Z(2,10),H1,WU 1101 LET H(H1) = H(H1)+1 1102 IF WU< 2 GOTO 1120 1103 LET E(8) = E(8)+l 110U GOTO 1000 1120 LET ¥ 1 = 0 1121 FOR I = 0 TO 7 1123 CALL 21,W3,F(l),I+l,L(l),U(l),Wli 12.2k IF WJi > 0 GOTO 1128 1125 LET S(I,¥3) = S(I,W3)+1 1127 LET ¥ 1 = 1 1128 NEXT I 1129 LET F8 = F8+¥l 1130 IF ¥1 * 1 GOTO 1000 1LU0 LET S2 - Z(2,8)/25+25 Ilia IF S2 >0 GOTO l l i i3 11U2 LET S2 = 0 131*3 IF S2 < 100 GOTO 11U5 llhk LET S2 - 100 11U5 LET Q(0,S2) =• Q(0,S2)+1 1150 GOTO 1000 Line 1000 is the CALL k execute, which sets the system in a condition to accept an event. Control is returned to BASIC when the event interrupt occurs, and the next four lines (lOlil to 10U3) are four CAMAC sequence reads of ten commands each. These read in a l l necessary data associated with a single event, and store i t in 5 x 10 array Z. Line 1060 is the write on tape instruction, writing out the useful segment of the Z array. - afc-Lines 1100 to 1103 do the hodoscope check with CALL 22 j errors are binned in E(8) and analysis is aborted; or, i f the hodoscope functioned properly, proceeds to the Spark Chamber test, CALL 21. Lines 1121 to 1128 check that a l l eight positional sparks were non-zero, f e l l within their respective fiducial limits, F( l ) , and within any assigned lower or upper limits L(I) and U(I)* Any error causes a halt to further analysis and a return to line 1000. Otherwise, the ADC reading from the stopping counter on the scattering arm is binned (lines lliiO to llk$)• Line 1150 is the normal return to line 1000, to await the next event. - 25 -APPENDIX E An example of a ten element CAMAC sequence build using DGC FORTRAN is included to demonstrate the use of some of the FORTRAN subroutines. INTEGER D( 2) INTEGER X(3,10) DO 20 1-1,10 ACCEPT C,N,A,F,D,(1),D(2) 20 CALL SEQNC (X(1,I),C,N,A,F,D(1)) Each time the program encountered the ACCEPT statement, i t would pause while the user entered C,N,A,F and data necessary for any write commands. Data can be up to 2k bits with the low order 16 bits in D(2) and the high order 8 bits in D(l ) . The core image of this sequence is the array X(3>10), each column of which has the configuration of Fig . U. 1st element 2nd element . . . 10th element (X(1,1))=CNA . (X(1,10))=CNA (X(2,1))=F plus Dg . (X(2,10))=F plus (X(3,l))=D l 6 . (X(3,10))-D l 6 The following segment would await the arrival of an event pulse ( i .e . an interrupt from device kO) and then execute the entire sequence. UO CALL WAIT (DEV) IF (DEV.EQ.lio) GOTO 50 U5 TYPE "ERROR" PAUSE 50 CALL EXEC (X(1,1),10,$U5) GOTO kO After the sequence execution, data from the Ith entry would reside in X(2,I) and X(3»l) (high and low order respectively). BTB or Q response error would cause transfer to line U5» 


Citation Scheme:


Citations by CSL (citeproc-js)

Usage Statistics



Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            async >
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:


Related Items