Changeset 10103


Ignore:
Timestamp:
01/14/11 09:19:09 (14 years ago)
Author:
neise
Message:
supports trigger disable & enable. enables during init.
Location:
fact/FADctrl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • fact/FADctrl/FAD.cc

    r10101 r10103  
    2727   {"srclk", &FAD::cmd_srclk, true, 1, "<on|off>", "Set SRCLK"},
    2828   {"sclk", &FAD::cmd_sclk, true, 1, "<on|off>", "Set SCLK"},
    29    {"trigger", &FAD::cmd_trigger, false, 0, "[n|cont|stop]", "Issue software triggers"},
     29   {"trigger", &FAD::cmd_trigger, false, 0, "[n|cont|stop|enable|disable]", "Issue software triggers"},
    3030   {"roi", &FAD::cmd_roi, true, 2, "<channel range> <value>", "Set region-of-interest to value"},
    3131   {"dac", &FAD::cmd_dac, true, 2, "<range> <value>", "Set DAC numbers in range to value"},
    3232   {"address", &FAD::cmd_address, true, 2, "<range> <value>", "Set addresses in range to value"},
    33    {"send", &FAD::cmd_send, true, 1, "<value>", "Set arbitrary data to board"},
     33   {"send", &FAD::cmd_send, true, 1, "<value>", "Send arbitrary data to board"},
    3434   {"acalib", &FAD::cmd_acalib, true, 0, "[n|invalidate|file]", "Perform or read amplitude calibration (n events)"},
    3535   //{"wmode", &FAD::cmd_wmode, 0, "<run|stop>", "Domino wave running or stopped during read out"},
     
    206206}
    207207
    208 
    209208//
    210209// Switch SCLK
     
    258257
    259258  int Num;
    260 
     259 
    261260  for (unsigned int i=0; i<Boards.size(); i++) {
    262261        if (Parameter.size() == 1) Boards[i]->Send(CMD_Trigger);
     
    269268        else if (Match(Parameter[1],"continuous")) Boards[i]->Send(CMD_Trigger_C);
    270269        else if (Match(Parameter[1],"stop")) Boards[i]->Send(CMD_Trigger_S);
     270        else if (Match(Parameter[1],"enable")) Boards[i]->Send(CMD_TRIGGERS_ON);
     271        else if (Match(Parameter[1],"disable")) Boards[i]->Send(CMD_TRIGGERS_OFF);
    271272        else {
    272273          PrintUsage();
     
    274275        }
    275276  }
     277    if (Match(Parameter[1],"enable")) PrintMessage("all active boards accept now incoming triggers\n");
     278  else if (Match(Parameter[1],"disable")) PrintMessage("no active board accepts any incoming trigger anymore.\n");
     279 // else PrintUsage();
     280
     281 
    276282}
    277283
     
    723729        Status.push_back(Boards[Brd]->GetStatus());
    724730       
     731        // Disarm first, in order to change ROI & DAC settings
     732        //Boards[Brd]->Send(CMD_TRIGGERS_OFF);
     733
    725734    // Set all ROI to 1024
    726735        Boards[Brd]->Send(&ROICmd[0], ROICmd.size()*sizeof(unsigned short));
     
    734743        // Switch off SCLK
    735744        //Boards[Brd]->Send(CMD_SCLK_OFF);
     745
     746        // Arm again, in order to take data
     747        //Boards[Brd]->Send(CMD_TRIGGERS_ON);
     748
    736749
    737750        // Start accumulation
     
    760773        Boards[Brd]->Send(CMD_SCLK_ON);
    761774
     775        // Disarm first, in order to change ROI & DAC settings
     776        //Boards[Brd]->Send(CMD_TRIGGERS_OFF);
     777
    762778        // Set second DAC value
    763     DACCmd[1] = htons(50000);
    764     DACCmd[3] = htons(50000);
    765     DACCmd[5] = htons(50000);
     779        DACCmd[1] = htons(50000);
     780        DACCmd[3] = htons(50000);
     781        DACCmd[5] = htons(50000);
    766782        Boards[Brd]->Send(DACCmd, sizeof(DACCmd));
    767783
    768784        // Switch off SCLK
    769785        //Boards[Brd]->Send(CMD_SCLK_OFF);
     786
     787        // Arm again
     788        //Boards[Brd]->Send(CMD_TRIGGERS_ON);
    770789
    771790        // Start accumulation
  • fact/FADctrl/FAD.h

    r10101 r10103  
    6262    ~FAD();
    6363
    64     void cmd_exit();            void cmd_help();
    65     void cmd_board();           void cmd_status();
    66     void cmd_acalib();          void cmd_serial();
    67     void cmd_trigger();         void cmd_socketmode();
    68         void cmd_srclk();               void cmd_sclk();
    69         void cmd_dwrite();              void cmd_domino();
    70     void cmd_wmode();           void cmd_rmode();
    71     void cmd_dmode();           void cmd_dac();
    72         void cmd_roi();                 void cmd_address();
    73         void cmd_phase();               void cmd_send();
    74         void cmd_cancel();              void cmd_update();
     64                void cmd_exit();                        void cmd_help();
     65                void cmd_board();                       void cmd_status();
     66                void cmd_acalib();              void cmd_serial();
     67                void cmd_trigger();     void cmd_socketmode();
     68                void cmd_srclk();                       void cmd_sclk();
     69                void cmd_dwrite();              void cmd_domino();
     70                void cmd_wmode();                       void cmd_rmode();
     71                void cmd_dmode();                       void cmd_dac();
     72                void cmd_roi();                         void cmd_address();
     73                void cmd_phase();                       void cmd_send();
     74                void cmd_cancel();              void cmd_update();
    7575
    7676    void EnableDomino();
  • fact/FADctrl/FADFormat.h

    r10036 r10103  
    2626#define CMD_Read 0x0A00                 // read from Config-RAM
    2727#define CMD_Write 0x0500                // write to Config-RAM
     28
     29#define CMD_TRIGGERS_ON 0x1800  // enables the trigger line -- incoming triggers can now be accepted
     30#define CMD_TRIGGERS_OFF 0x1900 // disables the trigger line -- no trigger will be accepted
    2831
    2932//
  • fact/FADctrl/FADctrl.cc

    r10101 r10103  
    7575  DimClient::sendCommand(SERVER_NAME"/Command", "dwrite on");
    7676  DimClient::sendCommand(SERVER_NAME"/Command", "roi all 1024");
     77
     78  DimClient::sendCommand(SERVER_NAME"/Command", "trigger enable");
    7779
    7880  M.PrintMessage("Finished initalizing all boards\n");
Note: See TracChangeset for help on using the changeset viewer.