<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
                                                                20-Nov-1990 18:06:51	VAX FORTRAN V5.4-79                 Page   1
                                                                 1-Aug-1990 19:09:46	LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.FOR;4     

0001    	OPTIONS/EXTEND
0002    	SUBROUTINE AD_CHNL_DEF( DEVICE_ID, NCHNL, A, G )
0003    C
0004    C **************************************************************************
0005    C **  PROGRAM AUTHOR:       WILLIAM BAKER
0006    C 
0007    C **  PROGRAM DESCRIPTION:  DEFINES CHANNELS TO A/D CONVERTER.
0008    C **                        
0009    C
0010    C **  ADDA_CHNLDEF.FOR
0011    C     -----------------------
0012    C
0013    C **  DECLARE THE LOCAL VARIABLES NEEDED BY THIS SUBROUNTINE.
0014    C
0015    	INTEGER*4	STATUS, NCHNL, DEVICE_ID, G(NCHNL), A(NCHNL)
0016    C
0017    C **  INCLUDE THE PARAMETERS NEEDED TO CALL THE LIO$ ROUTINES.
0018    C
0019    	INCLUDE 'SYS$SHARE:LIOSET.FOR'
0708    C
0709    C **  TYPE INFORMATIONAL MESSAGE TO LOG FILE ABOUT NUMBER OF CHANNELS.
0710    C **  USE THIS AS A DEBUG STATEMENT TO SEE HOW FAR INTO MAINIO WE ARE.
0711    C
0712    	TYPE *, 'Number of channels = ',NCHNL
0713    C
0714    C===================================================================
0715    C
0716    C **  THE NEXT STATEMENTS ARE ALL THE SAME, EACH SECTION IS FOR A
0717    C **  DIFFERENT NUMBER OF CHANNELS BEING DECLARED.  SEEMS YOU JUST
0718    C **  CAN'T DECLARE ALL THE CHANNELS, OR SCATTER THE DECLARATIONS.
0719    C **  ALL CHANNELS MUST BE CONTIGUOUS TO EACH OTHER.  ALSO, WHY
0720    C **  DECLARE MORE CHANNELS THAN YOU NEED, THIS WILL MAKE RESPONCE
0721    C **  QUICKER WHEN FEWER CHANNELS ARE HAVING TO BE READ AND REPORTED.
0722    C
0723    C===================================================================
0724    C
0725    	IF (NCHNL .EQ. 1) THEN
0726    C
0727    C **  DECLARE THE CHANNELS THIS DEVICE IS TO READ AND REPORT.
0728    C
0729    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1) )
0730    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0731    C
0732    C **  DECLARE THE GAIN FOR THE CHANNELS THIS DEVICE HAS BEEN SELECTED FOR.
0733    C
0734    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1) )
0735    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0736    C
0737    	ELSE IF (NCHNL .EQ. 2) THEN
0738    C
0739    C **  ETC...
0740    C
0741    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2) )
0742    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0743    C
0744    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2) )
0745    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

AD_CHNL_DEF                                                     20-Nov-1990 18:06:51	VAX FORTRAN V5.4-79                 Page   2
                                                                 1-Aug-1990 19:09:46	LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.FOR;4     

0746    C
0747    	ELSE IF (NCHNL .EQ. 3) THEN
0748    C
0749    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3))
0750    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0751    C
0752    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3))
0753    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0754    C
0755    	ELSE IF (NCHNL .EQ. 4) THEN
0756    C
0757    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4) )
0758    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0759    C
0760    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4) )
0761    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0762    C
0763    	ELSE IF (NCHNL .EQ. 5) THEN
0764    C
0765    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5) )
0766    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0767    C
0768    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5) )
0769    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0770    C
0771    	ELSE IF (NCHNL .EQ. 6) THEN
0772    C
0773    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6) )
0774    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0775    C
0776    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6) )
0777    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0778    C
0779    	ELSE IF (NCHNL .EQ. 7) THEN
0780    C
0781    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0782         &amp;					A(7) )
0783    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0784    C
0785    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0786         &amp;					G(7) )
0787    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0788    C
0789    	ELSE IF (NCHNL .EQ. 8) THEN
0790    C
0791    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0792         &amp;					A(7), A(8) )
0793    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0794    C
0795    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0796         &amp;					G(7), G(8) )
0797    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0798    C
0799    	ELSE IF (NCHNL .EQ. 9) THEN
0800    C
0801    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0802         &amp;					A(7), A(8), A(9) )

