7 std::ostringstream message;
20 {10,
"Extract Trigger Veto Disabled",
"Extract Trigger Veto Enabled" },
21 {9,
"50Hz Veto Disabled",
"50Hz Veto Enabled" },
22 {8,
"Internal Period Clock Mode",
"External Period Clock Mode" },
23 {7,
"",
"Multiple Period sequence complete" },
24 {6,
"Single period sequence mode",
"Multiple period sequence mode" },
25 {5,
"Internal period control mode",
"External period control mode" },
26 {4,
"Non-period mode",
"Period mode"},
27 {3,
"",
"Run ended AND period sequence completed" },
28 {2,
"",
"Period sequence complete" },
29 {1,
"",
"End after period sequence complete has been requested" },
38 os <<
"This is an PERIOD card" << std::endl;
41 os <<
"Number of periods = " << nper << std::endl;
43 os <<
"Period sequence number = " << value16 << std::endl;
45 os <<
"Extract trigger veto count = " << value32 << std::endl;
47 os <<
"Summary of period control register" << std::endl;
50 if (value16 & (1 << mode_list[i].bit))
52 os <<
"Bit " << mode_list[i].
bit <<
" is SET (" << mode_list[i].
set <<
")" << std::endl;
56 os <<
"Bit " << mode_list[i].
bit <<
" is CLEAR (" << mode_list[i].
unset <<
")" << std::endl;
64 readPERLUT(dwell_flags, frames_needed, nper, status);
68 os <<
"Summary of period card programming (1st 16 max)" << std::endl;
69 for(i=0; i< (nper < 16 ? nper : 16); i++)
71 os <<
"Period " << i << (dwell_flags[i] != 0 ?
" (DWELL)" :
" (DAQ)") << std::endl;
72 os <<
"\tRequested frames = " << frames_needed[i] <<
" logic signal output = 0x" << std::hex << outputs[i] << std::dec << std::endl;
73 os <<
"\tCurrent counters (should always be ZERO for DWELL): raw = " << raw_frames[i] <<
" good = " << good_frames[i] << std::endl;
75 delete[] frames_needed;
80 readRegister(
MAT_1, &value32, status); os <<
"Matt's 0x4 register = " << std::hex << value32 << std::dec << std::endl;
155 return ((period & (1 << 14)) != 0);
277 for(i=0; i<nperiod; i++)
281 pdata[i] = ((frames[i] - 1) & 0xffff) + (dwell_flags[i] != 0 ? (1 << 31) : 0);
285 pdata[i] = ((frames[i]) & 0xffff) + (dwell_flags[i] != 0 ? (1 << 31) : 0);
303 for(i=0; i<nperiod; i++)
305 frames[i] = (
isisU16_t)((pdata[i] & 0xffff) + 1);
306 dwell_flags[i] = ( (pdata[i] & (1 << 31)) ? 1 : 0 );
336 for(i=0; i<nperiod; i++)
338 outputs[i] &= 0xffff;
371 for(i=0; i<nperiod; i++)
373 frames[i] = ((frames[i] & 0xffff) + 1);
int setMultiplePeriodSequenceMode(DAEstatus &status)
int lookupAccessOUTLUT(DAEstatus &status)
int startDataCollection(DAEstatus &status)
int setPeriodControlBits(isisU32_t mask, bool preserve, DAEstatus &status)
int setInternalPeriodControlMode(DAEstatus &status)
int getExtractTriggerVetoCount(isisU32_t *value, DAEstatus &status)
int getCurrentPeriodSequence(DAEstatus &status)
int programPERLUT(isisU16_t *dwell_flags, isisU16_t *frames, int nperiod, DAEstatus &status)
int enableExtractTriggerVeto(DAEstatus &status)
int readPERLUT(isisU16_t *dwell_flags, isisU16_t *frames, int nperiod, DAEstatus &status)
int setRegisterBits(unsigned long address, isisU32_t mask, bool preserve, DAEstatus &status, bool little_endian=false)
int endRunAfterSequenceCompletes(DAEstatus &status)
int lookupAccessPERLUT(DAEstatus &status)
int setSinglePeriodSequenceMode(DAEstatus &status)
int getNumberOfPeriods(DAEstatus &status)
int stopDataCollection(DAEstatus &status)
int disable50HzVeto(DAEstatus &status)
int disableExtractTriggerVeto(DAEstatus &status)
int zeroPeriodFrameCounters(DAEstatus &status)
int clearRegisterBits(unsigned long address, isisU32_t mask, DAEstatus &status, bool little_endian=false)
virtual void printStatus(std::ostream &os, DAEstatus &dstatus)
int getPeriodGoodFrames(int period, isisU32_t *frames, DAEstatus &status)
void abortSequenceCompleteWait(DAEstatus &status)
int enablePeriodMode(DAEstatus &status)
int readOUTLUT(isisU32_t *outputs, int nperiod, DAEstatus &status)
int setAndClearPeriodControlBits(isisU32_t mask, bool preserve, DAEstatus &status)
int readMemory(unsigned long address, typename T *buffer, int len, ISISVME::TransferProps props, DAEstatus &status)
int writeRegister(unsigned long address, isisU32_t value, DAEstatus &status, bool little_endian=false)
int clearVetoCounters(DAEstatus &status)
PeriodCard(int position, ISISVME *vme, DAEstatus &status)
int enable50HzVeto(DAEstatus &status)
int getPeriodRawFrames(int period, isisU32_t *frames, DAEstatus &status)
int readRegister(unsigned long address, isisU32_t *value, DAEstatus &status, bool little_endian=false, bool retry=true)
int setAndClearRegisterBits(unsigned long address, isisU32_t mask, bool preserve, DAEstatus &status, bool little_endian=false)
int clearPeriodControlBits(isisU32_t mask, DAEstatus &status)
int disablePeriodMode(DAEstatus &status)
void printStatus(std::ostream &os, DAEstatus &status)
int getExtractTriggerVetoCountHigh(isisU16_t *value, DAEstatus &status)
int lookupFinished(DAEstatus &status)
int getRawFrames(int period_start, int nperiod, isisU32_t frames[], DAEstatus &status)
int getGoodFrames(int period_start, int nperiod, isisU32_t frames[], DAEstatus &status)
int setNumberOfPeriods(isisU16_t n, DAEstatus &status)
bool isRunEndedAndSequenceComplete(DAEstatus &status)
int clearPeriodCounters(DAEstatus &status)
int setExternalPeriodClockMode(DAEstatus &status)
int writeMemory(unsigned long address, T *buffer, int len, uint64_t read_check_mask, ISISVME::TransferProps props, DAEstatus &status)
bool inDwellPeriod(DAEstatus &status)
int programOUTLUT(isisU32_t *outputs, int nperiod, DAEstatus &status)
int resetCard(DAEstatus &status)
int writeRegister16(unsigned long address, isisU16_t value, DAEstatus &status, bool little_endian=false)
int getPeriodRequestedFrames(int period, isisU32_t *frames, DAEstatus &status)
int getExtractTriggerVetoCountLow(isisU16_t *value, DAEstatus &status)
int getCurrentPeriodNumber(DAEstatus &status)
int readRegister16As32(unsigned long address0, unsigned long address1, isisU32_t *value, DAEstatus &status, bool little_endian=false)
int setExternalPeriodControlMode(DAEstatus &status)
int addInfo(int facility, const std::string &text)
static const period_modes mode_list[]
int zeroMemory(unsigned long start, int len, uint64_t read_check_mask, ISISVME::TransferProps props, DAEstatus &status)
int getRequestedFrames(int period_start, int nperiod, isisU32_t frames[], DAEstatus &status)
int setInternalPeriodClockMode(DAEstatus &status)