GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FES / V6-5-0 > fes_ux / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

fesConfig.c File Reference

Configuration system routines. More...

#include <fesConfig.h>
#include <fesParm.h>
#include <fesMsgs.h>
#include <EMSG/EMSG_pubdefs.h>
#include <EXPAT/expat.h>
#include <VBI/vxwdef.h>
#include <strings.h>
#include <stdio.h>
#include <string.h>

Functions

int fesConfigInit (const char *file)
 Initialize configuration data.
const int * fesConfigAcdCblGet (int unit, int global)
 Get the ACD cable numbers of a board.
int fesConfigAcdCblsGet (int unit, int global, int *cables)
 Get the packed ACD cable numbers of a board.
int fesConfigAcdPathGet (int unit, int global)
 Get the ACD path number of a board.
int fesConfigAUnitGet (int unit, int global)
 Get the associated unit number of a board.
int fesConfigBoardFind (const char *name, int global)
 Find the board with a given name.
const fesBoard_tfesConfigBoardGet (int unit, int global)
 Get complete information for a board.
int fesConfigCtlIndexGet (void)
 Get the index of the control board.
int fesConfigCtlUnitGet (void)
 Get the unit number of the control board.
int fesConfigCableGet (int unit, int global)
 Get the control cable number of a board.
int fesConfigDiskGet (int unit, int global)
 Get the disk number of a board.
const int * fesConfigFifoGet (int unit, int global)
 Get the FIFO cable map of a board.
int fesConfigHwUnitGet (int unit)
 Get the hardware unit number of a board.
int fesConfigIdFind (int id, int global)
 Find the board with a given ID.
int fesConfigIdGet (int unit, int global)
 Get the ID number of a board.
int fesConfigIndexGet (int unit, int global)
 Get the global index of a board.
const char * fesConfigNameGet (int unit, int global)
 Get the detector name of a board.
int fesConfigNBoardGet (int global)
 Get the number of configured boards.
const char * fesConfigNodeGet (int unit, int global)
 Get the node name of a board.
int fesConfigPrimaryGet (int unit, int global)
 Get primary flag for a board.
int fesConfigTowerGet (int unit, int global)
 Get the tower number of a board.
int fesConfigTypeGet (int unit, int global)
 Get the type of a board.
const char * fesConfigTypeNameGet (int unit, int global)
 Get the type name of a board.
int fesConfigUnitGet (int unit, int global)
 Get the unit number of a board.


Detailed Description

Configuration system routines.

Author:
Owen H Saxton
$Id: fesConfig.c,v 1.27 2010/08/19 23:27:51 saxton Exp $

Function Documentation

const int* fesConfigAcdCblGet ( int  unit,
int  global 
)

Get the ACD cable numbers of a board.

This routine gets the ACD cable numbers of a configured FES board, as a pointer to a four-element array containing the cable numbers in FIFO order. A FIFO without a cable contains the value -1.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The address of the board's ACD cable nummbers, or NULL if the unit number or index was not in the allowed range.

References fesBoard_s::acdCbl.

int fesConfigAcdCblsGet ( int  unit,
int  global,
int *  cables 
)

Get the packed ACD cable numbers of a board.

This routine returns all the cable numbers for an ACD board, packed into an array in numerical order.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
cables The address of a four-element integer array to receive the ACD detector's cable numbers. If there are fewer than four cable numbers for the detector, the array is padded with the value -1.
Return values:
0 Success.
-1 The unit number or index was not in the allowed range.

References fesBoard_s::acdCbl, FES_NUM_ACD_CABLES, and FES_NUM_SIDES.

Referenced by fesDataGen(), fesDataGenPedes(), and fesDataGenTrig().

int fesConfigAcdPathGet ( int  unit,
int  global 
)

Get the ACD path number of a board.

This routine gets the ACD path number of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's ACD path number (0 = primary, 1 = redundant) or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::acdPath.

int fesConfigAUnitGet ( int  unit,
int  global 
)

Get the associated unit number of a board.

