man8/3922task

Table of Contents

Name

3922task - CAMAC 3922 monitor and control service

Synopsis

3922task <argument list>

Description

Control and monitoring for a KSC3922 crate controller.

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.

Arguments

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.

--dbman_host <hn>

The host where dbman is running.

If this argument is not supplied the default is "localhost".

--dev <path>

The pathname of the device to open.

If this argument is not supplied the default is "/dev/camac".

--drv <drv>

The Driver key.

If this argument is not supplied the default is "CAMAC".

--cmin <C>

The minimum crate number.

If this argument is not supplied the default is "0".

--cmax <C>

The maximum crate number.

If this argument is not supplied the default is "7".

--auto_rstr

Enable auto restore.

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.

--help

Print program help to stderr.

If this argument is supplied the internal help is printed to stderr and the program exits.

Device Types used by this program

3922csr - required

The control/status register (F1A0).

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.

3922pat - optional
The LAM pattern register (F1A12).

See "Program polling operation" below for more information.

3922mask - optional
The LAM mask register (F1A13).

See "Program polling operation" below for more information.

3922sc - optional
Used to issue commands to 3922task.

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

Program polling operation

3922task uses the ioctl() interface for all of it’s interaction with the CAMAC system. The ioctl() interface is documented in the device driver manual pages.

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.

Notes

Setting the 3922csr DATA record to 0x8000000 when there is an error is intended to make it easy to provide a status read for the crate.

Examples

#
# this example services crates 1 thru 4
# dbman is running on the same host
#
3922task --dbman_host localhost --drv CAMAC --cmin 1 --cmax 4

Manual page revision

$Id: 3922task.8,v 1.0 2007/03/22 19:16:22 kitchen Exp $


Table of Contents