CBD8210

Name

CBD8210 -- CES CBD 8210 CAMAC branch highway driver (obsolete)

Synopsis


#include <CBD8201.h>
       
 class CBD8210 : public CCamacModule {

  CBD8210(int branch);

  const bool Xtest();
  const bool Qtest();
  const bool TimedOut();
  const bool BranchDemand();
  void MNoX(bool fSet = true);
  void MTo(bool fSet = true);
  void MLAM(bool fSet = true);
  void MIT2(bool fSet = true);
  void MIT4(bool fSet = true);
  void MIT4(bool fSet = true);
  const bool IT2();
  const bool IT4();
  const unsigned short ReadCsr();
  void WriteCsr(unsigned short nMask);
  void WriteIFR(unsigned short nMask);
  const unsigned short ReadBTB();
  const unsigned long ReadGl();
  const void InitBranch();
}

DESCRIPTION

The CBD8210 class encapsulates the functions offered by the register set of the CES CBD8210 VME CAMAC parallel branch driver module. This module is an obsolete module. Newer applications should use the Wiener VC32/CC32 module pair, or better yet, phase out of CAMAC altogether.

Since this class is derived from legacy support where only a single VME crate was allowed, multiple VME crate support is a bit whacky. Each VME crate can have up to 8 branches. The branch number is determined by: vme_crate*8 + branch_selector where vme_crate is the VME crate number the CES CBD8210 is installed in and branch_selector is the branch number selected on the module's front panel.

Public member functions

CBD8210(unsigned int b);

Constructor, creates a new CBD8210 module for branch number b. See DESCRIPTION above for more information about the branch number.

bool Xtest(void);const

Tests the X response of the last operaration on this branch. An X response is true if the addressed module has accepted the function. Usually this is the case if there is a live module at the addressed location.

bool Qtest(void);const

Checks the Q response of the last operation. The Q response is used for two purposes in general. If the operation is not a test, the Q indicates successful completion of the operation, otherwise it indicates the result of the test. For example, a module may not accept some functions int the busy state. Q may be false if one such function was attempted and the module was busy. For example: most modules have function codes for testing their LAM (Look At Me). These functions will return Q true if the LAM is active, and false otherwise.

bool TimedOut(void);const

Returns true if the last operation on this branch timed out. In general this can only happen if the CAMAC crate being addressed was off, or unplugged from the branch highway, or has a failing controller.

bool BranchDemand(void);const

Returns true if there's a branch demand present. Branch demands are used to indicate the presence of a LAM in a CAMAC crate on the branch that has its LAM added to the set of graded LAM demands.

void MNoX(bool fSet=true);

Sets/clears the controller's MNOX bit in the control/status register according to the value of fSet. Normally, the branch highway driver will interrupt if an operation is performed and an X is not present. Setting this bit prevents that interrupt.

void MTo(bool fSet=true);

This sets or clears the MTO bit in the control/status register of the module. When MTO is clear, branch timeouts result in an interrupt, when set, this interrupt is inhibited.

void MLAM(bool fSet=true);

Sets or clears the MLAM bit in the module's control/status register. according to the value of fSet. If this bit is clear, Branch Demands (LAMs from a crate) will result in a VME bus interrupt. If set, interrupts will not occur.

void MIT2(bool fSet=true);

Sets or clears the MIT2 bit in the module control/status register according to the value of fSet. If the bit is clear, a NIM pulse on the IT2 input of the module results in a VME interrupt. If set, no interrupt is generated. Note that the pulse latches a status bit which can be read via IT2.

void MIT4(bool fSet=true);

Sets or clears the control status register's MIT4 bit according to the state of fSet When clear, the IT4 input causes an interrupt. When set, IT4 does not cause an interrupt, but latches a status bit that can be read via the IT4 function.

bool IT4(void);const

Tests the state of the IT4 bit in the interrupt status register. If an IT4 input has been latched this will return true otherwise false. To clear the latched IT4 status, you must write the IT4 bit to the IFR (see WriteIFR).

unsigned short ReadCsr(void);const

Reads the contents of the module control status register. See the manual for the CBD 8210 for information about the layout of this register.

void WriteCsr(unsigned short nMask);

Writes nMask to the module control status register. See the hardware manual for the module for more information about the layout of this register.

void WriteIFR(unsigned short nMask);

Writes the nMask parameter to the module's IFR register. The layout of this register is documented in the CES CBD8210 hardware manual. Note, however that this register is used to clear latched IT2 and IT4 inputs.

unsigned short ReadBTB(void);const

Reads the branch timing register from the module. The BTB register is a bit mask with a bit for each crate. It allows you to determine which crates are on/offline.

unsigned long ReadGl(void);const

Reads the graded LAM mask for the branch. See the CES CBD8210 manual for more information about graded lams and the layout of this register.

void InitBranch(void);const

Performs a Branch Zero (BZ) on the branch.

Examples

The example below access branch 0, and does a BZ:

Example 1. Initializing branch 0


#include <CBD8210.h>
…
   CBD8210 branch0(0);
   branch.InitBranch();
…
                    

SEE ALSO

The CES CBD 8210 hardware manual (online at the NSCL at: http://groups.nscl.msu.edu/nscl_library/manuals/ces/8210_v20.pdf