This routine gets the associated unit number of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameters are interpreted as board indices in the global list. Otherwise they are unit numbers on the local node.
Returns:
The board's associated unit number or index number, depending on the value of the global flag parameter, or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::aIndx, and fesBoard_s::aUnit.

Referenced by fesDataInfoGet().

int fesConfigBoardFind ( const char *  name,
int  global 
)

Find the board with a given name.

This routine finds the board which has the specified detector name.

Parameters:
name The address of the detector name to be found.
global If TRUE, the board's global index is returned. Otherwise its local unit number is returned.
Returns:
The board's global index or local unit number depending on the value of the global flag, or -1 if the name could not be located.

References fesBoard_s::name, and fesBoard_s::unit.

Referenced by fesDataDel(), and fesDataDisp().

const fesBoard_t* fesConfigBoardGet ( int  unit,
int  global 
)

Get complete information for a board.

This routine gets the full information for a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The address of the board's information, or NULL if the unit number or index was not in the allowed range.

int fesConfigCableGet ( int  unit,
int  global 
)

Get the control cable number of a board.

This routine gets the control cable number of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's control cable number, or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::cCable.

int fesConfigCtlIndexGet ( void   ) 

Get the index of the control board.

This routine gets the index of the system-wide control board, if present.

Returns:
The index of the control board, if there is one in the whole system, or -1 if there isn't.

Referenced by fesXctlInit().

int fesConfigCtlUnitGet ( void   ) 

Get the unit number of the control board.

This routine gets the unit number of the local control board, if present.

Returns:
The unit number of the control board, if there is one on the local node, or -1 if there isn't.

int fesConfigDiskGet ( int  unit,
int  global 
)

Get the disk number of a board.

This routine gets the disk number of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's disk number, or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::disk.

Referenced by fesDataDel(), fesDataDisp(), fesDataInfoGet(), fesDataJoin(), fesDataLoad(), and fesDataRename().

const int* fesConfigFifoGet ( int  unit,
int  global 
)

Get the FIFO cable map of a board.

This routine gets the FIFO cable map of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The address of the board's FIFO cable map, or NULL if the unit number or index was not in the allowed range.

References fesBoard_s::fifo.

int fesConfigHwUnitGet ( int  unit  ) 

Get the hardware unit number of a board.

This routine gets the hardware unit number of a configured FES board.

Parameters:
unit The unit number of the board on the local node.
Returns:
The board's hardware unit number, or -1 if the unit number was not in the allowed range.

References fesBoard_s::hwUnit.

int fesConfigIdFind ( int  id,
int  global 
)

Find the board with a given ID.

This routine finds the board which has the specified board ID.

Parameters:
id The ID of the board to be found.
global If TRUE, the board's global index is returned. Otherwise its local unit number is returned.
Returns:
The board's global index or local unit number depending on the value of the global flag, or -1 if the ID could not be located.

References fesBoard_s::id, and fesBoard_s::unit.

int fesConfigIdGet ( int  unit,
int  global 
)

Get the ID number of a board.

This routine gets the ID number of a configured FES board. This is a number in the range 0-40 which uniquely identifies the board as follows: 0-15: tracker 0-15; 16-31: calorimeter 0-15; 32-39: ACD 0-7; 40: control.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's ID number, or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::id.

Referenced by fesDataGen(), fesDataGenPedes(), fesDataGenTrig(), fesDataInfoGet(), fesDataJoin(), fesDataLoad(), and fesDataRename().

int fesConfigIndexGet ( int  unit,
int  global 
)

Get the global index of a board.

This routine gets the global index of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's global index, or -1 if the unit number or index was not in the allowed range.

int fesConfigInit ( const char *  file  ) 

Initialize configuration data.

This routine reads the FES configuration file (in XML format) to obtain the configuration information about all the FES boards in the whole system. It also matches the board information for the local node with the actual hardware present.

