Table of Contents

Name

MBSseqTask - NEC Sequenced Controller service

Synopsis

MBSseqTask <argument list>

Description

I/O service for an NEC Sequence Controller CAMAC module. This module is part of the Magnet Bias Sequencer system and used to provide the timing information to drive the Sequenced D/A and gate generator CAMAC modules.

This program runs as daemon unless overriden with the --no_daemon argument and should NOT be started in the background.

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_camac <path>

The pathname to the device to open when --drv specifies a CAMAC device.

The default is: /dev/camac

--dev_kbuss <path>

The pathname to the device to open when --drv specifies a KBUSS device.

The default is: /dev/kbuss

--drv <name>

The driver key.
--cmin

The minimum crate number in CAMAC.
The minimum board number in KBUSS.

If this is not supplied it defaults to 0.

--cmax

The maximum crate number in CAMAC.
The maximum board number in KBUSS.

If this is not supplied it defaults to 99.

--no_daemon

If this argument is present the program doesn’t become a daemon.
--show_tbl

If this is supplied then the DATA table is printed to stderr.
--help

Print the internal help information and exit.

Controls/Readbacks

The information given here concerns the DESC records and RefNames commonly used with MBSseqTask.

MBSseqTask uses the AccelNET data interface to communicate with dbman. This means that all communication takes place using the DATA records and that the program is not aware of Labels or RefNames.

However, a number of DESC records need to be set up in the database to manipulate the contents of the DATA records. This is a list of them grouped by RefName.

StartSC

This is a momentary control. nop is the rest state, start causes the sequencer to begin cycling, stop causes the sequencer to end cycling.

It is a 2 bit field within the record with the device key NECrunC.

The bit field usage is:

   0 = nop

   1 = stop

   2 = start

   3 = not_used

BusySR

stop is the rest state with no data pending. pause is a rest state with data pending. When in the coll/run state the system is collecting data and cycle number is advancing. When in the tune/run the system is running but is not collecting data and cycle number is not advancing.

It is a 2 bit field within the record with the device key NECbusyR.

The bit field usage is:

   0 = stop

   1 = tune

   2 = collect

   3 = pause

ClearSC

If BusySR=pause and collecting data, the data is discarded and the logging files are closed. If BusySR=(run or stop) nothing occurs.

It is a 1 bit field within the record with the device key NECrunC.

The bit field usage is:

   0 = nop

   1 = clear

EndRunC

If BusySR=pause and collecting data, the data is saved to files and the files are closed. If BusySR=(run or stop) nothing occurs.

It is a 1 bit field within the record with the device key NECrunC.

The bit field usage is:

   0 = nop

   1 = end_run

CollMode

If the system is running and in tune mode no data is collected. If the system is running and in collect mode data is collected.

It is a 1 bit field within the record with the device key NECrunC.

The bit field usage is:

   0 = tune

   1 = collect

CycModeC

pass_stop causes the system to collect data until CntDwnR is equal to CntDwnC. pass_run causes the system to collect data until CntDwnR is equal to CntDwnC. The system then resets CntDwnR to zero and begins collecting data again. This is very useful for setup but not very useful for collecting data into files. cont_run causes the system to collect data until stopped. CntDwnC is ignored.

It is a 2 bit field within the record with the device key NECmodeC.

The bit field usage is:

   0 = pass_stop

   1 = pass_run

   2 = cont_run

   3 = not_used

CntDwnC

The number of cycles to perform.

It is a 32 bit field within the record with the device key NECcntC.

CntDwnR

The number of cycles performed.

It is a 32 bit field within the record with the device key NECcntR.

CycBatch

The number of cycles contained in each collection "batch". The system executes this number of cycles then notifies clients to save data.

It is a 32 bit field within the record with the device key NECcycC.

RunSC

Hardware stop/run control.

This is a 1 bit field within the record with the device key NECseqC and ChNo=0.

The bit field usage is:

   0 = stop

   1 = run

SyncSC

Hardware sync selection control.

It is a 1 bit field within the record with the device key NECseqC and ChNo=0.

The bit field usage is:

   0 = free_run

   1 = line_sync

PolSC

Hardware sync selection control. When SyncSC == 1 then this matters.

