spec

Software for Diffraction

2.4.8.11. - CAMAC (IEEE-583) Hardware Functions



CAMAC functions are available if the appropriate hardware devices and software drivers have been installed on the computer. The config file describes which CAMAC hardware is installed. Refer to the Administrator's Guide for information on the supported CAMAC controllers and how to install the corresponding drivers.

CAMAC modules are programmed with FNA codes where F is a function code, N is the slot number and A is a subaddress number. Slot numbers are assigned in the config file. Built-in code for the specialized CAMAC devices used for controlling motors, clocks and scalers is accessed through commands such as mcount(), tcount() and move_all. However, simple devices, such as input or output registers, can be accessed directly by the user. These modules are also assigned slot numbers in the config file. They are also given device numbers, starting at 0, that are used in the following functions.


ca_get(device, address)
The CAMAC module having device number device, as set in the config file, is read using F = 0 and A = address with the 24-bit value so obtained returned. Resets to command level if not configured for device.

ca_put(x, device, address)
This function is similar to ca_get() above, except the 24-bit value x is written using F = 16. The actual number written is returned, which is the 24-bit integer representation of x. Resets to command level if not configured for device.

ca_fna(f, n, a [, v ])
Sends the arbitrary FNA command to the module in slot n. If the dataway command given by f is a write function, the 24-bit value to be written is contained in v. If the dataway command given by f is a read command, the function returns the 24-bit value obtained from the module. The user should avoid issuing commands that would cause a LAM and should certainly avoid issuing commands to slots that are being used for motor or counter control by spec's internal hardware code.

ca_cntl(cmd, [, arg ])
Performs the selected CAMAC crate command according to the parameter cmd, as follows:


"Z" or "init"
performs a crate initialize (reset).

"C" or "clear"
performs a crate clear.

"inhibit"
set crate inhibit if arg is 1 and clears crate inhibit if arg is 0.


During normal operation, you should not need to issue these commands. You should probably issue a reconfig after sending a crate initialize or clear.