Parameters:
file The address of the name of the configuration file to use. If NULL or if the name is null, the name defaults to Fes_Config.xml.
Return values:
FES_SUCCESS Success.
FES_NOCONFIG Unable to open configuration file.
FES_CONFGERR Error parsing configuration file.
FES_NOHOSTNM Unable to obtain host name.
FES_DUPLHWID Multiple boards found with the same ID.
FES_FPGAFAIL An error occurred during FPGA loading.
FES_FPGANRDY FPGAs not ready for loading.

References fesBoard_s::acdCbl, fesBoard_s::acdPath, fesBoard_s::aIndx, fesBoard_s::aTower, fesBoard_s::aUnit, fesBoard_s::disk, FES_DEV_TYP_ACD, FES_DEV_TYP_UNK, FES_NUM_SIDES, fesBoard_s::hwUnit, fesBoard_s::node, fesBoard_s::tower, fesBoard_s::type, and fesBoard_s::unit.

Referenced by fesXctlInit().

const char* fesConfigNameGet ( int  unit,
int  global 
)

Get the detector name of a board.

This routine gets a board's detector name given its global index.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The address of the detector's name, or NULL if the unit number or index was not in the allowed range.

References fesBoard_s::name.

Referenced by fesDataInfoGet(), fesDataJoin(), fesDataLoad(), fesDataRename(), and fesXctlRunStatShow().

int fesConfigNBoardGet ( int  global  ) 

Get the number of configured boards.

This routine gets the number of configured FES boards, either for the local node, or for the whole system.

Parameters:
global If TRUE, causes the global number of boards to be returned. Otherwise only the number on the local node is returned.

Referenced by fesDataGen(), fesDataGenPedes(), fesDataGenTrig(), fesDataInfoGet(), fesDataJoin(), fesDataLoad(), and fesDataRename().

const char* fesConfigNodeGet ( int  unit,
int  global 
)

Get the node name of a board.

This routine gets the node name of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The address of the board's node name, or NULL if the unit number or index was not in the allowed range.

References fesBoard_s::node.

Referenced by fesDataDel(), fesDataDisp(), fesDataGen(), fesDataGenPedes(), fesDataGenTrig(), fesDataInfoGet(), fesDataLoad(), fesDataRename(), and fesXctlInit().

int fesConfigPrimaryGet ( int  unit,
int  global 
)

Get primary flag for a board.

This routine gets a board's primary flag. This flag is TRUE if the board has no associated board or if the board appears in the description file before its associated board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's primary flag, or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::aUnit, and fesBoard_s::unit.

Referenced by fesDataDel(), fesDataDisp(), fesDataGen(), fesDataGenPedes(), fesDataGenTrig(), fesDataInfoGet(), fesDataJoin(), fesDataLoad(), and fesDataRename().

int fesConfigTowerGet ( int  unit,
int  global 
)

Get the tower number of a board.

This routine gets the tower number of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's tower number, or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::tower.

int fesConfigTypeGet ( int  unit,
int  global 
)

Get the type of a board.

This routine gets the type of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's type, or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::type.

Referenced by fesDataGen(), fesDataGenPedes(), fesDataGenTrig(), fesDataInfoGet(), fesDataJoin(), fesDataLoad(), fesDataRename(), and fesXctlRunStatShow().

const char* fesConfigTypeNameGet ( int  unit,
int  global 
)

Get the type name of a board.

This routine gets the type name of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The address of the board's type name or NULL if the unit number or index was not in the allowed range.

References fesBoard_s::tName.

int fesConfigUnitGet ( int  unit,
int  global 
)

Get the unit number of a board.

This routine gets the unit number of a configured FES board.

Parameters:
unit The unit number of the board on the local node, or its index in the system-wide board list, depending on the value of the global flag parameter.
global If TRUE, the unit parameter is interpreted as the index of the board in the global list. Otherwise it is the unit number on the local node.
Returns:
The board's unit number, or -1 if the unit number or index was not in the allowed range.

References fesBoard_s::unit.


Generated on Sat Apr 9 19:57:46 2011 by  doxygen 1.5.8