
                                                                20-Nov-1990 18:08:55	VAX FORTRAN V5.4-79                 Page   1
                                                                14-Jul-1988 19:37:22	LIB4:[ADDASYS.SOURCE]ADDA_LOADER.FOR;4      

0001    	PROGRAM	ADDA_LOADER
0002    C
0003    C **************************************************************************
0004    C **  PROGRAM AUTHOR:       WILLIAM BAKER
0005    C 
0006    C **  PROGRAM DESCRIPTION:  READS A DATA CONFIGURATION FILE, AND LOADS
0007    C **                        INFORMATION INTO THE SHARED COMMON ARRAY.
0008    C ** 
0009    C
0010    C **  ADDA_LOADER
0011    C     ------------
0012    C
0013    C **  DECLARE LOCAL VARIABLES NEEDED BY PROGRAM.
0014    C
0015    	CHARACTER*99	DLINE, AD_IN
0016    C
0017    C **  INCLUDE THE DATABASE DECLARATIONS.
0018    C
0019    	INCLUDE	'LIB4:[ADDASYS.SOURCE]ADDA_DATA_SHR.INC'
0161    C
0162    C **  INITIALIZE COUNTERS USED BY PROGRAM
0163    C
0164    	II = 0
0165    	JJ = 0
0166    	KK = 0
0167    C
0168    C **  GET THE DEVICE NUMBER USED BY THE PROGRAM TO POINT TO PROPER ARRAY.
0169    C
0170    	CALL LIB$GET_FOREIGN(AD_IN,'String: ',LEN_AD)
0171    	CALL STR$TRIM(AD_IN, AD_IN(1:LEN_AD), LEN_AD)
0172    C
0173    C **  CONVERT DEVICE NUMBER TO INTEGER.
0174    C
0175    	DECODE(LEN_AD,750,AD_IN) MYDEV
0176    750	FORMAT(I<LEN_AD>)
0177    C
0178    C **  OPEN THE INPUT FILE FOR LOADING THE DATABASE.
0179    C
0180    	OPEN( UNIT=8, FILE='ADDA_LOAD_FILE', CARRIAGECONTROL = 'LIST',
0181         &		TYPE='OLD', FORM='FORMATTED')
0182    C
0183    C **  READ FIRST LINE OF CONFIGURATION FILE.
0184    C
0185    	READ(8,50,IOSTAT=ISTAT) LLEN, DLINE
0186    50	FORMAT(Q,A98)
0187    C
0188    	DO WHILE (ISTAT .EQ. 0)
0189    C
0190    C **  CHECK IF FIRST LINE PERTAINS TO CLOCK SPEED.
0191    C
0192    		IF (DLINE(1:3) .EQ. '%RT') THEN
0193    C
0194    C **  DECODE THE CLOCK SPEED STRING TO A REAL NUMBER, STORE IN DATABASE.
0195    C
0196    			DECODE(LLEN,150,DLINE) CLK_RATE
0197    150			FORMAT(4X,F12.2)
0198    C

ADDA_LOADER                                                     20-Nov-1990 18:08:55	VAX FORTRAN V5.4-79                 Page   2
                                                                14-Jul-1988 19:37:22	LIB4:[ADDASYS.SOURCE]ADDA_LOADER.FOR;4      

