
                                                                20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   1
                                                                12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

0001    	PROGRAM    ADDA_TAB
0002    C
0003    C **************************************************************************
0004    C **  PROGRAM AUTHOR:       WILLIAM BAKER
0005    C 
0006    C **  PROGRAM DESCRIPTION:  PROGRAM TO DISPLAY THE VOLTAGES BEING READ
0007    C **                        FROM A DEVICES CHANNELS TO THE SCREEN.
0008    C
0009    C **  ADDA_TAB
0010    C     -----------------------
0011    C
0012    C **  DECLARE LOCAL VARIABLES NEEDED BY PROGRAM
0013    C
0014    	LOGICAL*1	ESC				! ESCAPE USED FOR VT.
0015    	INTEGER*2	AD_DATA(16)			! INTEGER VOLTAGE
0016    	REAL*4		CAD_DATA(16)			! +/- 10V REAL ARRAY
0017    	CHARACTER	AD_IN*4, DAT_FILE*64		! DEVICE NUMBER, DATA FILE
0018    	INTEGER*4	MYCURTIME, MYPRVTIME		! TIME VARIABLES
0019    C
0020    	INTEGER*4	TT_CHAN, SYS$ASSIGN		! AST VARIABLES
0021    	LOGICAL		NOMORETAB			! CONTROL LOGICAL
0022    C
0023    C **  DEFINE THE COMMON USED TO CONTROL THE USE OF <CTRL>C FOR ABORTING
0024    C **  OR STOPPING THE PROGRAM.
0025    C
0026    	COMMON	/TRAP_CTRLC/		TT_CHAN, NOMORETAB
0027    C
0028    C **  INCLUDE THE DATA DICTIONARY FOR STORAGE/RETRIEVAL OF DATA
0029    C
0030    	INCLUDE 'LIB4:[ADDASYS.SOURCE]ADDA_DATA_SHR.INC'
0172    C
0173    C **  SET PROGRAM CONTROL TO FALSE.
0174    C
0175    	NOMORETAB = .FALSE.
0176    C
0177    C **  GET CHANNEL TO CRT FOR CONTROL OF ^C
0178    C
0179    	ISTAT=SYS$ASSIGN('TT',TT_CHAN,,)
0180    	IF (.NOT. ISTAT) CALL LIB$SIGNAL( %VAL(ISTAT))
0181    C
0182    C **  ENABLE THE AST ROUTINE
0183    C
0184    	CALL ENABLE_CTRLC
0185    C
0186    C **  GET THE DEVICE TO BE READ.
0187    C
0188    	CALL LIB$GET_FOREIGN(AD_IN,'Device 1 or 2?  ',LEN_AD)
0189    	CALL STR$TRIM(AD_IN, AD_IN(1:LEN_AD), LEN_AD)
0190    C
0191    C **  DECODE DEVICE NUMBER.
0192    C
0193    	DECODE(LEN_AD,250,AD_IN) IDEV
0194    250	FORMAT(I<LEN_AD>)
0195    C
0196    C **  CHECK IF DEVICE NUMBER IS FOR A FILE.
0197    C
0198    	IF (IDEV .GE. 8) THEN

ADDA_TAB                                                        20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   2
                                                                12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

