- Timestamp:
- 05/02/11 14:56:49 (14 years ago)
- Location:
- fact/FADctrl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/FADctrl/FAD.cc
r10291 r10504 28 28 {"sclk", &FAD::cmd_sclk, true, 1, "<on|off>", "Set SCLK"}, 29 29 {"trigger", &FAD::cmd_trigger, false, 0, "[n|cont [rate]|stop|enable|disable]", "Issue software triggers"}, 30 {"reset_trigger", &FAD::cmd_reset_trigger, false, 0, "resets the internal trigger counter"}, 31 {"set_runnumber", &FAD::cmd_set_runnumber, false, 1, "<n> sets runnumber"}, 30 32 {"roi", &FAD::cmd_roi, true, 2, "<channel range> <value>", "Set region-of-interest to value"}, 31 33 {"dac", &FAD::cmd_dac, true, 2, "<range> <value>", "Set DAC numbers in range to value"}, … … 195 197 } 196 198 199 void FAD::cmd_reset_trigger() { 200 for (unsigned int i=0; i<Boards.size(); i++) { 201 Boards[i]->Send(CMD_RESET_TRIGGER_ID); 202 } 203 } 204 205 206 void FAD::cmd_set_runnumber() { 207 int Num; 208 209 if (Parameter.size() == 2) { 210 ConvertToInt(Parameter[1], &Num); 211 for (unsigned int i=0; i<Boards.size(); i++) { 212 Boards[i]->Send( CMD_Write | ADDR_RUNNUMBER ); 213 Boards[i]->Send((unsigned short) Num>>16); // Write the HIGH-word first 214 Boards[i]->Send( CMD_Write | (ADDR_RUNNUMBER+1) ); 215 Boards[i]->Send((unsigned short) (Num>>16)<<16); // now write the LOW-word 216 } 217 } 218 else { 219 PrintUsage(); 220 return; 221 } 222 } 223 224 197 225 // 198 226 // Switch socket mode -
fact/FADctrl/FAD.h
r10263 r10504 69 69 void cmd_board(); void cmd_status(); 70 70 void cmd_acalib(); void cmd_serial(); 71 void cmd_trigger(); 71 void cmd_trigger(); 72 void cmd_reset_trigger(); 73 void cmd_set_runnumber(); 72 74 void cmd_socketmode();void cmd_daqmode(); 73 75 void cmd_srclk(); void cmd_sclk(); -
fact/FADctrl/FADBoard.cc
r10291 r10504 457 457 Status.EventCounter = ntohl(Header->fad_evt_counter); 458 458 Status.TriggerID = ntohl(Header->trigger_id); 459 Status.Runnumber = ntohl(Header->runnumber); 459 460 Status.TriggerType = ntohs(Header->trigger_type); 460 461 Status.TriggerCRC = ntohs(Header->trigger_crc); … … 496 497 // Extract ADC data (stored in 12 bit signed twis complement with out-of-range-bit and leading zeroes) 497 498 for (int i=0; i<Status.ROI[Chip][Chan]; i++) { 498 Buf = ntohs(Channel[Chip+NChips*Chan]->adc_data[i]);499 Buf = (Channel[Chip+NChips*Chan]->adc_data[i]); 499 500 (Buf <<= 4) >>= 4; //delete the sign-bit by shifting left and shift back 500 501 Data[Chip][Chan][i] = Buf; -
fact/FADctrl/FADBoard.h
r10290 r10504 52 52 53 53 uint32_t TriggerID; 54 uint32_t Runnumber; 54 55 uint16_t TriggerType; 55 56 uint16_t TriggerCRC; -
fact/FADctrl/FADFormat.h
r10224 r10504 29 29 #define CMD_Read 0x0A00 // read from Config-RAM 30 30 #define CMD_Write 0x0500 // write to Config-RAM 31 #define CMD_RESET_TRIGGER_ID 0x2A00 31 32 32 33 #define CMD_TRIGGERS_ON 0x1800 // enables the trigger line … … 40 41 #define BADDR_DAC 0x24 // Baseaddress DAC-Values 41 42 #define BADDR_CONT_TRIGGER_TIME 0x2C // Baseaddress for the continouus trigger timing. 43 #define ADDR_RUNNUMBER 0x2D // 42 44 #define MAX_VAL 65535 43 45 #define MAX_ROIVAL 1024 … … 76 78 77 79 uint32_t time; 78 uint32_t fad_status;80 uint32_t runnumber; 79 81 80 82 int16_t drs_temperature[NTemp];
Note:
See TracChangeset
for help on using the changeset viewer.