AD_CHNL_DEF                                                     20-Nov-1990 18:06:51	VAX FORTRAN V5.4-79                 Page   3
                                                                 1-Aug-1990 19:09:46	LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.FOR;4     

0803    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0804    C
0805    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0806         &amp;					G(7), G(8), G(9) )
0807    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0808    C
0809    	ELSE IF (NCHNL .EQ. 10) THEN
0810    C
0811    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0812         &amp;					A(7), A(8), A(9), A(10) )
0813    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0814    C
0815    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0816         &amp;					G(7), G(8), G(9), G(10) )
0817    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0818    C
0819    	ELSE IF (NCHNL .EQ. 11) THEN
0820    C
0821    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0822         &amp;					A(7), A(8), A(9), A(10), A(11) )
0823    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0824    C
0825    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0826         &amp;					G(7), G(8), G(9), G(10), G(11) )
0827    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0828    C
0829    	ELSE IF (NCHNL .EQ. 12) THEN
0830    C
0831    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0832         &amp;					A(7), A(8), A(9), A(10), A(11), A(12) )
0833    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0834    C
0835    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0836         &amp;					G(7), G(8), G(9), G(10), G(11), G(12) )
0837    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0838    C
0839    	ELSE IF (NCHNL .EQ. 13) THEN
0840    C
0841    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0842         &amp;					A(7), A(8), A(9), A(10), A(11), A(12), A(13) )
0843    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0844    C
0845    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0846         &amp;					G(7), G(8), G(9), G(10), G(11), G(12), G(13) )
0847    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0848    C
0849    	ELSE IF (NCHNL .EQ. 14) THEN
0850    C
0851    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0852         &amp;					A(7), A(8), A(9), A(10), A(11), A(12), A(13), A(14) )
0853    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0854    C
0855    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0856         &amp;					G(7), G(8), G(9), G(10), G(11), G(12), G(13), G(14) )
0857    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0858    C
0859    	ELSE IF (NCHNL .EQ. 15) THEN

AD_CHNL_DEF                                                     20-Nov-1990 18:06:51	VAX FORTRAN V5.4-79                 Page   4
                                                                 1-Aug-1990 19:09:46	LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.FOR;4     

0860    C
0861    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0862         &amp;					A(7), A(8), A(9), A(10), A(11), A(12), A(13), A(14), A(15) )
0863    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0864    C
0865    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0866         &amp;					G(7), G(8), G(9), G(10), G(11), G(12), G(13), G(14), G(15) )
0867    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0868    C
0869    	ELSE IF (NCHNL .EQ. 16) THEN
0870    C
0871    C ** FINAL CHANNEL DECLARATION.
0872    C
0873    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_CHAN, NCHNL, A(1), A(2), A(3), A(4), A(5), A(6),
0874         &amp;					A(7), A(8), A(9), A(10), A(11), A(12), A(13), A(14), A(15), A(16) )
0875    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0876    C
0877    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_AD_GAIN, NCHNL, G(1), G(2), G(3), G(4), G(5), G(6),
0878         &amp;					G(7), G(8), G(9), G(10), G(11), G(12), G(13), G(14), G(15), G(16) )
0879    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0880    C
0881    	ENDIF
0882    C
0883    C **  RETURN TO MAINIO PROGRAM.
0884    C
0885    	RETURN
0886    	END




PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                 4297   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                  29   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                                1948   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

    Total Space Allocated                 6274


ENTRY POINTS

    Address  Type  Name          

  0-00000000       AD_CHNL_DEF   


VARIABLES

    Address  Type  Name              Address  Type  Name              Address  Type  Name          

 AP-00000004@ I*4  DEVICE_ID      AP-00000008@ I*4  NCHNL           2-00000000  I*4  STATUS        

AD_CHNL_DEF                                                     20-Nov-1990 18:06:51	VAX FORTRAN V5.4-79                 Page   5
01                                                               1-Aug-1990 19:09:46	LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.FOR;4     

ARRAYS

    Address  Type  Name                Bytes  Dimensions

 AP-0000000C@ I*4  A                      **  (*)
 AP-00000010@ I*4  G                      **  (*)


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name            Type  Name          

        LIB$SIGNAL       I*4  LIO$SET_I     


