
                               					 6-Jan-1983 11:08:03	VAX-11 FORTRAN V3.1-23              Page   1
								30-Sep-1982 11:00:59	[CAMAC.SOURCE.KS30202]CAMAC.FOR;1           

0001    C+++
0002    C
0003    C	Procedure:
0004    C	CAM$CAMAC(MOD_ID,A,F,TC,DATA,MEM)
0005    C
0006    C	Description:
0007    C	This procedure implements a general CAMAC call. This call
0008    C	offers none of the more sophisticated features of the direct CAMAC
0009    C	calls. It does offer the advantage of being particularly simple to
0010    C	use. The module identitier(MOD_ID) must either be the module
0011    C	logical name descriptor or the module key descriptor(i.e. a CHARACTER 
0012    C	type variable containing the CAMAC logical module name or an INTEGER*4
0013    C	variable containing the module key assigned by CAM$ASSIGN. The CAMAC
0014    C	subaddress(A) and function code(F) must be specified. The remaining
0015    C	arguments may be specified as null or actual parameters. If the transfer
0016    C	count(TC) is specified as null or has a value of 1, a programmed I/O 
0017    C	operation is performed. If greater than 1, a Stop mode transaction
0018    C	is performed. CAMAC status is analyzed for any generic anomolous
0019    C	conditions and if any are detected, appropriate action is taken.
0020    C
0021    C	Parameters:
0022    C	MOD_ID is the address of a CHARACTER string descriptor containing the
0023    C		logical module name or an I*4 descriptor containing the module
0024    C		key assigned by CAM$ASSIGN.
0025    C	A is the address of a byte containing the CAMAC sudabbress.
0026    C	F is the address of a byte containing the CAMAC function code.
0027    C	TC is the address of a word containing the transfer count. If specified
0028    C		as null or with a value of 1, a programmed I/O operation is
0029    C		requested. If greater than 1, a stop mode transaction is
0030    C		requested.
0031    C	DATA is the address of a buffer containing/to receive CAMAC data. May
0032    C		be specified as null for CAMAC control function codes.
0033    C	MEM is the address of a byte containing a value of 16 to indicate
0034    C		16-bit memory format or 24 to indicate 24-bit memory format
0035    C		for the CAMAC transaction. May be specified as null, in which
0036    C		case, the default memory format from the CAMAC Image Block is
0037    C		used.
0038    C
0039    C
0040    C---
0041    	INTEGER FUNCTION CAM$CAMAC(MOD_ID,A,F,TC,DATA,MEM)
0042    	IMPLICIT INTEGER(A-Z)
0043    	INTEGER*2 TC
0044    	IF (%LOC(TC).NE.0 .AND. TC.GT.1) THEN
0045    		STATUS=CAM$STOPW(MOD_ID,A,F,TC,DATA,MEM)
0046    	ELSE
0047    		STATUS=CAM$PIOW(MOD_ID,A,F,DATA,MEM)
0048    	END IF
0049    	IF (.NOT.STATUS) THEN
0050    		CALL LIB$STOP(%VAL(STATUS))
0051    	END IF
0052    	IF (CAM$ERROR(.TRUE.,)) THEN
0053    		CALL CAM$SHOW_STAT
0054    	END IF
0055    	RETURN
0056    	END

CAM$CAMAC                      					 6-Jan-1983 11:08:03	VAX-11 FORTRAN V3.1-23              Page   2
								30-Sep-1982 11:00:59	[CAMAC.SOURCE.KS30202]CAMAC.FOR;1           

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  146   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                   4   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                                  80   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

    Total Space Allocated                  230


ENTRY POINTS

    Address  Type  Name          

  0-00000000  I*4  CAM$CAMAC     


VARIABLES

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

 AP-00000008@ I*4  A              AP-00000014@ I*4  DATA           AP-0000000C@ I*4  F              AP-00000018@ I*4  MEM           
 AP-00000004@ I*4  MOD_ID          2-00000004  I*4  STATUS         AP-00000010@ I*2  TC            


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name            Type  Name            Type  Name            Type  Name            Type  Name          

   I*4  CAM$ERROR        I*4  CAM$PIOW              CAM$SHOW_STAT    I*4  CAM$STOPW             LIB$STOP      


COMMAND QUALIFIERS

  FORTRAN /LIS CAMAC

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(NOSYMBOLS,TRACEBACK)
  /STANDARD=(NOSYNTAX,NOSOURCE_FORM)
  /SHOW=(NOPREPROCESSOR,NOINCLUDE,MAP)
  /F77  /NOG_FLOATING  /I4  /OPTIMIZE  /WARNINGS  /NOD_LINES  /NOCROSS_REFERENCE  /NOMACHINE_CODE  /CONTINUATIONS=19


COMPILATION STATISTICS

  Run Time:           0.71 seconds
  Elapsed Time:       0.97 seconds
  Page Faults:        330
  Dynamic Memory:     116 pages
