CSIS3600

Name

CSIS3600 -- Support for the SIS 3600 VME latch module.

Synopsis


#include <CSIS3600.h>
            
 class CSIS3600 {

  CSIS3600(unsigned long base, int crate = 0)
          throws std::string;

  void Reset();
  const void LightLed();
  const void ClearLed();
  const bool isLedLit();
  const void SetLatchMode();
  const void SetCoincidenceMode();
  const bool isLatchMode();
  const void EnableExternalClear();
  const void DisableExternalClear();
  const bool ExternalClearEnabled();
  const void EnableExternalNext();
  const void DisableExternalNext();
  const bool ExternalNextEnabled();
  void SetFastClearWindow(int ns);
  const int GetFastClearWindow();
  const void Enable();
  const void Disable()();
  const void Clock();
  const void StartLatch();
  const void EndLatch();
  const bool DataReady();
  const void ClearData();
  const unsigned long Read()
          throws throws std::string;
  const unsigned int Read(void* pBuffer, int nLongs);
}

Description

This class provides low level support for the SIS 3600 multievent latch. The module can act either as a pure latch or as a coincidence register. A latch stores the inputs presented to it on the falling edge of a gate while coincidence registers, store 1's for all inputs that have had true values for the duration of the input gate.

Public member functions

CSIS3600(unsigned long base, int crate);

Creates an instance of a CSIS3600 class. This object will allow you to manipulate the SIS 3600 module that has the base address base in VME crate number crate. If the crate is not supplied, it defaults to 0 which is suitable for single crate systems.

void Reset(void);

Performs a module soft reset.

void LightLed(void);const

Turns on the U led on the module. This LED is available for application specific signalling.

void ClearLed(void);const

Turns off the U led on the module.

bool isLedLit(void);const

Returns true if the U LED is lit.

void SetLatchMode(void);const

Requests that the module operate in latch mode. In latch mode, inputs that are asserted will be transferred to the event memory when the next event signal transitions to asserted. See also SetCoincidenceMode.

void SetCoincidenceMode(void);const

Places the module in coincidence mode. In coincidence mode, signals that are asserteed during the length the gate is present are transmitted to the event memory as one, otherwise as zero.

bool isLatchMode(void);const

Returns true if the module has been set in latch mode. If the module is in coincidence mode, this will return false.

void EnableExternalClear(void);const

Enables the external fast clear input. This is used in conjunction with the fast clear window to allow events to be rejected prior to transferring them to the fifo. A fast clear signal that arrives within the fast clear window of the end(?) of the gate discards the event prior to transfer.

void DisableExternalClear(void);const

Disables the module external fast clear input. Transitions to asserted on this line will have no impact on the operation of the module, regardess of their timing relative to the fast clear window.

bool ExternalClearEnabled(void);const

Returns true if the external fast clear is enabled.

void EnableExternalNext(void);const

Enables the external next input to act either as a latch or coincidence window depending on the mode of the module.

void DisableExternalNext(void);const

Disables the external next input. When external next is disabled, data can only be latched by a programmatic latch.

bool ExternalNextEnabled(void);const

Returns true if the external next signal is enabled.

void SetFastClearWindow(int ns);

Sets the fast clear window in nano seconds. Note that there is a granularity to the fast clear window width. See section 7.4 of the SIS 3600 manual.

int GetFastClearWindow(void);const

Returns the value of the fast clear window in ns. Due to the granularity of the fast clear window, it's not strange to set a fast clear window and then ask the card what the fast clear window actually turned out to be.

void Enable(void);const

Enables the module's ability to clock in new events.

void Disable()(void);const

Disables the module's ability to clock in new events.

void Clock(void);const

Clocks in the next event. If the module is in latch mode, it is pretty easy to see that the data presented to the module at the time the function is called is loaded into the FIFO as the next event. It is not clear from the manual documentation what it means to call this whe the module is in coincidence mode. My guess is that there is a finite width to the internal clock generated by this function, and the width of that signal determines the coincidence window.

void StartLatch(void);const

Begins a latch operation. In coincidence mode this allows a (long) software timed coincidence window to be programmed. Calling this starts the window.

void EndLatch(void);const

Ends a software timed latch (load next event) window.

bool DataReady(void);const

Returns true if the module has data in its FIFO.

void ClearData(void);const

Clears any data that may be hanging around in the FIFO.

unsigned long Read(void);const

Reads an event (one longword) from the FIFO of the module and returns it as the function value. If there are no events in the FIFO, the function throws an exception of type std::string.

unsigned int Read(void* pBuffer, int nLongs);const

Reads at most nLongs from the event FIFO to the buffer pointed to by pBuffer. Returns the number of longwords that were actually read. This can be less than nLongs or even 0 if there fewer than nLongs in the module's FIFO

Exceptions

For various errors, std::string exceptions are thrown. The exception contents are error messages so it's reasonable to say:


try {
   …   // Calls to CSIS 3600 stuff.
}
catch (std::string msg) {
   cerr << "String error caught " << msg << endl;
   exit(-1);
}