It is a 1 bit field within the record with the device key NECseqC and ChNo=0.

The bit field usage is:

   0 = sync-

   1 = sync+

LamSC

Hardware LAM enable control.

This must be enabled for MBSseqTask to operate properly. It may be turned off on special occasions for troubleshooting.

It is a 1 bit field within the record with the device key NECseqC and ChNo=0.

The bit field usage is:

   0 = no_lam

   1 = lam_enable

ModeSC

Hardware mode control. This is used to select between normal operation and maintenance operation. When maintenance operation is selected the current state can be selected by using MaintDC.

It is a 1 bit field within the record with the device key NECseqC and ChNo=0.

The bit field usage is:

   0 = norm

   1 = maint

CycleDC

Hardware max. state number control.

This control determines the number of states the sequencer will go through on each jumping cycle.

It is a four bit field within the record with the device key NECseqC and ChNo=1.

MaintDC
Hardware maint. mode state number control.

It is used when maint mode is selected.

It is a four bit field within the record with the device key NECseqC and ChNo=1.

State*
There are 16 DESC records named State[0-15]. Each one determines the dwell time for one state.

Driver Keys used by this program

These keys are used with CAMAC:

CAMAC
CAMAC_2
CAMAC_3
CAMAC_4

CAMAC_5

In this case the program opens /dev/camac.

These keys are used with KBUSS:

KBUSS_1
KBUSS_2
KBUSS_3
KBUSS_4
KBUSS_5

KBUSS_6

In this case the program opens /dev/kbuss.

Device Types used by this program

NECseqC ChNo=0

This is the control register for the CAMAC/KBUSS module.

Individual bits within this record are used to program the control register in the sequencer module.

   bit 0 - stop/run

   bit 1 - free_run/line_sync

   bit 2 - sync+/sync-

   bit 3 - lam_disable/lam_enable

   bit 4 - norm_mode/maint_mode

NECseqC ChNo=1

This is the cycle number control register. It contains two 4 bit fields. One field is used to determine the maximum state number when in normal mode. The other field determines the current state number when in maint mode.

Bit assignments are:

   bit 3-0 - norm mode max. state number

   bit 7-4 - mint mode current state number

NECseqV ChNo=<0-15>

These are the individual delay registers for the module. There should be 16 entries with this device key. Each entry should have a unique channel number. The data is 24 bits wide.

NECcntC ChNo=0

The number of jumping cycles to perform.

NECcntR ChNo=0

The number of jumping cycles which have been performed.

NECmodeC ChNo=0

NECrunC ChNo=0

Control inputs to MBSseqTask.

Individual bits within this record are used to control program functions.

   bit 0,1 - StartSC

   bit 2 - ClearSC

   bit 3 - EndRunC

   bit 4 - CollMode

NECbusyR ChNo=0

MBSseqTask status.

NECcycC ChNo=0

The number of jumping cycles in a batch.

This is the number of cycles to perform before pausing and ordering clients to unload and store their data.

I/O polling rates

There is nothing to poll.

Examples

#
# this example services crates 1 thru 4
# dbman is running on the same host
#
MBSseqTask localhost CAMAC 1 4

Notes

Despite all appearances to the contrary the way this program is written it can only handle ONE module per driver key.

If for some reason one wishes to manage more than one sequencer (which hasn’t happened anywhere except in a test database) one needs to run multiple copies of MBSseqTask AND run them on separate boxes because each copy creates a listener socket.

The program checks the time between LAMs and if a lot of time elapses (~120sec) since the last LAM was serviced it toggles into pause.

This can be very helpful if the crate is switched off. When the crate is turned back all of the registers will be restored (delay register update is inhibited while cycling because it glitches the cycle) and all one has to do is issue "crate n rstr" to recover all status and continue where one left off. This is much better than having to restart AccelNET to recover from this condition.

The internal state of the program can be dumped to stderr by issuing a SIGHUP to the job. This is a software diagnostic ’cause there still seems to be a case where by switching power off/on etc. the job can be made to hang up. 1-19-05rlk

Manual page revision

$Id: MBSseqTask.8,v 1.11 2008/06/03 18:45:51 kitchen Exp $


Table of Contents