[next page (Sect 6.5)] | [previous page (Sect 6.3)] | [index] | [top]
6.4 NSAC - a personal computer based data acquisition program

H.E. Swanson

NSAC is the data acquisition and control program developed for the neutron spin rotation experiment discussed in this annual report (see Section 1.8). It runs on a PC under the DOS operating system. The PC's interface to the experiment is an Analogic LDAS16 module providing 16 bit ADCs and DACs, and a parallel output port. NSAC was written in Microsoft FORTRAN so that students and faculty could more easily make modifications as the experiment evolved. To use FORTRAN in a real time environment, assembler routines were written to enhance FORTRAN as follows: (1) To allow subroutines to be called directly from an interrupt, (2) to allow hardware modules to be directly programmed, and (3) to intercept keyboard input as it is typed rather than waiting for the user to hit the Enter key. These routines follow the FORTRAN call convention and can be used in any FORTRAN program.

In operation a programmed sequence controls external fields and devices via digital output bits and DACs. The acquisition sequence is set up from a file which specifies the interface used to control external supplies and their states and timings. Detector currents for each state of the sequence are read with gated integrators and ADCs. We use the PC's clock to determine the timing for the sequence, but in principle any hardware interrupt will also work. The interrupt routines write data into a buffer and signal the main program using flags and variables in a shared common area. The main program writes data to disk and updates the plots.

Control of the program is from the keyboard. Typing BEGIN obtains a run number and title, and starts the normal acquisition sequence. After each pass through the sequence, the completed data cycle is written to disk. An END command stops acquisition at the end of a data cycle. Other acquisition modes provide for measuring the polarization product of the polarimeter, and scanning fields to determine their optimum settings. The PLOT command allows plotting both individual ADC readings as they are taken or asymmetries calculated from completed data cycles. A SETUP command modifies parameters within the program and provides control of the target while cooling down.


[next page (Sect 6.5)] | [previous page (Sect 6.3)] | [index] | [top]