OPTIONS QUALIFIERS

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /EXTEND_SOURCE  /F77  /NOG_FLOATING  /I4

                                                                20-Nov-1990 18:06:51	VAX FORTRAN V5.4-79                 Page   6
                                                                 1-Aug-1990 19:09:46	LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.FOR;4     

0002    	OPTIONS/EXTEND
0003    	SUBROUTINE DA_CHNL_DEF( DEVICE_ID, NCHNL, D )
0004    C
0005    C **************************************************************************
0006    C **  PROGRAM AUTHOR:       WILLIAM BAKER
0007    C 
0008    C **  PROGRAM DESCRIPTION:  DEFINES CHANNELS TO D/A CONVERTER.
0009    C **                        
0010    C
0011    C **  ADDA_CHNLDEF.FOR
0012    C     -----------------------
0013    C
0014    C **  DECLARE VARIABLES NEEDED LOCALLY.
0015    C
0016    	INTEGER*4	STATUS, NCHNL, DEVICE_ID, D(2)
0017    C
0018    C **  INCLUDE PARAMETERS NEEDED TO MAKE LIO$ CALLS.
0019    C
0020    	INCLUDE 'SYS$SHARE:LIOSET.FOR'
0709    C
0710    C **  TYPE NUMBER OF D/A CHANNELS,  USED FOR DEBUG OF PROGRAM.
0711    C
0712    	TYPE *, 'Number of D/A channels = ', NCHNL
0713    C
0714    C **  SINCE WE ONLY HAVE 2 D/A CHANNELS ON AN AXV11 DEVICE.
0715    C **  THIS PART IS EASY.  EITHER CHANNEL CAN BE DECLARED, OR
0716    C **  BOTH, OR NONE OF THE CHANNELS CAN BE DECLARED.
0717    C
0718    	IF (NCHNL .EQ. 1) THEN
0719    C
0720    C **  DECLARE THE ONE OF THE D/A CHANNELS.
0721    C
0722    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_DA_CHAN, 1, D(1))
0723    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0724    C
0725    	ELSE IF (NCHNL .EQ. 2) THEN
0726    C
0727    C **  DECLARE BOTH THE D/A CHANNELS.
0728    C
0729    		STATUS = LIO$SET_I( DEVICE_ID, LIO$K_DA_CHAN, 2, 0, 1 )
0730    			IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
0731    C
0732    	ENDIF
0733    C
0734    C **  RETURN TO THE MAINIO PROGRAM.
0735    C
0736    	RETURN
0737    	END

DA_CHNL_DEF                                                     20-Nov-1990 18:06:51	VAX FORTRAN V5.4-79                 Page   7
01                                                               1-Aug-1990 19:09:46	LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.FOR;4     

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  143   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                  41   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                                  92   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

    Total Space Allocated                  276


ENTRY POINTS

    Address  Type  Name          

  0-00000000       DA_CHNL_DEF   


VARIABLES

    Address  Type  Name              Address  Type  Name              Address  Type  Name          

 AP-00000004@ I*4  DEVICE_ID      AP-00000008@ I*4  NCHNL           2-00000000  I*4  STATUS        


ARRAYS

    Address  Type  Name                Bytes  Dimensions

 AP-0000000C@ I*4  D                       8  (2)


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name            Type  Name          

        LIB$SIGNAL       I*4  LIO$SET_I     


OPTIONS QUALIFIERS

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /EXTEND_SOURCE  /F77  /NOG_FLOATING  /I4

DA_CHNL_DEF                                                     20-Nov-1990 18:06:51	VAX FORTRAN V5.4-79                 Page   8
01                                                               1-Aug-1990 19:09:46	LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.FOR;4     

COMMAND QUALIFIERS

  FOR/LIS/NOOPT/EXTEND ADDA_CHNLDEF

  /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_CHNLDEF.LIS;22                                                            
  /OBJECT=LIB4:[ADDASYS.SOURCE]ADDA_CHNLDEF.OBJ;1                                                             


COMPILATION STATISTICS

  Run Time:           17.58 seconds
  Elapsed Time:       22.77 seconds
  Page Faults:        781
  Dynamic Memory:     812 pages
</pre></body></html>