0199    C **  INCREMENT LINE COUNTER.
0200    C
0201    			KK = KK + 1
0202    C
0203    C **  CHECK IF LINE IS FOR NUMBER OF CHANNELS (A/D AND/OR D/A)
0204    C
0205    		ELSE IF (DLINE(1:3) .EQ. '%AN') THEN
0206    C
0207    C **  DECODE NUMBER(S) OF CHANNEL(S) BEING USED BY DEVICE.
0208    C
0209    			DECODE(LLEN,250,DLINE) AD_NUMBR(MYDEV), DA_NUMBR(MYDEV)
0210    250			FORMAT(4X,I2,6X,I1)
0211    C
0212    C **  INCREMENT LINE COUNTER.
0213    C
0214    			KK = KK + 1
0215    C
0216    C **  CHECK IF LINE IS A CHANNEL DESCRIPTION.
0217    C
0218    		ELSE IF (DLINE(1:3) .EQ. '%AD') THEN
0219    C
0220    C **  INCREMENT CHANNEL COUNTER.
0221    C
0222    			II = II + 1
0223    C
0224    C **  DEFINE LENGTH OF THE DESCRIPTION STRING.
0225    C
0226    			LDSCR = LLEN - 24
0227    			IF (LDSCR .LE. 0) LDSCR = 1
0228    C
0229    C **  DECODE CHANNEL DESCRIPTION STRING INTO ELEMENTS.
0230    C
0231    			DECODE(LLEN,350,DLINE)  AD_CHNL(MYDEV,II).CHAN_NUM, AD_CHNL(MYDEV,II).CHAN_GAIN,
0232         &						AD_CHNL(MYDEV,II).CHAN_DSCR
0233    350			FORMAT(4X,I2,6X,I6,6X,A<LDSCR>)
0234    C
0235    C **  INCREMENT COUNTER.
0236    C
0237    			KK = KK + 1
0238    C
0239    C **  CHECK IF D/A CHANNEL DESCRIPTION.
0240    C
0241    		ELSE IF (DLINE(1:3) .EQ. '%DA') THEN
0242    C
0243    C **  INCREMENT CHANNEL COUNTER.
0244    C
0245    			JJ = JJ + 1
0246    			LDSCR = LLEN - 26
0247    C
0248    C **  DEFINE LENGTH OF DESCRIPTION STRING.
0249    C
0250    			IF (LDSCR .LE. 0) LDSCR = 1
0251    C
0252    C **  DECODE D/A DESCRIPTION ELEMENTS
0253    C
0254    			DECODE(LLEN,450,DLINE)  DA_CHNL(MYDEV,JJ).CHAN_NUM,  DA_CHNL(MYDEV,JJ).CHAN_DEVICE,
0255         &						DA_CHNL(MYDEV,JJ).CHAN_FROM, DA_CHNL(MYDEV,JJ).CHAN_DSCR

ADDA_LOADER                                                     20-Nov-1990 18:08:55	VAX FORTRAN V5.4-79                 Page   3
                                                                14-Jul-1988 19:37:22	LIB4:[ADDASYS.SOURCE]ADDA_LOADER.FOR;4      

0256    450			FORMAT(4X,I2,6X,I1,6X,I2,6X,A<LDSCR>)
0257    C
0258    C **  INCREMENT COUNTER.
0259    C
0260    			KK = KK + 1
0261    C
0262    		ENDIF
0263    C
0264    C **  READ NEXT CONFIGURATION RECORD LINE.
0265    C
0266    		READ(8,50,IOSTAT=ISTAT) LLEN, DLINE
0267    C
0268    	ENDDO
0269    C
0270    C **  TELL USER THAT NO CONFIGURATION WAS LOAD.
0271    C
0272    	IF (KK .LE. 0) THEN
0273    		WRITE(6,5000)
0274    5000		FORMAT ('   NO DATA WAS LOADED INTO THE SHARED COMMON DATABASE.')
0275    	ELSE
0276    C
0277    C **  TELL USER THAT DATA WAS LOADED INTO DATABASE.
0278    C
0279    		WRITE(6,5150)
0280    5150		FORMAT ('   DATA HAS BEEN LOADED INTO THE SHARED COMMON DATABASE.')
0281    	ENDIF
0282    C
0283    C **  CLOSE THE CONFIGURATION INPUT FILE.
0284    C
0285    	CLOSE(8)
0286    C
0287    	END

ADDA_LOADER                                                     20-Nov-1990 18:08:55	VAX FORTRAN V5.4-79                 Page   4
01                                                              14-Jul-1988 19:37:22	LIB4:[ADDASYS.SOURCE]ADDA_LOADER.FOR;4      

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  679   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                 216   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                                 344   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG
  3 ADDA_DATA                            17352   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG
  4 ADDA_STORE                            8656   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG
  5 ADDA_PNTRS                              24   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG
  6 ADDA_LOGIC                              20   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG
  7 ADDA_NMBR                             2924   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                30215


ENTRY POINTS

    Address  Type  Name          

  0-00000000       ADDA_LOADER   


