20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 1 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0001 OPTIONS/EXTEND 0002 SUBROUTINE ASYNCH_OUT() 0003 C 0004 C ************************************************************************** 0005 C ** PROGRAM AUTHOR: WILLIAM BAKER 0006 C 0007 C ** PROGRAM DESCRIPTION: SENDS DATA OUT THE D/A PORTS. 0008 C ** 0009 C 0010 C ** DA_OUT 0011 C ----------- 0012 C 0013 C ** DECLARE THE VARIABLES NEEDED LOCALLY. 0014 C 0015 INTEGER*4 STATUS, BUFF_LENGTH, DATA_LENGTH 0016 INTEGER*2 BUFF_PTR, D1, D2(2) 0017 C 0018 C ** INCLUDE THE PARAMETERS NEEDED TO PERFORM LIO$ CALLS. 0019 C 0020 INCLUDE 'SYS$SHARE:LIOSET.FOR' 0709 C 0710 C ** INCLUDE DECLARATIONS NEEDED TO LINK TO DATABASE. 0711 C 0712 INCLUDE 'LIB4:[ADDASYS.SOURCE]ADDA_DATA_SHR.INC/LIST' 0713 1 C 0714 1 C ************************************************************************** 0715 1 C ** PROGRAM AUTHOR: WILLIAM BAKER 0716 1 C 0717 1 C ** PROGRAM DESCRIPTION: DEFINES AN AREA OF SHARED COMMON FOR USE BY 0718 1 C ** A/D AND D/A DATA ACQUISITION PROGRAMS. 0719 1 C 0720 1 C ** ADDA_SHR.FOR DICTIONARY 0721 1 C ----------------------- 0722 1 C 0723 1 C ** DEFINE THE STRUCTURE OF THE A/D CHANNEL LIST INFORMATION RECORD. 0724 1 C 0725 1 STRUCTURE /AD_LIST/ 0726 1 UNION 0727 1 MAP 0728 1 INTEGER*4 CHAN_NUM 0729 1 INTEGER*4 CHAN_GAIN 0730 1 CHARACTER*72 CHAN_DSCR 0731 1 END MAP 0732 1 END UNION 0733 1 END STRUCTURE 0734 1 C 0735 1 C ** DEFINE THE STRUCTURE OF THE D/A CHANNEL LIST INFORMATION RECORD. 0736 1 C 0737 1 STRUCTURE /DA_LIST/ 0738 1 UNION 0739 1 MAP 0740 1 INTEGER*4 CHAN_NUM 0741 1 CHARACTER*72 CHAN_DSCR 0742 1 INTEGER*4 CHAN_DEVICE 0743 1 INTEGER*4 CHAN_FROM 0744 1 END MAP 0745 1 END UNION ASYNCH_OUT 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 2 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0746 1 END STRUCTURE 0747 1 C 0748 1 C ** DECLARE THE A/D CHANNEL RECORD ARRAYS. 0749 1 C 0750 1 RECORD /AD_LIST/ AD_CHNL(2,16) 0751 1 C 0752 1 C ** DECLARE THE D/A CHANNEL RECORD ARRAYS. 0753 1 C 0754 1 RECORD /DA_LIST/ DA_CHNL(2,2) 0755 1 C 0756 1 C ** DECLARE PARAMETERS FOR EVENT FLAG STATUS. 0757 1 C 0758 1 PARAMETER SS$_WASCLR = '00000001'X 0759 1 PARAMETER SS$_WASSET = '00000009'X 0760 1 C 0761 1 C ** DELCARE LOGICALS USED FOR DETERMINING STATUS OF ACTIVITY. 0762 1 C 0763 1 LOGICAL START_STOP1, USE_LOGICAL1 0764 1 LOGICAL USE_LOGICAL8 0765 1 LOGICAL USE_LOGICAL9 0766 1 LOGICAL START_STOP2, USE_LOGICAL2, CLK_READY 0767 1 C 0768 1 C ** DECLARE SYSTEM SERVICE INTEGER FUNCTIONS. 0769 1 C 0770 1 INTEGER*4 SYS$CREMBX, SYS$DELMBX, SYS$DASSGN 0771 1 INTEGER*4 SYS$WAITFR, SYS$SETIMR, SYS$BINTIM, SYS$DLCEFC 0772 1 INTEGER*4 SYS$CLREF, SYS$ASCEFC, SYS$DACEFC, SYS$SETEF 0773 1 C 0774 1 C ** DECLARE ARRAYS WHICH CONTAIN COUNTS OF NUMBER OF CHANNELS IN USE. 0775 1 C 0776 1 INTEGER*4 AD_NUMBR(2), DA_NUMBR(2) 0777 1 C 0778 1 C ** DECLARE THE CLOCK RATE FOR THIS TEST. 0779 1 C 0780 1 REAL*4 CLK_RATE 0781 1 C 0782 1 C ** DECLARE THE POINTERS FOR THE ARRAYS ASSOCIATED WITH EACH DEVICE. 0783 1 C 0784 1 INTEGER*4 PRV_PNTR1, CUR_PNTR1, AD1_PNTR 0785 1 INTEGER*4 PRV_PNTR2, CUR_PNTR2, AD2_PNTR 0786 1 INTEGER*4 AD8_PNTR, AD9_PNTR 0787 1 C 0788 1 C ** DECLARE VARIABLE FOR CURRENT TIME ON SYSTEM. 0789 1 C 0790 1 INTEGER*4 CUR_TIME 0791 1 C 0792 1 C ** DECLARE VARIABLE FOR PLACEMENT OF NEW OPERATING INSTRUCTIONS CODE. 0793 1 C 0794 1 INTEGER*4 NEWOPT 0795 1 C 0796 1 C ** STORAGE ARRAYS FOR AXA0 DEVICE. 0797 1 C 0798 1 INTEGER*2 AD1_DATA1(120,16), AD1_DATA2(120,16) 0799 1 INTEGER*4 AD1_TIME1(120), AD1_TIME2(120) 0800 1 C 0801 1 C ** BUFFERS FOR AXA0 I/O 0802 1 C ASYNCH_OUT 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 3 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0803 1 INTEGER*2 AD1_BUFFER(16), DA1_BUFFER(2) 0804 1 C 0805 1 C ** STORAGE ARRAYS FOR AXB0 DEVICE. 0806 1 C 0807 1 INTEGER*2 AD2_DATA1(120,16), AD2_DATA2(120,16) 0808 1 INTEGER*4 AD2_TIME1(120), AD2_TIME2(120) 0809 1 C 0810 1 C ** BUFFERS FOR AXB0 I/O 0811 1 C 0812 1 INTEGER*2 AD2_BUFFER(16), DA2_BUFFER(2) 0813 1 C 0814 1 C ** STORAGE ARRAYS FOR POST TEST DATA ANALYSIS OF DATA. 0815 1 C 0816 1 INTEGER*2 AD8_DATA1(120,16), AD9_DATA1(120,16) 0817 1 INTEGER*4 AD8_TIME1(120), AD9_TIME1(120) 0818 1 C 0819 1 C*************************************************************************** 0820 1 C 0821 1 C ** DECLARES THE SHARED COMMON. 0822 1 C 0823 1 COMMON /ADDA_DATA/ AD1_DATA1, AD1_DATA2, AD1_BUFFER, DA1_BUFFER, 0824 1 & AD1_TIME1, AD1_TIME2, 0825 1 & AD2_DATA1, AD2_DATA2, AD2_BUFFER, DA2_BUFFER, 0826 1 & AD2_TIME1, AD2_TIME2 0827 1 C 0828 1 COMMON /ADDA_STORE/ AD8_DATA1, AD8_TIME1, AD8_PNTR, USE_LOGICAL8, 0829 1 & AD9_DATA1, AD9_TIME1, AD9_PNTR, USE_LOGICAL9 0830 1 C 0831 1 COMMON /ADDA_PNTRS/ PRV_PNTR1, CUR_PNTR1, AD1_PNTR, 0832 1 & PRV_PNTR2, CUR_PNTR2, AD2_PNTR 0833 1 C 0834 1 COMMON /ADDA_LOGIC/ START_STOP1, USE_LOGICAL1, START_STOP2, 0835 1 & USE_LOGICAL2, CLK_READY 0836 1 C 0837 1 COMMON /ADDA_NMBR/ CLK_RATE, AD_NUMBR, DA_NUMBR, NEWOPT, CUR_TIME, 0838 1 & AD_CHNL, DA_CHNL 0839 1 C 0840 1 C************************************************ 0841 1 C 0842 1 C ** DECLARE FOLLOWING ROUTINES AS EXTERNAL TO NORMAL PROGRAM. 0843 1 C 0844 1 EXTERNAL SYS$CREMBX 0845 1 EXTERNAL SYS$DELMBX 0846 1 EXTERNAL SYS$DASSGN 0847 1 EXTERNAL SYS$WAITFR 0848 1 EXTERNAL SYS$SETEF 0849 1 EXTERNAL SYS$DACEFC 0850 1 EXTERNAL SYS$DLCEFC 0851 1 EXTERNAL SYS$ASCEFC 0852 1 EXTERNAL SYS$CLREF 0853 1 C 0854 C 0855 C ** INCLUDE DECLARATIONS FOR MAPPING VARIABLES TO DEVICE 0856 C 0857 INCLUDE 'LIB4:[ADDASYS.SOURCE]ADDA_DATA_MAP.INC/LIST' 0858 1 C ************************************************************************** 0859 1 C ** PROGRAM AUTHOR: WILLIAM BAKER ASYNCH_OUT 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 4 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0860 1 C 0861 1 C ** PROGRAM DESCRIPTION: VARIABLE DECLARATIONS FOR MAPPING OF ARRAYS 0862 1 C ** TO CHANNELS ACTUALLY TO BE USED. 0863 1 C 0864 1 C ** ADDA_MAP.FOR DICTIONARY 0865 1 C ----------------------- 0866 1 C 0867 1 C ** DECLARE THE ARRAY NEEDED TO HOLD DATA. 0868 1 C 0869 1 INTEGER*2 AD_BUFFER(16) 0870 1 C 0871 1 C ** DECLARE THE ARRAYS NEEDED TO HOLD INFORMATION TO MAP CHANNELS TO ARRAYS. 0872 1 C 0873 1 INTEGER*4 AD_CHAN(16), AD_NMBR 0874 1 INTEGER*4 DA_CHAN(2), DA_NMBR 0875 1 C 0876 1 C ** DECLARE ARRAYS USED FOR SETTING THE A/D GAIN, AND WHERE DATA COMES 0877 1 C ** FROM FOR D/A OUTPUT TO THE DEVICE. 0878 1 C 0879 1 INTEGER*4 AD_GAIN(16), DA_FRM(2) 0880 1 INTEGER*4 DA_DEV(2) 0881 1 C 0882 1 C ** DECLARE THE DEVICE ID VARIABLES, DEVICE NUMBER, AND EVENT FLAG. 0883 1 C 0884 1 INTEGER*4 AD_ID, CLK_ID, IDV, AD_EFN, DA_EFN 0885 1 C 0886 1 C ** CHARACTER STRING HOLDING THE DEVICE NAME. 0887 1 C 0888 1 CHARACTER*4 DEVICE 0889 1 C 0890 1 C ** LOGICALS FOR SIGNALLING START OF THE A/D DEVICE, AND START OF CLOCK. 0891 1 C 0892 1 LOGICAL AD_STRT, USE_CLOCK, LOG_DATA_OK 0893 1 C 0894 1 C ** COMMON DECLARATION. 0895 1 C 0896 1 COMMON /ADDA_MAP/ AD_CHAN, AD_NMBR, DA_CHAN, DA_NMBR, 0897 1 & AD_GAIN, DA_FRM, DA_DEV, AD_STRT, 0898 1 & AD_ID, CLK_ID, IDV, DEVICE, AD_EFN, 0899 1 & USE_CLOCK, AD_BUFFER, LOG_DATA_OK, DA_EFN 0900 1 C 0901 C 0902 C 0903 C ** SET INTERNAL CHANNEL ID FOR THE FIRST DATA TO BE MOVED OUT 0904 C ** THE D/A CONVERTER. THIS IS AN ARRAY POINTER. 0905 C 0906 II = DA_CHAN(1) + 1 0907 C 0908 C ** CHECK WHICH DEVICE WE ARE USING. 0909 C 0910 IF (IDV .EQ. 1) THEN 0911 C 0912 C ** SEE WHICH DEVICE DATA IS TO COME FROM, AND POST TO OUTPUT ARRAY. 0913 C 0914 IF ((DA_DEV(1) .EQ. 1) .AND. (II .LE. 2)) THEN 0915 DA1_BUFFER(II) = AD1_BUFFER(DA_FRM(1)) 0916 ELSE IF ((DA_DEV(1) .EQ. 2) .AND. (II .LE. 2)) THEN ASYNCH_OUT 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 5 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0917 DA1_BUFFER(II) = AD2_BUFFER(DA_FRM(1)) 0918 ENDIF 0919 C 0920 C ** IF MORE THAN ONE D/A CONVERTER IS TO BE USED, THEN GET SECOND 0921 C ** SET OF DATA AND POST IT AS WELL. 0922 C 0923 IF (DA_NMBR .GT. 1) THEN 0924 C 0925 C ** SET THE CHANNEL ID ARRAY POINTER. 0926 C 0927 II = DA_CHAN(2) + 1 0928 C 0929 C ** SEE WHICH DEVICE DATA IS TO COME FROM, AND POST TO OUTPUT ARRAY. 0930 C 0931 IF ((DA_DEV(2) .EQ. 1) .AND. (II .LE. 2)) THEN 0932 DA1_BUFFER(II) = AD1_BUFFER(DA_FRM(2)) 0933 ELSE IF ((DA_DEV(2) .EQ. 2) .AND. (II .LE. 2)) THEN 0934 DA1_BUFFER(II) = AD2_BUFFER(DA_FRM(2)) 0935 ENDIF 0936 C 0937 ENDIF 0938 C 0939 ELSE IF (IDV .EQ. 2) THEN 0940 C 0941 C ** NOW REPEAT THE ABOVE LOGIC FOR THE OTHER DEVICE, IF THE PROGRAM 0942 C ** IS RUNNING FOR THAT DEVICE. 0943 C 0944 C ** SEE WHICH DEVICE DATA IS TO COME FROM, AND POST TO OUTPUT ARRAY. 0945 C 0946 IF ((DA_DEV(1) .EQ. 1) .AND. (II .LE. 2)) THEN 0947 DA2_BUFFER(II) = AD1_BUFFER(DA_FRM(1)) 0948 ELSE IF ((DA_DEV(1) .EQ. 2) .AND. (II .LE. 2)) THEN 0949 DA2_BUFFER(II) = AD2_BUFFER(DA_FRM(1)) 0950 ENDIF 0951 C 0952 IF (DA_NMBR .GT. 1) THEN 0953 C 0954 C ** IF SECOND CHANNEL IS BEING USED, GET THE CHANNEL ID POINTER. 0955 C 0956 II = DA_CHAN(2) + 1 0957 C 0958 C ** SEE WHICH DEVICE DATA IS TO COME FROM, AND POST TO OUTPUT ARRAY. 0959 C 0960 IF ((DA_DEV(2) .EQ. 1) .AND. (II .LE. 2)) THEN 0961 DA2_BUFFER(II) = AD1_BUFFER(DA_FRM(2)) 0962 ELSE IF ((DA_DEV(2) .EQ. 2) .AND. (II .LE. 2)) THEN 0963 DA2_BUFFER(II) = AD2_BUFFER(DA_FRM(2)) 0964 ENDIF 0965 C 0966 ENDIF 0967 C 0968 ENDIF 0969 C 0970 C ** DELCARE THE BUFFER LENGTH OF THE ARRAY TO BE SENT TO THE CONVERTER. 0971 C 0972 IBUFFLEN = DA_NMBR * 2 0973 C ASYNCH_OUT 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 6 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0974 IF (DA_NMBR .EQ. 1) THEN 0975 C 0976 C ** CHECK WHICH DEVICE WE ARE USING, CREATE TEMP BUFFER. 0977 C 0978 IF (IDV .EQ. 1) THEN 0979 D1 = DA1_BUFFER(1) 0980 ELSE IF (IDV .EQ. 2) THEN 0981 D1 = DA2_BUFFER(1) 0982 ENDIF 0983 C 0984 C ** SEND ARRAY FOR AXA0 TO ITS D/A CONVERTER. 0985 C 0986 STATUS = LIO$ENQUEUE( AD_ID, D1, IBUFFLEN, IBUFFLEN, DA_EFN, , LIO$K_OUTPUT ) 0987 IF(.NOT.(STATUS)) CALL LIB$SIGNAL(%VAL(STATUS)) 0988 ELSE 0989 C 0990 C ** CHECK WHICH DEVICE WE ARE USING, CREATE TEMP BUFFER. 0991 C 0992 IF (IDV .EQ. 1) THEN 0993 D2(1) = DA1_BUFFER(1) 0994 D2(2) = DA1_BUFFER(2) 0995 ELSE IF (IDV .EQ. 2) THEN 0996 D2(1) = DA2_BUFFER(1) 0997 D2(2) = DA2_BUFFER(2) 0998 ENDIF 0999 C 1000 C ** SEND ARRAY FOR AXA0 TO ITS D/A CONVERTER. 1001 C 1002 STATUS = LIO$ENQUEUE( AD_ID, D2, IBUFFLEN, IBUFFLEN, DA_EFN, , LIO$K_OUTPUT ) 1003 IF(.NOT.(STATUS)) CALL LIB$SIGNAL(%VAL(STATUS)) 1004 ENDIF 1005 C 1006 C ** DEQUEUE THE REQUEST TO THE D/A CONVERTER. 1007 C 1008 STATUS = LIO$DEQUEUE( AD_ID, BUFF_PTR, IBUFFLEN, DATA_LENGTH, 1, , ) 1009 C 1010 C ** RETURN TO MAINIO PROGRAM. 1011 C 1012 RETURN 1013 END ASYNCH_OUT 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 7 01 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 PROGRAM SECTIONS Name Bytes Attributes 0 $CODE 573 PIC CON REL LCL SHR EXE RD NOWRT LONG 1 $PDATA 8 PIC CON REL LCL SHR NOEXE RD NOWRT LONG 2 $LOCAL 148 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 29933 ENTRY POINTS Address Type Name 0-00000000 ASYNCH_OUT 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 2-0000000C I*4 BUFF_LENGTH 2-00000004 I*2 BUFF_PTR 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 2-00000006 I*2 D1 2-00000010 I*4 DATA_LENGTH 8-000000E0 I*4 DA_EFN 8-0000004C I*4 DA_NMBR 8-000000B0 CHAR DEVICE 2-00000020 I*4 IBUFFLEN 8-000000AC I*4 IDV 2-0000001C I*4 II 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 2-00000008 I*4 STATUS 2-00000018 I*4 SYS$BINTIM 2-00000014 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) ASYNCH_OUT 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 8 01 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 4-00001FE8 I*4 AD9_TIME1 480 (120) 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) 2-00000000 I*2 D2 4 (2) 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 LIB$SIGNAL I*4 LIO$DEQUEUE I*4 LIO$ENQUEUE OPTIONS QUALIFIERS /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW) /EXTEND_SOURCE /F77 /NOG_FLOATING /I4 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 9 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0002 OPTIONS/EXTEND 0003 SUBROUTINE ASYNCH_IN( ) 0004 C 0005 C ************************************************************************** 0006 C ** PROGRAM AUTHOR: WILLIAM BAKER 0007 C 0008 C ** PROGRAM DESCRIPTION: CONTINUES GATHERING DATA FOR AXA0: DEVICE 0009 C ** MOVES DATA TO STORAGE BUFFER FOR FILING. 0010 C 0011 C ** AX_AST 0012 C ----------- 0013 C 0014 C dummy parameter declarations 0015 C They are similar to the parameters in the LIO$DEQUEUE call. 0016 C 0017 INTEGER status !status of the I/O operation 0018 C 0019 C ** INCLUDE THE DATABASE SHAREABLE DECLARATIONS 0020 C 0021 INCLUDE 'LIB4:[ADDASYS.SOURCE]ADDA_DATA_SHR.INC' 0163 C 0164 C ** INCLUDE DECLARATIONS FOR MAPPING OF DATA 0165 C 0166 INCLUDE 'LIB4:[ADDASYS.SOURCE]ADDA_DATA_MAP.INC' 0210 C 0211 C ** 0212 C 0213 C AST routine that processes buffers as they are finished by the AXV 0214 C 0215 C Process each buffer as it finishes and requeue it. 0216 C 0217 C ** 0218 C 0219 C ** CHECK WHICH DEVICE THIS AST IS FOR. 0220 C 0221 IF (IDV .EQ. 1) THEN 0222 C 0223 C ** CHECK IF THE FLAG TO STOP THE GATHERING OF DATA HAS BEEN SET. 0224 C 0225 IF (.NOT. START_STOP1) THEN 0226 C 0227 C ** ENQUEUE ANOTHER REQUEST FOR DATA TO THE DEVICE. 0228 C 0229 CALL AD_ENQS(AD_ID, AD_NMBR, AD_BUFFER, AD_EFN, DA_NMBR ) 0230 C 0231 C ** ELSE RETURN 0232 C 0233 ELSE 0234 RETURN 0235 ENDIF 0236 C 0237 C ** ADVANCE POINTER FOR THIS DEVICE 0238 C 0239 AD1_PNTR = AD1_PNTR + 1 0240 C 0241 C ** POINT TO PROPER ARRAY, CHECK ARRAY POINTER. ASYNCH_IN 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 10 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0242 C 0243 IF (CUR_PNTR1 .EQ. 1) THEN 0244 C 0245 C ** MOVE DATA INTO ARRAY ELEMENTS IN DATABASE 0246 C 0247 DO KK = 1,AD_NMBR 0248 II = AD_CHAN(KK) + 1 0249 AD1_DATA1(AD1_PNTR,II) = AD_BUFFER(KK) 0250 ENDDO 0251 ELSE 0252 C 0253 C ** IF OTHER ARRAY POINTER THEN MOVE DATA INTO ALTERNATE ARRAY. 0254 C 0255 DO KK = 1,AD_NMBR 0256 II = AD_CHAN(KK) + 1 0257 AD1_DATA2(AD1_PNTR,II) = AD_BUFFER(KK) 0258 ENDDO 0259 ENDIF 0260 C 0261 C ** GET CURRENT TIME AND MOVE INTO PROPER TIMER ARRAY. 0262 C 0263 CALL ADDA_TIMER( IDV, CUR_PNTR1, AD1_PNTR ) 0264 C 0265 C ** IF CURRENT ARRAY IF FULL THEN LETS RESET ARRAY POINTER. 0266 C 0267 IF (AD1_PNTR .EQ. 120) THEN 0268 PRV_PNTR1 = CUR_PNTR1 0269 IF (CUR_PNTR1 .EQ. 1) THEN 0270 CUR_PNTR1 = 2 0271 ELSE 0272 CUR_PNTR1 = 1 0273 ENDIF 0274 C 0275 C ** RESET ELEMENT POINTER TO ZERO. 0276 C 0277 AD1_PNTR = 0 0278 C 0279 C ** TELL THE FILER TO FILE THE DATA TO THE DATAFILE. 0280 C 0281 IF (LOG_DATA_OK) CALL FILE_DATA( DEVICE, IDV, PRV_PNTR1, IDV ) 0282 ENDIF 0283 C 0284 C ** NOW CHECK IF IT WAS THE OTHER DEVICE. 0285 C 0286 ELSE IF (IDV .EQ. 2) THEN 0287 C 0288 C ** CHECK IF THE FLAG TO STOP THE GATHERING OF DATA HAS BEEN SET. 0289 C 0290 IF (.NOT. START_STOP2) THEN 0291 C 0292 C ** ENQUEUE ANOTHER REQUEST FOR DATA TO THE DEVICE. 0293 C 0294 CALL AD_ENQS(AD_ID, AD_NMBR, AD_BUFFER, AD_EFN, DA_NMBR ) 0295 C 0296 C ** ELSE RETURN 0297 C 0298 ELSE ASYNCH_IN 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 11 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 0299 RETURN 0300 ENDIF 0301 C 0302 C ** INCREMENT THE ELEMENT POINTER FOR THE SECOND DEVICE ARRAY. 0303 C 0304 AD2_PNTR = AD2_PNTR + 1 0305 C 0306 C ** CHECK WHICH ARRAY WE ARE USING THIS PASS. 0307 C 0308 IF (CUR_PNTR2 .EQ. 1) THEN 0309 C 0310 C ** MOVE DATA INTO THE SECOND DEVICE DATA ARRAY. 0311 C 0312 DO KK = 1,AD_NMBR 0313 II = AD_CHAN(KK) + 1 0314 AD2_DATA1(AD2_PNTR,II) = AD_BUFFER(KK) 0315 ENDDO 0316 ELSE 0317 C 0318 C ** IF ALTERNATE DATA ARRAY, THEN MOVE DATA INTO IT. 0319 C 0320 DO KK = 1,AD_NMBR 0321 II = AD_CHAN(KK) + 1 0322 AD2_DATA2(AD2_PNTR,II) = AD_BUFFER(KK) 0323 ENDDO 0324 ENDIF 0325 C 0326 C ** GET CURRENT TIME AND MOVE INTO TIMER ARRAY. 0327 C 0328 CALL ADDA_TIMER( IDV, CUR_PNTR2, AD2_PNTR ) 0329 C 0330 C ** IF DATA ARRAY IS FULL, THEN SWITCH TO THE OTHER ARRAY. 0331 C 0332 IF (AD2_PNTR .EQ. 120) THEN 0333 PRV_PNTR2 = CUR_PNTR2 0334 IF (CUR_PNTR2 .EQ. 1) THEN 0335 CUR_PNTR2 = 2 0336 ELSE 0337 CUR_PNTR2 = 1 0338 ENDIF 0339 C 0340 C ** RESET THE ELEMENT POINTER FOR THE ALTERNATE ARRAY. 0341 C 0342 AD2_PNTR = 0 0343 C 0344 C ** TELL THE FILER TO MOVE DATA TO DATA FILE. 0345 C 0346 IF (LOG_DATA_OK) CALL FILE_DATA( DEVICE, IDV, PRV_PNTR2, IDV ) 0347 ENDIF 0348 ENDIF 0349 C 0350 C ** END OF SUBROUTINE. 0351 C 0352 RETURN 0353 END ASYNCH_IN 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 12 01 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 PROGRAM SECTIONS Name Bytes Attributes 0 $CODE 545 PIC CON REL LCL SHR EXE RD NOWRT LONG 2 $LOCAL 164 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 29913 ENTRY POINTS Address Type Name 0-00000000 ASYNCH_IN 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 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 8-000000E0 I*4 DA_EFN 8-0000004C I*4 DA_NMBR 8-000000B0 CHAR DEVICE 8-000000AC I*4 IDV 2-00000014 I*4 II 2-0000000C 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 2-00000000 I*4 STATUS 2-00000008 I*4 SYS$BINTIM 2-00000004 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) 8-000000BC I*2 AD_BUFFER 32 (16) ASYNCH_IN 20-Nov-1990 18:07:49 VAX FORTRAN V5.4-79 Page 13 01 1-Aug-1990 19:18:32 LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.FOR;10 8-00000000 I*4 AD_CHAN 64 (16) 8-00000050 I*4 AD_GAIN 64 (16) 7-00000004 I*4 AD_NUMBR 8 (2) 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 ADDA_TIMER AD_ENQS FILE_DATA OPTIONS QUALIFIERS /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW) /EXTEND_SOURCE /F77 /NOG_FLOATING /I4 COMMAND QUALIFIERS FOR/LIS/NOOPT/EXTEND ADDA_DAOUT /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_DAOUT.LIS;24 /OBJECT=LIB4:[ADDASYS.SOURCE]ADDA_DAOUT.OBJ;1 COMPILATION STATISTICS Run Time: 10.12 seconds Elapsed Time: 12.15 seconds Page Faults: 900 Dynamic Memory: 620 pages