0199    C
0200    C **  INQUIRE FOR FILE NAME TO USE.
0201    C
0202    5250		WRITE(6,5500) IDEV
0203    		READ(5,5750,END=5250) INQ, DAT_FILE
0204    5500	FORMAT(1X,'Enter file name:  ',$)
0205    5750	FORMAT(Q,A<INQ>)
0206    C
0207    C **  BRANCH BACK FOR READ.
0208    C
0209    		IF (INQ .EQ. 0) GOTO 5250
0210    C
0211    C **  OPEN THE FILE.
0212    C
0213    		CALL AD_OPEN_FILE( IDEV, DAT_FILE )
0214    		IF (IDEV .LT. 0) THEN
0215    C
0216    C **  CLOSE FILE, ERROR CONDITION ON OPEN
0217    C
0218    			CALL AD_CLOSE_FILE( -IDEV )
0219    			GOTO 9000
0220    		ENDIF
0221    	ENDIF
0222    C
0223    C **  SET ESCAPE VARIABLE TO VALUE = 27
0224    C
0225    	ESC = 27
0226    C
0227    C **  DISPLAY WHICH DEVICE TABULATION IS FOR, AND CREATE SCROLLING REGINE.
0228    C
0229    	IF ((IDEV .EQ. 1) .OR. (IDEV .EQ. 8)) THEN
0230    		WRITE(6,50) ESC, ESC, ESC
0231    50		FORMAT(1X,A1,'[3;24r',A1,'[1;1H',A1,'[J           CHANNEL OUTPUT FOR AXA0:')
0232    	ELSE IF ((IDEV .EQ. 2) .OR. (IDEV .EQ. 9)) THEN
0233    		WRITE(6,150) ESC, ESC, ESC
0234    150		FORMAT(1X,A1,'[3;24r',A1,'[1;1H',A1,'[J           CHANNEL OUTPUT FOR AXB0:')
0235    	ENDIF
0236    C
0237    C **  WRITE OUT TOP DISPLAY.
0238    C
0239    	WRITE(6,100) (I,I=1,16)
0240    100	FORMAT('  TIME:    ', 16(3X,'CH',I2))
0241    C
0242    C **  INITIALIZE THE PREVIOUS FLAG VARIABLE TO ZERO
0243    C
0244    	MYPRVTIME = 0
0245    C
0246    C **  IF DEVICE IS REAL-TIME THEN ASSOCIATE THE EVENT FLAG CLUSTER.
0247    C
0248    	IF (IDEV .LT. 5) CALL ASOC_EF
0249    C
0250    C **  POP THE FIRST BUFFER OFF THE STACK OF DATA.
0251    C
0252    	CALL POPAD( IDEV, AD_DATA, MYCURTIME)
0253    C
0254    C **  TRANSLATE THE INTEGER VOLTAGE TO A REAL VOLTAGE.
0255    C

ADDA_TAB                                                        20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   3
                                                                12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

0256    	ISTAT = LSP$FORMAT_TRANSLATE_ADC( AD_DATA, CAD_DATA, 16 )
0257    C
0258    C **  DISPLAY TIME AND REAL VOLTAGES.
0259    C
0260    	WRITE(6,500) MYCURTIME, (CAD_DATA(II), II=1,16)
0261    500	FORMAT(1X,I7,16(2X,F5.1))
0262    C
0263    C **  UPDATE THE PREVIOUS TIME VARIABLE.
0264    C
0265    	MYPRVTIME = MYCURTIME
0266    C
0267    C **  LOOP WHILE TIMES ARE EQUAL, NOT END OF TABULATING.
0268    C
0269    	DO WHILE ((MYCURTIME .EQ. MYPRVTIME) .AND. (.NOT. NOMORETAB))
0270    C
0271    C **  WAIT FOR NEXT EVENT FLAG IF REAL-TIME.
0272    C
0273    		IF (IDEV .LT. 5) CALL WAITFLAG( IDEV )
0274    C
0275    C **  GET NEXT DATA BUFFER ELEMENT.
0276    C
0277    		CALL POPAD( IDEV, AD_DATA, MYCURTIME )
0278    C
0279    C **  TRANSLATE INTEGER VOLTAGE TO REAL VOLTAGE.
0280    C
0281    		ISTAT = LSP$FORMAT_TRANSLATE_ADC( AD_DATA, CAD_DATA, 16 )
0282    C
0283    C **  IF TIME NOT THE SAME, THEN DISPLAY THE DATA.
0284    C
0285    		IF (MYCURTIME .GT. MYPRVTIME) THEN
0286    			WRITE(6,500) MYCURTIME, (CAD_DATA(II), II=1,16)
0287    		ENDIF
0288    C
0289    C **  SET TIME THE SAME.
0290    C
0291    		MYPRVTIME = MYCURTIME
0292    C
0293    	ENDDO
0294    C
0295    C **  DISASSOCIATE FROM EVENT FLAG CLUSTER IF REAL-TIME.
0296    C
0297    	IF (IDEV .LT. 5) THEN
0298    		CALL DASOC_EF
0299    	ELSE
0300    C
0301    C **  OR CLOSE THE FILE, OTHERWISE.
0302    C
0303    		CALL AD_CLOSE_FILE( IDEV )
0304    	ENDIF
0305    C
0306    C **  END OF PROGRAM
0307    C
0308    9000	CONTINUE
0309    C
0310    	END

ADDA_TAB                                                        20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   4
01                                                              12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