VARIABLES

    Address  Type  Name              Address  Type  Name              Address  Type  Name              Address  Type  Name          

  5-00000008  I*4  AD1_PNTR        5-00000014  I*4  AD2_PNTR        4-000010E0  I*4  AD8_PNTR        4-000021C8  I*4  AD9_PNTR      
  2-00000063  CHAR AD_IN           7-00000000  R*4  CLK_RATE        6-00000010  L*4  CLK_READY       5-00000004  I*4  CUR_PNTR1     
  5-00000010  I*4  CUR_PNTR2       7-00000018  I*4  CUR_TIME        2-00000000  CHAR DLINE               **      I*4  II            
      **      I*4  ISTAT               **      I*4  JJ                  **      I*4  KK              2-000000D4  I*4  LDSCR         
  2-000000C8  I*4  LEN_AD          2-000000D0  I*4  LLEN            2-000000CC  I*4  MYDEV           7-00000014  I*4  NEWOPT        
  5-00000000  I*4  PRV_PNTR1       5-0000000C  I*4  PRV_PNTR2       6-00000000  L*4  START_STOP1     6-00000008  L*4  START_STOP2   
      **      I*4  SYS$BINTIM          **      I*4  SYS$SETIMR      6-00000004  L*4  USE_LOGICAL1    6-0000000C  L*4  USE_LOGICAL2  
  4-000010E4  L*4  USE_LOGICAL8    4-000021CC  L*4  USE_LOGICAL9  


ARRAYS

    Address  Type  Name                Bytes  Dimensions

  3-00001E00  I*2  AD1_BUFFER             32  (16)
  3-00000000  I*2  AD1_DATA1            3840  (120, 16)
  3-00000F00  I*2  AD1_DATA2            3840  (120, 16)
  3-00001E24  I*4  AD1_TIME1             480  (120)
  3-00002004  I*4  AD1_TIME2             480  (120)
  3-00003FE4  I*2  AD2_BUFFER             32  (16)
  3-000021E4  I*2  AD2_DATA1            3840  (120, 16)
  3-000030E4  I*2  AD2_DATA2            3840  (120, 16)
  3-00004008  I*4  AD2_TIME1             480  (120)
  3-000041E8  I*4  AD2_TIME2             480  (120)
  4-00000000  I*2  AD8_DATA1            3840  (120, 16)
  4-00000F00  I*4  AD8_TIME1             480  (120)
  4-000010E8  I*2  AD9_DATA1            3840  (120, 16)
  4-00001FE8  I*4  AD9_TIME1             480  (120)
  7-00000004  I*4  AD_NUMBR                8  (2)
  3-00001E20  I*2  DA1_BUFFER              4  (2)

ADDA_LOADER                                                     20-Nov-1990 18:08:55	VAX FORTRAN V5.4-79                 Page   5
01                                                              14-Jul-1988 19:37:22	LIB4:[ADDASYS.SOURCE]ADDA_LOADER.FOR;4      

  3-00004004  I*2  DA2_BUFFER              4  (2)
  7-0000000C  I*4  DA_NUMBR                8  (2)


RECORD ARRAYS

    Address   Name          Structure           Bytes  Dimensions

  7-0000001C  AD_CHNL       AD_LIST              2560  (2, 16)
  7-00000A1C  DA_CHNL       DA_LIST               336  (2, 2)


LABELS

    Address   Label       Address   Label       Address   Label       Address   Label       Address   Label       Address   Label   

  1-0000001F  50'       1-00000023  150'      1-00000029  250'      1-00000032  350'      1-00000043  450'      1-00000018  750'    
  1-00000058  5000'     1-00000091  5150'   


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                              Type  Name                              Type  Name                            

        FOR$CLOSE                               FOR$OPEN                                LIB$GET_FOREIGN                 
        STR$TRIM                        


COMMAND QUALIFIERS

  FOR/LIS/EXTEND ADDA_LOADER

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(NOSYMBOLS,TRACEBACK)
  /DESIGN=(NOCOMMENTS,NOPLACEHOLDERS)
  /SHOW=(NODICTIONARY,NOINCLUDE,MAP,NOPREPROCESSOR,SINGLE)
  /STANDARD=(NOSEMANTIC,NOSOURCE_FORM,NOSYNTAX)
  /WARNINGS=(NODECLARATIONS,GENERAL,NOULTRIX,NOVAXELN)
  /CONTINUATIONS=19  /NOCROSS_REFERENCE  /NOD_LINES  /EXTEND_SOURCE
  /F77  /NOG_FLOATING  /I4  /NOMACHINE_CODE  /OPTIMIZE  /NOPARALLEL
  /NOANALYSIS_DATA
  /NODIAGNOSTICS
  /LIST=LIB4:[ADDASYS.SOURCE]ADDA_LOADER.LIS;22                                                             
  /OBJECT=LIB4:[ADDASYS.SOURCE]ADDA_LOADER.OBJ;1                                                              


COMPILATION STATISTICS

  Run Time:           3.68 seconds
  Elapsed Time:       5.29 seconds
  Page Faults:        833
  Dynamic Memory:     548 pages
