The CAMAC record is designed to perform generic CAMAC I/O. The CAMAC Branch (B), Crate (C), Slot (N), Subaddress (A), Function code (F) and transfer mode are all controlled by record fields which can be modified at run time. Applications for this record include accessing CAMAC modules for which no device support exists, and for performing CAMAC diagnostics.
The CAMAC record is intended only for this specialized CAMAC I/O function. The CAMAC record directly calls the ESONE compatible CAMAC library, without an intermediate device support layer.
The CAMAC record supports array operations, i.e. CAMAC block transfer operations. The VAL field contains the data to be written or the data read. Depending upon the CAMAC hardware being used this may use DMA from the CAMAC controller to the VME bus memory.
This record requires the use of an underlying ESONE compatible CAMAC library. A library which supports serial highway drivers and the Kinetic Systems 2917/3922 parallel bus crate controller is part of the camac module.
If a CAMAC operation returns Q=0 it will be reflected in the Q field of the record, but will not raise an alarm. X=0 will raise a minor alarm. Any other errors detected in the CAMAC library will raise a major alarm.
|VAL||R/W*||"Current value"||DBF_LONG (array)||The data to be written to CAMAC or the data read from CAMAC. This is always an array of LONGS. The maximum array length is determined by NMAX at IOC initialization. The actual array length is equal to NACT.|
|Q||R||"Q response"||DBF_LONG||The CAMAC Q response of the previous operation. This field is only guaranteed to be valid if TMOD="Single".|
|X||R||"X response"||DBF_LONG||The CAMAC X response of the previous operation. This field is only guaranteed to be valid if TMOD="Single".|
|INHB||R||"Inhibit status"||DBF_LONG||The status of the crate Inhibit signal (0=clear, 1=set).|
|B||R/W||"Branch"||DBF_LONG||The CAMAC Branch to use for the operation. Branch numbers start at 0.|
|C||R/W||"Crate"||DBF_LONG||The CAMAC Crate to use for the operation. Crate numbers start at 0 or 1 depending upon the hardware type.|
|N||R/W||"Station"||DBF_LONG||The CAMAC station (or slot) to use for the operation. Valid station numbers are typically 1-23 and 30.|
|A||R/W||"Subaddress"||DBF_LONG||The CAMAC subaddress to use for the operation. Valid subadresses are 0-15.|
|F||R/W||"Function"||DBF_LONG||The CAMAC function code to use for the operation. Valid function are codes 0-31. Function codes in the range 0-7 are CAMAC read operations, function codes in the range 16-23 are CAMAC write operations, and function codes in the range 8-15 and 24-31 are CAMAC control operations.|
The data transfer mode. The choices are:
|NMAX||R||"Max. number of values"||DBF_LONG||The allocated length of the VAL array. It cannot be modified after the IOC is initialized.|
|NUSE||R/W||"Number of values to R/W"||DBF_LONG||The number of values to attempt to transfer when the record processes. This number is ignored if TMOD is "Single". It must be less than or equal to NMAX.|
|NACT||R||"Actual number of values R/W"||DBF_LONG||The actual number of values which were transferred in the last CAMAC operation. This number may be less than NUSE if a Q Stop, Q Repeat or Q Scan operation terminated prematurely due to a Q=0 or timeout.|
A crate controller command. The choices are:
|BPTR||N||"Buffer Pointer"||DBF_NOACCESS||The pointer to the buffer for the VAL field.|
The following IDL program demonstrates the use of the Generic CAMAC record. It does a block-mode read of a scaler in slot 14 and plots the results. It also demonstrates using the "Crate Command" (CCMD) field to clear the Inhibit line.
; This IDL program demonstrates the use of the ; Generic CAMAC record. ; It does a Q-repeat read of a scaler in slot 14 ; and plots the results. ; The name of the generic CAMAC record rec = 'test_camac1' ; Set up B, C, N, A for scaler 0 (first scaler) ; in slot 14 on crate 0, branch 0. t = caput(rec+'.B', 0) t = caput(rec+'.C', 0) t = caput(rec+'.N', 14) t = caput(rec+'.A', 0) ; Make sure the crate Inhibit line is clear, ; because it would stop the scaler t = caput(rec+'.CCMD', "Clear Inhibit") ; Set the transfer mode to Q-repeat t = caput(rec+'.TMOD', "Q Repeat") ; Set up to read the scaler 1024 times t = caput(rec+'.NUSE', 1024) ; Read the scaler into the record VAL field ; by forcing the record to process t = caput(rec+'.PROC', 1) ; Make sure we got the number of values we expected t = caget(rec+'.NACT', nact) if (nact eq 1024) then $ print, 'Read CAMAC scaler OK' $ else $ print, 'Error reading CAMAC scaler' ; Read the data into IDL - only valid data t = caget(rec, data, max=nact) ; Plot the data plot, data end