PROGRAM SECTIONS

    Name				 Bytes   Attributes

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

    Total Space Allocated                30264


ENTRY POINTS

    Address  Type  Name          

  0-00000000       ADDA_TAB      


VARIABLES

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

  6-00000008  I*4  AD1_PNTR        6-00000014  I*4  AD2_PNTR        5-000010E0  I*4  AD8_PNTR        5-000021C8  I*4  AD9_PNTR      
  2-00000060  CHAR AD_IN           8-00000000  R*4  CLK_RATE        7-00000010  L*4  CLK_READY       6-00000004  I*4  CUR_PNTR1     
  6-00000010  I*4  CUR_PNTR2       8-00000018  I*4  CUR_TIME        2-00000064  CHAR DAT_FILE            **      L*1  ESC           
      **      I*4  I               2-000000AC  I*4  IDEV                **      I*4  II              2-000000B0  I*4  INQ           
      **      I*4  ISTAT           2-000000A8  I*4  LEN_AD          2-000000A4  I*4  MYCURTIME           **      I*4  MYPRVTIME     
  8-00000014  I*4  NEWOPT          3-00000004  L*4  NOMORETAB       6-00000000  I*4  PRV_PNTR1       6-0000000C  I*4  PRV_PNTR2     
  7-00000000  L*4  START_STOP1     7-00000008  L*4  START_STOP2         **      I*4  SYS$BINTIM          **      I*4  SYS$SETIMR    
  3-00000000  I*4  TT_CHAN         7-00000004  L*4  USE_LOGICAL1    7-0000000C  L*4  USE_LOGICAL2    5-000010E4  L*4  USE_LOGICAL8  
  5-000021CC  L*4  USE_LOGICAL9  


ARRAYS

    Address  Type  Name                Bytes  Dimensions

  4-00001E00  I*2  AD1_BUFFER             32  (16)
  4-00000000  I*2  AD1_DATA1            3840  (120, 16)
  4-00000F00  I*2  AD1_DATA2            3840  (120, 16)
  4-00001E24  I*4  AD1_TIME1             480  (120)
  4-00002004  I*4  AD1_TIME2             480  (120)
  4-00003FE4  I*2  AD2_BUFFER             32  (16)
  4-000021E4  I*2  AD2_DATA1            3840  (120, 16)
  4-000030E4  I*2  AD2_DATA2            3840  (120, 16)
  4-00004008  I*4  AD2_TIME1             480  (120)
  4-000041E8  I*4  AD2_TIME2             480  (120)
  5-00000000  I*2  AD8_DATA1            3840  (120, 16)
  5-00000F00  I*4  AD8_TIME1             480  (120)
  5-000010E8  I*2  AD9_DATA1            3840  (120, 16)
  5-00001FE8  I*4  AD9_TIME1             480  (120)

ADDA_TAB                                                        20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   5
01                                                              12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

  2-00000040  I*2  AD_DATA                32  (16)
  8-00000004  I*4  AD_NUMBR                8  (2)
  2-00000000  R*4  CAD_DATA               64  (16)
  4-00001E20  I*2  DA1_BUFFER              4  (2)
  4-00004004  I*2  DA2_BUFFER              4  (2)
  8-0000000C  I*4  DA_NUMBR                8  (2)


RECORD ARRAYS

    Address   Name          Structure           Bytes  Dimensions

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


LABELS

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

  1-0000003F  50'       1-000000BD  100'      1-0000007E  150'      1-00000018  250'      1-000000D8  500'          **      5250    
  1-0000001F  5500'     1-00000037  5750'     0-00000275  9000    


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                              Type  Name                              Type  Name                            

        AD_CLOSE_FILE                           AD_OPEN_FILE                            ASOC_EF                         
        DASOC_EF                                ENABLE_CTRLC                            LIB$GET_FOREIGN                 
        LIB$SIGNAL                         I*4  LSP$FORMAT_TRANSLATE_ADC                POPAD                           
        STR$TRIM                           I*4  SYS$ASSIGN                              WAITFLAG                        

                                                                20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   6
                                                                12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

