CCAENV830 Class Reference

#include <CCAENV830.h>

List of all members.

Public Types

enum  _TriggerMode { Disabled, Random, Periodic }
typedef enum CCAENV830::_TriggerMode TriggerMode

Public Member Functions

 CCAENV830 (int slot, int crate=0, bool geo=true, unsigned long base=0) throw (STD(string))
 ~CCAENV830 ()
int getCrate () const
int getSlot () const
int getModuleType () const
int getFirmware () const
int getSerial () const
void setCrate (int crate)
void setSlot (int slot)
void setModuleType (int type)
void setFirmware (int fwRev)
void Enable (int nChannel) throw (STD(string))
void Disable (int nChannel) throw (STD(string))
void SetEnableMask (int nMask)
void SetDwellTime (int n400ns)
void SetTriggerMode (TriggerMode mode) throw (STD(string))
void SetWide ()
void SetNarrow ()
void EnableHeader ()
void DisableHeader ()
void FPClearsMEB (bool state)
void EnableAutoReset ()
void DisableAutoReset ()
bool isDataReady ()
bool isAlmostFull ()
bool isFull ()
bool isGlobalDready ()
bool isGlobalBusy ()
void Reset ()
void Clear ()
void Trigger ()
void SetTriggerCounter (int n)
void SetAlmostFullLevel (int n)
int GetMEBEventCount ()
int ReadEvent (void *pBuffer)
int ReadEvent (DAQWordBufferPtr &rBufferPtr)
int ReadEvent (DAQWordBuffer &rBuffer, int nOffset)
int ReadCounter (int nChannel)

Protected Member Functions

void ComputeEventSize ()
void MapModule () throw (STD(string))
void InitModule ()
void UnmapModule ()

Private Member Functions

 CCAENV830 (const CCAENV830 &rhs)
CCAENV830operator= (const CCAENV830 &rhs)
int operator== (const CCAENV830 &rhs) const
int operator!= (const CCAENV830 &rhs) const

Private Attributes

int m_nCrate
int m_nSlot
int m_nEventLength
int m_nBase
CVmeModulem_pModule
int m_nModuleType
int m_nSerialno
int m_nFirmware
bool m_fGeo


Detailed Description

Encapsulates the readout driver for a CCAENV820 scaler. In this case the scaler is intended to be readout as part of an

Definition at line 315 of file CCAENV830.h.


Member Typedef Documentation

typedef enum CCAENV830::_TriggerMode CCAENV830::TriggerMode


Member Enumeration Documentation

enum CCAENV830::_TriggerMode

Enumerator:
Disabled 
Random 
Periodic 

Definition at line 319 of file CCAENV830.h.


Constructor & Destructor Documentation

CCAENV830::CCAENV830 ( int  slot,
int  crate = 0,
bool  geo = true,
unsigned long  base = 0 
) throw (STD(string))

Make a new CCAENV830 module. This involves:

Definition at line 353 of file CCAENV830.cpp.

CCAENV830::~CCAENV830 (  ) 

Destroy a VME module:

Definition at line 375 of file CCAENV830.cpp.

References UnmapModule().

CCAENV830::CCAENV830 ( const CCAENV830 rhs  )  [private]


Member Function Documentation

CCAENV830& CCAENV830::operator= ( const CCAENV830 rhs  )  [private]

int CCAENV830::operator== ( const CCAENV830 rhs  )  const [private]

int CCAENV830::operator!= ( const CCAENV830 rhs  )  const [private]

int CCAENV830::getCrate (  )  const [inline]

Definition at line 360 of file CCAENV830.h.

References m_nCrate.

int CCAENV830::getSlot (  )  const [inline]

Definition at line 363 of file CCAENV830.h.

References m_nSlot.

int CCAENV830::getModuleType (  )  const [inline]

Definition at line 366 of file CCAENV830.h.

References m_nModuleType.

int CCAENV830::getFirmware (  )  const [inline]

Definition at line 369 of file CCAENV830.h.

References m_nFirmware.

int CCAENV830::getSerial (  )  const [inline]

Definition at line 373 of file CCAENV830.h.

References m_nSerialno.

void CCAENV830::setCrate ( int  crate  )  [inline]

Definition at line 379 of file CCAENV830.h.

References m_nCrate.

void CCAENV830::setSlot ( int  slot  )  [inline]

Definition at line 382 of file CCAENV830.h.

References m_nSlot.

void CCAENV830::setModuleType ( int  type  )  [inline]

