The data that is stored on this board is largely system dependent. The ROCS/Mugef system stores both tables and Functions on the board whilst the ROCS/MOPOS stores only configuration tables.
The common data is a header structure and a command recorder.
The Shared Memory Maps
As an example, there now follows a description of the calls for the ROCS/MOPOS maps. There are four maps in this implementation which contain:
Per Channel data
Per Event data
Calibration Data
Per Crate/System data
These are obtained from the relevant tables in rocsfe.c. and are all contained in the single shared memory segment. All the routines described can be found in the file nvmap.c with the data structures in maps.h and tlpos.h.
There is a single routine to attach the shared memory segment the first time it is used which is:
void AttachMaps(void)
Though most of the routines call it themselves if the segment is not attached. Each of the maps has functions for:
Loading the map from a table in NVRAM
Getting a map entry
Printing the map data
These will now be described for each map.
This contains the per-channel information which is contained in the structure:
The map is initialised with the routine:
from the member data routine which contains
nrec records starting at dp.To extract a record from the map use:
giving the routine an N-Value. This returns NULL on an invalid N-Value. To convert between an (external) N-Value and an (internal) channel number, use:
To print the whole map use:
This contains the per-event information which is contained in the structure:
The map is initialised with the routine:
from the event data table which contains
nrec records starting at dp.To extract a record from the map use:
giving the routine an Event Code. This returns NULL on an invalid Event.
To print the whole map use:
Unlike the otyher maps, the calibration maps are a set of maps which consist of 40 structures for each of 8 settings. The 40 structures are in order of channel number and the setting is given in the Event map as the member
sSetting. The structure has the format:The map is initialised with the routine:
from the event data table of length
len bytes.To extract a calibration set from the map use:
giving the routine the Event code. This returns a pointer to an array of 40 structures or NULL on an error.
A new calibration map can be stored with the extra routine:
int NewCalTab(long ec, TlCalibData *cp);
To print a calibration map (for a single setting) use:
This is a single structure which contains all the information specific to this crate. There is no index for this map, which has the format:
The map is initialised with the routine:
from the crate information table at
dp.To extract the map use:
To print the map use: