20-Nov-1990 18:07:34 VAX FORTRAN V5.4-79 Page 1 11-Apr-1989 16:09:59 LIB4:[ADDASYS.SOURCE]ADDA_ASYNCH.FOR;6 0001 SUBROUTINE AX_AST( status, device_ID, buff, buff_len, data_len, 0002 & buffer_ix, dev_spec) 0003 C 0004 C ************************************************************************** 0005 C ** PROGRAM AUTHOR: WILLIAM BAKER 0006 C 0007 C ** PROGRAM DESCRIPTION: CONTINUES GATHERING DATA FOR AXA0: DEVICE 0008 C ** MOVES DATA TO STORAGE BUFFER FOR FILING. 0009 C 0010 C ** AX_AST 0011 C ----------- 0012 C 0013 C dummy parameter declarations 0014 C They are similar to the parameters in the LIO$DEQUEUE call. 0015 C 0016 INTEGER status !status of the I/O operation 0017 INTEGER device_ID !ID of device that finished the buffer 0018 INTEGER*2 buff(*) !the buffer (NOT its address as in LIO$DEQUEUE) 0019 INTEGER buff_len !length of the buffer (in bytes) 0020 INTEGER data_len !length of the data in the buffer (in bytes) 0021 INTEGER buffer_ix !buffer index (if any supplied in LIO$ENQUEUE) 0022 INTEGER dev_spec !device specific parameter (not used by AXV) 0023 C 0024 INCLUDE 'SYS$SHARE:LIOSET.FOR' 0713 C 0714 C ** INCLUDE THE DATABASE SHAREABLE DECLARATIONS 0715 C 0716 INCLUDE 'LIB4:[ADDASYS.SOURCE]ADDA_DATA_SHR.INC' 0858 C 0859 C ** INCLUDE DECLARATIONS FOR MAPPING OF DATA 0860 C 0861 INCLUDE 'LIB4:[ADDASYS.SOURCE]ADDA_DATA_MAP.INC' 0905 C 0906 C ** 0907 C 0908 C AST routine that processes buffers as they are finished by the AXV 0909 C 0910 C Process each buffer as it finishes and requeue it. 0911 C 0912 C ** 0913 C 0914 C ** CHECK WHICH DEVICE THIS AST IS FOR. 0915 C 0916 IF (IDV .EQ. 1) THEN 0917 C 0918 C ** ADVANCE POINTER FOR THIS DEVICE 0919 C 0920 AD1_PNTR = AD1_PNTR + 1 0921 C 0922 C ** POINT TO PROPER ARRAY, CHECK ARRAY POINTER. 0923 C 0924 IF (CUR_PNTR1 .EQ. 1) THEN 0925 C 0926 C ** MOVE DATA INTO ARRAY ELEMENTS IN DATABASE 0927 C 0928 DO KK = 1,AD_NMBR 0929 II = AD_CHAN(KK) + 1 AX_AST 20-Nov-1990 18:07:34 VAX FORTRAN V5.4-79 Page 2 11-Apr-1989 16:09:59 LIB4:[ADDASYS.SOURCE]ADDA_ASYNCH.FOR;6 0930 AD1_DATA1(AD1_PNTR,II) = BUFF(KK) 0931 ENDDO 0932 ELSE 0933 C 0934 C ** IF OTHER ARRAY POINTER THEN MOVE DATA INTO ALTERNATE ARRAY. 0935 C 0936 DO KK = 1,AD_NMBR 0937 II = AD_CHAN(KK) + 1 0938 AD1_DATA2(AD1_PNTR,II) = BUFF(KK) 0939 ENDDO 0940 ENDIF 0941 C 0942 C ** GET CURRENT TIME AND MOVE INTO PROPER TIMER ARRAY. 0943 C 0944 CALL ADDA_TIMER( IDV, CUR_PNTR1, AD1_PNTR ) 0945 C 0946 C ** IF CURRENT ARRAY IF FULL THEN LETS RESET ARRAY POINTER. 0947 C 0948 IF (AD1_PNTR .EQ. 120) THEN 0949 PRV_PNTR1 = CUR_PNTR1 0950 IF (CUR_PNTR1 .EQ. 1) THEN 0951 CUR_PNTR1 = 2 0952 ELSE 0953 CUR_PNTR1 = 1 0954 ENDIF 0955 C 0956 C ** RESET ELEMENT POINTER TO ZERO. 0957 C 0958 AD1_PNTR = 0 0959 C 0960 C ** TELL THE FILER TO FILE THE DATA TO THE DATAFILE. 0961 C 0962 IF (LOG_DATA_OK) CALL FILE_DATA( DEVICE, IDV, PRV_PNTR1, IDV ) 0963 ENDIF 0964 C 0965 C ** CHECK IF THE FLAG TO STOP THE GATHERING OF DATA HAS BEEN SET. 0966 C 0967 IF (.NOT. START_STOP1) THEN 0968 C 0969 C ** ENQUEUE ANOTHER REQUEST FOR DATA TO THE DEVICE. 0970 C 0971 STATUS = LIO$ENQUEUE( DEVICE_ID, BUFF, BUFF_LEN, , AD_EFN, ,DEV_SPEC ) 0972 IF(.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS)) 0973 ENDIF 0974 C 0975 C ** NOW CHECK IF IT WAS THE OTHER DEVICE. 0976 C 0977 ELSE IF (IDV .EQ. 2) THEN 0978 C 0979 C ** INCREMENT THE ELEMENT POINTER FOR THE SECOND DEVICE ARRAY. 0980 C 0981 AD2_PNTR = AD2_PNTR + 1 0982 C 0983 C ** CHECK WHICH ARRAY WE ARE USING THIS PASS. 0984 C 0985 IF (CUR_PNTR2 .EQ. 1) THEN 0986 C AX_AST 20-Nov-1990 18:07:34 VAX FORTRAN V5.4-79 Page 3 11-Apr-1989 16:09:59 LIB4:[ADDASYS.SOURCE]ADDA_ASYNCH.FOR;6 0987 C ** MOVE DATA INTO THE SECOND DEVICE DATA ARRAY. 0988 C 0989 DO KK = 1,AD_NMBR 0990 II = AD_CHAN(KK) + 1 0991 AD2_DATA1(AD2_PNTR,II) = BUFF(KK) 0992 ENDDO 0993 ELSE 0994 C 0995 C ** IF ALTERNATE DATA ARRAY, THEN MOVE DATA INTO IT. 0996 C 0997 DO KK = 1,AD_NMBR 0998 II = AD_CHAN(KK) + 1 0999 AD2_DATA2(AD2_PNTR,II) = BUFF(KK) 1000 ENDDO 1001 ENDIF 1002 C 1003 C ** GET CURRENT TIME AND MOVE INTO TIMER ARRAY. 1004 C 1005 CALL ADDA_TIMER( IDV, CUR_PNTR2, AD2_PNTR ) 1006 C 1007 C ** IF DATA ARRAY IS FULL, THEN SWITCH TO THE OTHER ARRAY. 1008 C 1009 IF (AD2_PNTR .EQ. 120) THEN 1010 PRV_PNTR2 = CUR_PNTR2 1011 IF (CUR_PNTR2 .EQ. 1) THEN 1012 CUR_PNTR2 = 2 1013 ELSE 1014 CUR_PNTR2 = 1 1015 ENDIF 1016 C 1017 C ** RESET THE ELEMENT POINTER FOR THE ALTERNATE ARRAY. 1018 C 1019 AD2_PNTR = 0 1020 C 1021 C ** TELL THE FILER TO MOVE DATA TO DATA FILE. 1022 C 1023 IF (LOG_DATA_OK) CALL FILE_DATA( DEVICE, IDV, PRV_PNTR2, IDV ) 1024 ENDIF 1025 C 1026 C ** CHECK IF STILL NEED TO GATHER THE DATA FOR THIS DEVICE. 1027 C 1028 IF (.NOT. START_STOP2) THEN 1029 C 1030 C ** IF WE STILL ARE RUNNING THEN ENQUEUE ANOTHER REQUEST FOR DATA. 1031 C 1032 STATUS = LIO$ENQUEUE( DEVICE_ID, BUFF, BUFF_LEN, , AD_EFN, ,DEV_SPEC ) 1033 IF(.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS)) 1034 ENDIF 1035 C 1036 ENDIF 1037 C 1038 C ** END OF SUBROUTINE. 1039 C 1040 RETURN 1041 END AX_AST 20-Nov-1990 18:07:34 VAX FORTRAN V5.4-79 Page 4 01 11-Apr-1989 16:09:59 LIB4:[ADDASYS.SOURCE]ADDA_ASYNCH.FOR;6 PROGRAM SECTIONS Name Bytes Attributes 0 $CODE 629 PIC CON REL LCL SHR EXE RD NOWRT LONG 2 $LOCAL 212 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 8 ADDA_MAP 228 PIC OVR REL GBL SHR NOEXE RD WRT LONG Total Space Allocated 30045 ENTRY POINTS Address Type Name 0-00000000 AX_AST 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 8-000000B4 I*4 AD_EFN 8-000000A4 I*4 AD_ID 8-00000040 I*4 AD_NMBR 8-000000A0 L*4 AD_STRT AP-00000018@ I*4 BUFFER_IX AP-00000010@ I*4 BUFF_LEN 8-000000A8 I*4 CLK_ID 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 AP-00000014@ I*4 DATA_LEN 8-000000E0 I*4 DA_EFN 8-0000004C I*4 DA_NMBR 8-000000B0 CHAR DEVICE AP-00000008@ I*4 DEVICE_ID AP-0000001C@ I*4 DEV_SPEC 8-000000AC I*4 IDV 2-00000010 I*4 II 2-00000008 I*4 KK 8-000000DC L*4 LOG_DATA_OK 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 AP-00000004@ I*4 STATUS 2-00000004 I*4 SYS$BINTIM 2-00000000 I*4 SYS$SETIMR 8-000000B8 L*4 USE_CLOCK 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) AX_AST 20-Nov-1990 18:07:34 VAX FORTRAN V5.4-79 Page 5 01 11-Apr-1989 16:09:59 LIB4:[ADDASYS.SOURCE]ADDA_ASYNCH.FOR;6 8-000000BC I*2 AD_BUFFER 32 (16) 8-00000000 I*4 AD_CHAN 64 (16) 8-00000050 I*4 AD_GAIN 64 (16) 7-00000004 I*4 AD_NUMBR 8 (2) AP-0000000C@ I*2 BUFF ** (*) 3-00001E20 I*2 DA1_BUFFER 4 (2) 3-00004004 I*2 DA2_BUFFER 4 (2) 8-00000044 I*4 DA_CHAN 8 (2) 8-00000098 I*4 DA_DEV 8 (2) 8-00000090 I*4 DA_FRM 8 (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) FUNCTIONS AND SUBROUTINES REFERENCED Type Name Type Name Type Name Type Name ADDA_TIMER FILE_DATA LIB$SIGNAL I*4 LIO$ENQUEUE COMMAND QUALIFIERS FOR/LIS/NOOPT/EXTEND ADDA_ASYNCH /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 /NOOPTIMIZE /NOPARALLEL /NOANALYSIS_DATA /NODIAGNOSTICS /LIST=LIB4:[ADDASYS.SOURCE]ADDA_ASYNCH.LIS;23 /OBJECT=LIB4:[ADDASYS.SOURCE]ADDA_ASYNCH.OBJ;1 COMPILATION STATISTICS Run Time: 6.85 seconds Elapsed Time: 8.33 seconds Page Faults: 791 Dynamic Memory: 604 pages