Definition at line 385 of file CCAENV830.h.

References m_nModuleType.

void CCAENV830::setFirmware ( int  fwRev  )  [inline]

Definition at line 388 of file CCAENV830.h.

References m_nFirmware.

void CCAENV830::Enable ( int  nChannel  )  throw (STD(string))

Enable an individual channel of the module:

Parameters:
nChannel (in): Number of channel to turn on [0-31].

Definition at line 392 of file CCAENV830.cpp.

References GetLong, and ThrowIfBadChannel().

void CCAENV830::Disable ( int  nChannel  )  throw (STD(string))

Disable an individual channel of the module:

Parameters:
nChannel (in): Number of channel to turn on [0-31]

Definition at line 406 of file CCAENV830.cpp.

References GetLong, and ThrowIfBadChannel().

void CCAENV830::SetEnableMask ( int  nMask  ) 

Set the module enable register. This sets the state of all the channel enables according to the mask parameter.

Parameters:
nMask (in): Mask of channel enables.

Definition at line 421 of file CCAENV830.cpp.

References ComputeEventSize(), and PutLong.

Referenced by InitModule().

void CCAENV830::SetDwellTime ( int  n400ns  ) 

Set the dwell time. In periodic trigger mode, this is the length of time the module counts between latching triggers.

Parameters:
n400ns [in]: The number of 400ns clock ticks to count between periodic triggers.
Note:
If the module is not in periodic trigger mode, the dwell time is ignored. It is not an error to set this value if that is the case however since we don't want to impose a programming order on the client.

Definition at line 440 of file CCAENV830.cpp.

References PutLong.

void CCAENV830::SetTriggerMode ( CCAENV830::TriggerMode  mode  )  throw (STD(string))

Set the trigger mode:

Parameters:
mode (in): The desired trigger mode. This can be one of:
  • CCAENV830::TriggerMode::Disabled The module is never triggered.
  • CCAENV830::TriggerMode::Random The module is triggered via VME command or by front panel input.
  • CCAENV830::TriggerMode::Periodic - The module is periodically triggerred as determined by the dwell time (see SetDwellTime).

Definition at line 458 of file CCAENV830.cpp.

References CSRAcqDisable, CSRAcqMode, CSRAcqPeriodic, CSRAcqRandom, GetShort, PutShort, and ThrowIntString().

Referenced by InitModule().

void CCAENV830::SetWide (  ) 

Set the scaler readout format to wide mode. This drops channel labelling information off the event... it then becomes the user's responsibility to know which channel is which in the otput stream. Use with caution, and only if 26 bits of scaler information is not sufficient.

Definition at line 489 of file CCAENV830.cpp.

References CSRFormat, and PutShort.

void CCAENV830::SetNarrow (  ) 

Set the scaler readout format to narrow mode. This adds channel labelling information to each channel. It is best used when you have enabled a noncontiguous set of channels and the counts range of 26 bits is adequate for your application. Note that 26 bits gives somewhat more than 64Million counts before overflowing.

Definition at line 501 of file CCAENV830.cpp.

References CSRFormat, and PutShort.

Referenced by InitModule().

void CCAENV830::EnableHeader (  ) 

Enable the inclusion of a scaler header. When this feature is turned on, the scaler will include header information that includes:

Definition at line 515 of file CCAENV830.cpp.

References ComputeEventSize(), CSRHeader, and PutShort.

Referenced by InitModule().

void CCAENV830::DisableHeader (  ) 

Disable the inclusion of a scaler header. When this feature is turned off, only the bare scaler channels will be read.

Definition at line 525 of file CCAENV830.cpp.

References ComputeEventSize(), CSRHeader, and PutShort.

void CCAENV830::FPClearsMEB ( bool  state  ) 

Controls the action of the front panel clear depending on the parameter:

Parameters:
state (bool in):
  • true - The multievent buffer is cleared as well as the counters by a front panel clear.
  • false- The counters are cleared but the multievent buffer is unmolested by a front panel clear.

Definition at line 540 of file CCAENV830.cpp.

References CSRFPClear, and PutShort.

Referenced by InitModule().

void CCAENV830::EnableAutoReset (  ) 

Enables automatic reset of the scalers on trigger. When this mode is set, each trigger clears the scalers after latching them.

Definition at line 556 of file CCAENV830.cpp.

References CSRAutoClr, and PutShort.

Referenced by InitModule().

void CCAENV830::DisableAutoReset (  ) 

Disables automatic reset of scalers on trigger. When this mode is set, triggers do not clear scalers after latching them.

