Changeset 10099 for fact/FADctrl/FAD.cc


Ignore:
Timestamp:
01/11/11 14:44:34 (12 years ago)
Author:
ogrimm
Message:
Corrupt events (wrong start-package flag) are removed from internal buffer
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/FADctrl/FAD.cc

    r10098 r10099  
    5757  MainThread = pthread_self();
    5858  Mode = idle;
    59   EventUpdateDelay = atof(GetConfig("EventUpdateDelay", "0.5").c_str())*1e6;
     59  EventUpdateDelay = atof(GetConfig("EventUpdateDelay", "0.5").c_str());
    6060
    6161  // DIM console service used in PrintMessage()
     
    7070  // Construct boards
    7171  BoardList = Tokenize(GetConfig("BoardList","129.217.160.119"));
    72 
     72  BoardList = Tokenize("192.33.99.225");
     73printf("%s ", BoardList[0].c_str());
    7374  for (unsigned int i=0; i<BoardList.size(); i++) {
    7475    Boards.push_back(new class FADBoard(BoardList[i], 5000, this, i));
     
    649650  vector<struct FADBoard::BoardStatus> Status;
    650651  vector<unsigned short> ROICmd;
    651   unsigned short DACCmd[] = {htons(CMD_Write | (BADDR_DAC + 2)), 0};
     652  unsigned short DACCmd[] = {htons(CMD_Write | (BADDR_DAC + 1)), 0, htons(CMD_Write | (BADDR_DAC + 2)), 0, htons(CMD_Write | (BADDR_DAC + 3)), 0};
    652653
    653654  /* Procedure
     
    683684    // Set DAC first value
    684685    DACCmd[1] = htons(0);
     686    DACCmd[3] = htons(0);
     687    DACCmd[5] = htons(0);
    685688        Boards[Brd]->Send(DACCmd, sizeof(DACCmd));
    686689
     
    715718        // Set second DAC value
    716719    DACCmd[1] = htons(50000);
     720    DACCmd[3] = htons(50000);
     721    DACCmd[5] = htons(50000);
    717722        Boards[Brd]->Send(DACCmd, sizeof(DACCmd));
    718723
     
    754759        Boards[Brd]->Send(&ROICmd[0], ROICmd.size()*sizeof(unsigned short));
    755760 
    756     DACCmd[1] = htons(Status[Brd].DAC[2]);
     761    DACCmd[1] = htons(Status[Brd].DAC[1]);
     762    DACCmd[3] = htons(Status[Brd].DAC[2]);
     763    DACCmd[5] = htons(Status[Brd].DAC[3]);
    757764        Boards[Brd]->Send(DACCmd, sizeof(DACCmd));
    758765       
     
    842849  // Update loop
    843850  while (!ExitRequest) {
    844     usleep(EventUpdateDelay);
     851    usleep(EventUpdateDelay*1e6);
    845852
    846853        // Update run and event header with current time
Note: See TracChangeset for help on using the changeset viewer.