The crate controller is actually managed by the device driver and is not directly accessable by an application.
However, the device driver allows portions of the crate controller to be managed by an application using the ioctl() interface.
Historically the crate(8) program has been used for this purpose. Usually when AccelNET is started the crate(8) command is used to release the backplane inhibit line so that the watchdog timer module can control the inhibit line.
The problem has been that after AccelNET is started the crate can sometimes be switched off resulting in a need for the operator to manually use the crate(8) program to restore the crate controller’s registers, i.e. it’s "context" information.
This program solves the problem in two ways:
1) context restore can be issued from a display page in the AccelNET system.
2) the --auto_rstr option can be used to enable a feature in this program which will automatically issue a context restore command shortly after the program detects that the crate controller status has changed from bad to good.
3922task_v2 registers as 3922task with dbman.
Argument processing is done using Unix long argument syntax.
The values of all of the parameters listed here (whether or not they were supplied on the command line) are printed on stderr when the program starts.
If this argument is not supplied the default is "localhost".
If this argument is not supplied the default is "/dev/camac".
If this argument is not supplied the default is "CAMAC".
If this argument is not supplied the default is "0".
If this argument is not supplied the default is "7".
If this argument is supplied then when the crate controller status changes from bad to good a crate restore instruction will be written to the driver shortly after the status changes.
bad - log bad I/O status
all - log all I/O changes
If this argument is supplied the internal help is printed to stderr and the program exits.
This entry must be present or the crate controller will be ignored even if other entries are present.
See "Program polling operation" below for more information.
See "Program polling operation" below for more information.
See "Program polling operation" below for more information.
Bit 0 - restore context
Bit 1 - clear inhibit
Bit 2 - set inhibit
Bit 3 - perform a CAMAC "Z" operation
Bit 4 - perform a CAMAC "C" operation
The program normally queries the crate controller CSR once per second and writes the value of the register to the 3922csr DATA record.
If the status returned by the ioctl() call is C_ERR then 0x8000000 is written to DATA.CurValue and DATA.DeviceStatus is set to C_ERR. This can occur if the crate controller is missing or the crate power is off.
In this case no other polling is performed, DATA.CurValue is set to 0x8000000, and DATA.DeviceStatus is set to C_ERR for all other records which may be present.
If the status returned by the ioctl() call is C_NOQ then the value of the CSR is written to DATA.CurValue and DATA.DeviceStatus is set to C_OK. This can occur if the crate controller front panel switch is set to "off line".
If C_NOQ is returned reading the LAM pattern register (F1A12), i.e. the crate controller is "off line" then DATA.CurValue is set to 0 because for some reason the register read returns 0xffffff. DATA.DeviceStatus is set to C_OK.
If C_NOQ is returned reading the LAM mask register (F1A13), i.e. the crate controller is "off line" then DATA.CurValue is set to 0 because for some reason the register read returns 0xffffff. DATA.DeviceStatus is set to C_OK.
If the --auto_rstr option is specified then a restore operation (see the crate(8) rstr command) will be issued shortly after the crate controller status changes from bad to good.