Definition at line 566 of file CCAENV830.cpp.

References CSRAutoClr, and PutShort.

bool CCAENV830::isDataReady (  ) 

Checks the data ready bit in the status register.

Returns:
bool :
  • true - if there is at least one complete event in the MEB
  • false - if there is not a complete event in the MEB
Note:
The definition of a complete event depends on the state of the header enabled bit. If the header is enabled, as complete event is defined as a complete package of data associated with a trigger (header and all associated scaler channels. If header is disabled, a complete event is defined as any number of data words in the MEB. This definition makes the use of the module in multievent mode with headers disabled dangerous or useless (take your pick) in my opinion.

Definition at line 587 of file CCAENV830.cpp.

References GetShort, and STATUSDready.

Referenced by ReadEvent().

bool CCAENV830::isAlmostFull (  ) 

Checks the almost full bit in the module status register. This bit is normally used if the scaler is used in multi-event mode.

Returns:
bool :
  • true Indicates that the MEB contains at least a number of words equal to the value set with SetAlmostFullLevel.
  • false indicates there are less words (possibly 0!) than the value set with SetAlmostFullLevel

Definition at line 604 of file CCAENV830.cpp.

References GetShort, and STATUSAFull.

bool CCAENV830::isFull (  ) 

Checks the full bit in the status register. This bit is set when there is insufficient space in the MEB to allow the storage of the module's worst case event (33 longs). When the full bit is set, the module will no longer accept triggers until this condition is cleared either by reading data from the MEB or by clearing the MEB.

Returns:
bool :
  • true - The multievent buffer is full.
  • false - The multievent buffer is not full.

Definition at line 622 of file CCAENV830.cpp.

References GetShort, and STATUSFull.

bool CCAENV830::isGlobalDready (  ) 

Checks the global data ready bit. This is bit is set when the front panel control connector is bussed with other modules and at least one module on the bus has it's Dready set. In pure CAEN module systems, this can be used as a trigger condition.

Returns:
bool :
  • true - Global Dready is set.
  • false - Global Dready is not set.

Definition at line 639 of file CCAENV830.cpp.

References GetShort, and STATUSGDready.

bool CCAENV830::isGlobalBusy (  ) 

Checks the Global busy bit. The use of the global busy bit depends on whether or not the front panel control connector is bussed with other modules.

Definition at line 656 of file CCAENV830.cpp.

References GetShort, and STATUSGBusy.

void CCAENV830::Reset (  ) 

Resets the module. A reset restores the power up configuration of the module with the exception of:

Definition at line 672 of file CCAENV830.cpp.

References PutShort.

Referenced by InitModule().

void CCAENV830::Clear (  ) 

Peforms a software clear:

Definition at line 684 of file CCAENV830.cpp.

References PutShort.

Referenced by InitModule().

void CCAENV830::Trigger (  ) 

Provides a vme trigger fo the module Note that for this to have any effect, the module must be in random trigger mode.

Definition at line 693 of file CCAENV830.cpp.

References PutShort.

void CCAENV830::SetTriggerCounter ( int  n  ) 

Sets the current value of the trigger counter. When the header is enabled, the trigger counter appears in each event header.

Parameters:
n (int in): New value of the trigger counter.

Definition at line 705 of file CCAENV830.cpp.

References PutLong.

void CCAENV830::SetAlmostFullLevel ( int  n  ) 

Set the current almost full value.

Parameters:
n (int in): The bottom 16 bits of this value are set as the almost full level.

Definition at line 716 of file CCAENV830.cpp.

References PutShort.

int CCAENV830::GetMEBEventCount (  ) 

Get the total number of events in the MEB. This only means something if the module is not busy!!!!

Definition at line 725 of file CCAENV830.cpp.

References GetShort.

int CCAENV830::ReadEvent ( void *  pBuffer  ) 

Read Event: Reads the next event from the MEB. To do this we must:

Parameters:
pBuffer (void* out): The buffer into which the event will be read. This must be at least m_nEventLength long.
Returns:
int The number of words read from the module (m_nEventLenght * sizeof(long)/sizeof(short))
Note:
  • If data are not ready, no words are returned
  • This is optimized in the case where the interface has mapping capabilities.

Definition at line 903 of file CCAENV830.cpp.

References GetLong, isDataReady(), m_nBase, m_nEventLength, and m_pModule.

Referenced by ReadEvent().

int CCAENV830::ReadEvent ( DAQWordBufferPtr &  rBufferPtr  ) 

Read an event: A local buffer is created into which the event is read using the ReadEvent(void* pBuffer) member. This is then transferred into a DAQWordBuffer via a DAQWordBufferPtr.

Parameters:
rBufferPtr (DAQWordBufferPtr& rBufferPtr out): The daq buffer into which data are transferred.
Returns:
int Number of words read.

Definition at line 938 of file CCAENV830.cpp.

References m_nEventLength, and ReadEvent().

int CCAENV830::ReadEvent ( DAQWordBuffer &  rBuffer,
int  offset 
)

Read an event: A local buffer is created into which the event is read using the ReadEvent(void*) member. THis is then transferred into a DAQBuffer via a DAQWordBuffer and an offest.

Parameters:
rBuffer (DAQWordBuffer& out): The buffer into which the data are transferred.
Offset (int in): The offset into the buffer (in words) at which the data transfer will be made.
Returns:
int The number of words transferred.

Definition at line 968 of file CCAENV830.cpp.

References m_nEventLength, and ReadEvent().

int CCAENV830::ReadCounter ( int  nChannel  ) 

Read an individual instantaneous scaler channel.

Parameters:
nChannel (int in): Number of channel to read must be in the range [0,31].
Returns:
int Instantaneous value of the counter for the selected channel.
Exceptions:
string If nChannel is invalid, an explanatory string exception is thrown.

Definition at line 992 of file CCAENV830.cpp.

References GetLong, and msg.

void CCAENV830::ComputeEventSize (  )  [protected]

Figure out how many longwords are in an event. This value is the sum of:

Definition at line 862 of file CCAENV830.cpp.

References CSRHeader, GetLong, GetShort, and m_nEventLength.

Referenced by DisableHeader(), EnableHeader(), and SetEnableMask().

void CCAENV830::MapModule (  )  throw (STD(string)) [protected]

Map the vme module. This involves:

The CAEN Modules use the addressing convention that the Geographical VME address is slot << 19. We use the convention that these modules are then remapped to slot << 24.

Definition at line 746 of file CCAENV830.cpp.

References CVmeModule::a32d32, ADEREnable, CAENV830_PROMBASE, CVmeModule::geo, GetProm, GetShort, m_fGeo, m_nBase, m_nCrate, m_nFirmware, m_nModuleType, m_nSerialno, m_nSlot, m_pModule, PutShort, and ThrowIntString().

void CCAENV830::InitModule (  )  [protected]

Setup a module. The default setup is:

Definition at line 836 of file CCAENV830.cpp.

References Clear(), EnableAutoReset(), EnableHeader(), FPClearsMEB(), Random, Reset(), SetEnableMask(), SetNarrow(), and SetTriggerMode().

void CCAENV830::UnmapModule (  )  [protected]

Destroy any memory map held on the module:

Definition at line 877 of file CCAENV830.cpp.

References m_pModule.

Referenced by ~CCAENV830().


Member Data Documentation

int CCAENV830::m_nCrate [private]

Definition at line 327 of file CCAENV830.h.

Referenced by getCrate(), MapModule(), and setCrate().

int CCAENV830::m_nSlot [private]

Definition at line 328 of file CCAENV830.h.

Referenced by getSlot(), MapModule(), and setSlot().

int CCAENV830::m_nEventLength [private]

Definition at line 329 of file CCAENV830.h.

Referenced by ComputeEventSize(), and ReadEvent().

int CCAENV830::m_nBase [private]

Definition at line 330 of file CCAENV830.h.

Referenced by MapModule(), and ReadEvent().

CVmeModule* CCAENV830::m_pModule [private]

Definition at line 331 of file CCAENV830.h.

Referenced by MapModule(), ReadEvent(), and UnmapModule().

int CCAENV830::m_nModuleType [private]

Definition at line 332 of file CCAENV830.h.

Referenced by getModuleType(), MapModule(), and setModuleType().

int CCAENV830::m_nSerialno [private]

Definition at line 333 of file CCAENV830.h.

Referenced by getSerial(), and MapModule().

int CCAENV830::m_nFirmware [private]

Definition at line 334 of file CCAENV830.h.

Referenced by getFirmware(), MapModule(), and setFirmware().

bool CCAENV830::m_fGeo [private]

Definition at line 335 of file CCAENV830.h.

Referenced by MapModule().


The documentation for this class was generated from the following files:
Generated on Wed Sep 17 08:38:11 2008 for NSCL Device support. by  doxygen 1.5.1