0002    	SUBROUTINE	ENABLE_CTRLC
0003    C
0004    C **************************************************************************
0005    C **  PROGRAM AUTHOR:       WILLIAM BAKER
0006    C 
0007    C **  PROGRAM DESCRIPTION:  ENABLES AN ASYNCH TRAP FOR CONTROLLING USE
0008    C **                        OF THE ^C FROM THE KEYBOARD
0009    C
0010    C **  ENABLE_CTRLC
0011    C     -----------------------
0012    C
0013    C **  DEFINE THE COMMON USED TO CONTROL THE ^C.
0014    C
0015    	INTEGER*4	TT_CHAN, SYS$QIOW
0016    	LOGICAL		NOMORETAB
0017    	COMMON	/TRAP_CTRLC/		TT_CHAN, NOMORETAB
0018    C
0019    C **  INCLUDE PARAMETERS FOR CONTROLLING THE I/O.
0020    C
0021    	INCLUDE	'($IODEF)'
0683    C
0684    C **  DECLARE THE ^C INTERUPT AS EXTERNAL.
0685    C
0686    	EXTERNAL	CTRLC_ROUT
0687    C
0688    C **  QUEUE AN INTERUPT WAITING FOR A ^C TO BE TYPED.
0689    C
0690    	ISTAT=SYS$QIOW( ,%VAL(TT_CHAN), 
0691    	1	%VAL(IO$_SETMODE .OR. IO$M_CTRLCAST),
0692    	1	,,,CTRLC_ROUT,,%VAL(3),,,)
0693    	IF (.NOT. ISTAT) CALL LIB$SIGNAL( %VAL(ISTAT))
0694    C
0695    C **  RETURN TO MAIN PROGRAM.
0696    C
0697    	RETURN
0698    	END

ENABLE_CTRLC                                                    20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   7
01                                                              12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                   40   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  2 $LOCAL                                  60   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG
  3 TRAP_CTRLC                               8   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                  108


ENTRY POINTS

    Address  Type  Name          

  0-00000000       ENABLE_CTRLC  


VARIABLES

    Address  Type  Name              Address  Type  Name              Address  Type  Name          

      **      I*4  ISTAT           3-00000004  L*4  NOMORETAB       3-00000000  I*4  TT_CHAN       


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name            Type  Name            Type  Name          

        CTRLC_ROUT            LIB$SIGNAL       I*4  SYS$QIOW      

                                                                20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   8
                                                                12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

0002    	SUBROUTINE	CTRLC_ROUT
0003    C
0004    C **************************************************************************
0005    C **  PROGRAM AUTHOR:       WILLIAM BAKER
0006    C 
0007    C **  PROGRAM DESCRIPTION:  ROUTINE REACTS WHEN A ^C IS TYPE AT KEYBOARD.
0008    C
0009    C **  ADDA_SHR.FOR DICTIONARY
0010    C     -----------------------
0011    C
0012    C **  DECLARE LOCAL VARIABLES NEEDED BY SUBROUTINE.
0013    C **  DECLARE THE COMMON USED TO CONTROL THE USE OF ^C.
0014    	INTEGER*4	TT_CHAN, SYS$QIOW
0015    	LOGICAL		NOMORETAB
0016    	COMMON	/TRAP_CTRLC/		TT_CHAN, NOMORETAB
0017    C
0018    C **  SET CONTROLLING LOGICAL TO TRUE.
0019    C
0020    	NOMORETAB = .TRUE.
0021    C
0022    C **  RETURN TO MAIN PROGRAM.
0023    C
0024    	RETURN
0025    	END




PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                   10   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  3 TRAP_CTRLC                               8   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                   18


ENTRY POINTS

    Address  Type  Name          

  0-00000000       CTRLC_ROUT    


VARIABLES

    Address  Type  Name              Address  Type  Name              Address  Type  Name          

  3-00000004  L*4  NOMORETAB           **      I*4  SYS$QIOW        3-00000000  I*4  TT_CHAN       

CTRLC_ROUT                                                      20-Nov-1990 18:10:14	VAX FORTRAN V5.4-79                 Page   9
01                                                              12-Apr-1989 17:10:51	LIB4:[ADDASYS.SOURCE]ADDA_TAB.FOR;10        

COMMAND QUALIFIERS

  FOR/LIS/EXTEND ADDA_TAB

  /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_TAB.LIS;23                                                                
  /OBJECT=LIB4:[ADDASYS.SOURCE]ADDA_TAB.OBJ;1                                                                 


COMPILATION STATISTICS

  Run Time:           8.16 seconds
  Elapsed Time:       10.65 seconds
  Page Faults:        1166
  Dynamic Memory:     796 pages
