CCCUSBReadoutList

Name

CCCUSBReadoutList -- Create lists of CAMAC commands for CC-USB controllers.

Synopsis


            class CCCUSBReadoutList {          
           
   CCCUSBReadoutList();
              CCCUSBReadoutList(const CCCUSBReadoutList& rhs);
            
  const std::vector<uint16_t> get();
              const size_t size();
              void clear();
              void addWrite16(int n, int a, int f, uint16_t data);
              void addWrite24(int n, int a, int f, uint32_t data);
              void addRead16(int n, int a, int f, bool lamWait = false);
           
              void addRead24(int n, int a, int f, bool lamWait = false);
              void addControl(int n, int a, int f);
              void addQStop(int n, int a, int f, uint16_t max, bool lamWait = false);
              void addQStop24(int n, int a, int f, uint16_t max, bool lamWait = false);
              void addQScan(int n, int a, int f, uint16_t max, bool lamWait = false);
              void addRepeat(int n, int a, int f, bool lamWait = false);
              void addMarker(uint16_t value);
           };
        

DESCRIPTION

CCCUSBReadoutList provides a class whose instances can build up lists (stacks) of CAMAC operations that can either be submitted to a CC-USB for direct execution via CCCUSB::executeList, or loaded as an event or scaler stack via CCCUSB::loadStack.

METHODS

CCCUSBReadoutList();

Constructs a new readout list.

CCCUSBReadoutList(const CCCUSBReadoutList& rhs);

Constructs a readout list that will be a duplicate of the readout list in rhs (Copy construction).

const std::vector<uint16_t> get();

Returns a std::list<uint16_t> where each element of the list is a stack line that has been built up so far.

const size_t size();

Returns the number of uint16_t stack lines built so far.

void clear();

Clears the stack. Once this is performed, the object represents an empty stack.

void addWrite16(int n, int a, int f, uint16_t data);

Adds a 16 bit CAMAC write opearation to the list. n,a,f specify the slot, subaddress and function code respectively. The data parameter is transferred to the device when the command is executed. Note that this method does not perform any CAMAC operations. The specified operation is simply encoded as stack lines in the object.

void addWrite24(int n, int a, int f, uint32_t data);

Same as addWrite16 however the least significant 24 bits of data will be written when this stack line is executed.

void addRead16(int n, int a, int f, bool lamWait = false);

A 16 bit read operation whose slot, subaddress and function code are specified by n,a,f is encoded as a stack line and added to the list. If the stack line is executed in immediate mode (via CCCUSB::executeList), the data read will be put in the input buffer passed to that method. IF the stack line loaded as a scaler or event stack asnd executed in response to the appropriate trigger condition, the data are put in the event buffer.

If the lamWait parameter is true the stack will stall until either the lam timeout period is reached or the slot the operation is directed to signals its LAM.

void addRead24(int n, int a, int f, bool lamWait = false);

Same as addRead16, however a uint32_t is put in the buffer (event or buffer given to CCCUSB::executeStack depending on why the stack is being executed). The format of the uint32_t is shown in the figure just at the end of chapter 4 of the CC-USB manual: The bottom 24 bits are the data transferred from the module. Bit 24 is set if there was a Q response and bit 25 is set if there was an X response (bits are numbered from 0 least significant bit is bit 0).

void addControl(int n, int a, int f);

Adds a non data transfer operation to the stack.

void addQStop(int n, int a, int f, uint16_t max, bool lamWait = false);

Adds a Q-stop block transfer to the stack. Q-stop operations perform the same n,a,f read operation until either the module does not return a Q response or until the max number of transfers specified have been performed. The lamWait parameter allows you to wait for a LAM from the targe module before doing the transfer.

void addQStop24(int n, int a, int f, uint16_t max, bool lamWait = false);

Same as addQStop except that 24 bits of data are transferred on each operation.

void addQScan(int n, int a, int f, uint16_t max, bool lamWait = false);

Performs a Q-scan (sometimes called an address scan) operation. n,a,f specify a starting slot, subaddress and function code. After each operation a is incremented. The CC-USB documentation does not make it clear if this is a full Q-Scan (ACA) operation as defined by the ESONE block transfer specification. If this operation is a full address scan, then after each operation, the subaddress is incremented. If A was 15 or a Q=0 response occured, the subaddress should be set to 0 and the slot incremented. This continues until either max transfers have occured or both Q and X are zero.

The documentation only describes the subadress as being incremented so that may be all you can count on for this opertaion. It also does not provide a statement about what happens when Q=0 or X=0.

void addRepeat(int n, int a, int f, uint16_t max, bool lamWait = false);

Performs a block repeat operation. The specified CAMAC operation is performed max times regardless of the X/Q responses.

void addMarker(uint16_t value);

The literal word value is written to the output buffer.

SEE ALSO

CCCUSB(3ccusb)