MIDAS
Loading...
Searching...
No Matches
feccusb.cxx File Reference
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include "midas.h"
#include <libxxusb.h>
#include "ccusb.h"
#include "OdbCCusb.h"
Include dependency graph for feccusb.cxx:

Go to the source code of this file.

Macros

#define N_ADC8   12
 
#define SLOT_ADC8   10
 

Functions

INT frontend_init ()
 Frontend initialization.
 
INT frontend_exit ()
 Frontend exit.
 
INT begin_of_run (INT run_number, char *error)
 Begin of Run.
 
INT end_of_run (INT run_number, char *error)
 End of Run.
 
INT pause_run (INT run_number, char *error)
 Pause Run.
 
INT resume_run (INT run_number, char *error)
 Resume Run.
 
INT frontend_loop ()
 Frontend loop.
 
INT read_trigger_event (char *pevent, INT off)
 Event readout.
 
INT read_scaler_event (char *pevent, INT off)
 Scaler event readout.
 
INT poll_event (INT source, INT count, BOOL test)
 
INT interrupt_configure (INT cmd, INT source, POINTER_T adr)
 
void seq_callback (INT hDB, INT hseq, void *info)
 
int ccUsbFlush (void)
 
BOOL clear_buffer_events (int transition, BOOL first)
 

Variables

char constfrontend_name = "feccusb"
 
char constfrontend_file_name = __FILE__
 
BOOL frontend_call_loop = FALSE
 
INT display_period = 000
 
INT max_event_size = 10000
 
INT max_event_size_frag = 5 * 1024 * 1024
 
INT event_buffer_size = 100 * 10000
 
xxusb_device_type devices [10]
 
struct usb_devicedev
 
usb_dev_handleudev
 
HNDLE hDB
 main ODB handle
 
HNDLE hSetCC
 Midas equipment/<name>/Settings info handles.
 
CCUSB_SETTINGS tscc
 Settings local structure (see OdbCCusb.h)
 
EQUIPMENT equipment []
 
BOOL in_deferred_transition = FALSE
 
BOOL finished_clearing_buffer = FALSE
 
int number_extra_reads = 0
 
int EventsInRun = 0
 

Macro Definition Documentation

◆ N_ADC8

#define N_ADC8   12

Definition at line 66 of file feccusb.cxx.

◆ SLOT_ADC8

#define SLOT_ADC8   10

Definition at line 74 of file feccusb.cxx.

Function Documentation

◆ begin_of_run()

INT begin_of_run ( INT  run_number,
char error 
)

Begin of Run.

Called every run start transition. Set equipment status in ODB, start acquisition on the modules.

Parameters
[in]run_numberNumber of the run being started
[out]errorCan be used to write a message string to midas.log

Definition at line 314 of file feccusb.cxx.

314 {
315
316 //
317 // Construct the CAMAC list to be loaded into the Stack
318 long int stack[100];
319 int i, ret;
320 int q, x;
321 long d24;
322 short d16;
323
324 // Create the CAMAC list to be performed on each LAM
325 StackCreate(stack);
326
327 // StackXxx(), MRAD16, WMARKER, etc and macros are defined in
328 // in ccusb.h
329 // n a f data
330 StackFill(MRAD16 , SLOT_ADC8, 0 , 0, 12, stack);// read 12 ADC8
331 // StackFill(MRAD16 , SLOT_ADCD, 0 , 0, 12, stack);// read 12 ADCD
332 // StackFill(MRAD16 , SLOT_TDC, 0 , 0, 7, stack); // read 8 TDC
333 // Use of F2 can prevent the F9 if last readout is last A
334 //StackFill(CD16 , SLOT_TDC, 0 , 9, 0, stack); // clear TDC, data is ignored (command)
335 StackFill(CD16 , SLOT_ADC8, 0 , 9, 0, stack); // clear ADC8
336 // StackFill(CD16 , SLOT_ADCD, 0 , 9, 0, stack); // clear ADCD
337 StackFill(WMARKER, 0, 0, 0, 0xFEED, stack); // Our marker 0xfeed
338 StackClose(stack);
339
340 #if 1
341 // Debugging Check stack before writing
342 printf("stack[0]:%ld\n", stack[0]);
343 for (i = 0; i < stack[0]+1; i++) {
344 printf("stack[%i]=0x%lx\n", i, stack[i]);
345 }
346
347 // Load stack into CC-USB
348 ret = xxusb_stack_write(udev, 2, stack);
349 ret -= 2;
350 if (ret<0) {
351 printf("err on stack_write:%d\n", ret);
352 } else {
353 printf("Nbytes(ret) from stack_write:%d\n", ret);
354 for (i = 0; i < (ret/2); i++) {
355 if(0) printf("Wstack[%i]=0x%lx\n", i, stack[i]);
356 }
357 }
358 #endif
359
360 // Debugging Read stack
361 ret = xxusb_stack_read(udev, 2, stack);
362 if (ret<0) {
363 printf("err on stack_read:%d\n", ret);
364 } else {
365 printf("Nbytes(ret) from stack_read:%d\n", ret);
366 for (i = 0; i < (ret/2); i++) {
367 if(0) printf("Rstack[%i]=0x%lx\n", i, stack[i]);
368 }
369 }
370
371 // Remove Inhibit
373
374 // LAM mask from the Equipment
375 ret = CAMAC_write(udev, 25, 9, 16, LAM_SOURCE_STATION(equipment[0].info.source), &q, &x);
376
377 // delay LAM timeout[15..8], trigger delay[7..0]
378 d16 = ((tscc.lam_timeout & 0xFF) << 8) | (tscc.trig_delay & 0xFF);
379 printf ("lam, trigger delay : 0x%x\n", d16);
380 ret = CAMAC_write(udev, 25, 2, 16, d16, &q, &x);
381
382 // Enable LAM
383 // ret = CAMAC_read(udev, SLOT_TDC, 0, 26, &d24, &q, &x);
384 ret = CAMAC_read(udev, SLOT_ADC8, 0, 26, &d24, &q, &x);
385 //ret = CAMAC_read(udev, SLOT_ADCD, 0, 26, &d24, &q, &x);
386 // printf("ret:%d q:%d x:%d\n", ret, q, x);
387
388 // Opt in Global Mode register N(25) A(1) F(16)
389 // Buffer size
390 // 0:4096, 1:2048, 2:1024, 3:512, 4:256, 5:128, 6:64, 7:single event
391 ret = CAMAC_write(udev, 25, 1, 16, tscc.buffer_size, &q, &x);
392
393 // CAMAC_DGG creates a gate pulse with control of delay, width
394 // in 10ns increments.
395 // BUT range is limited to 16bit anyway annd only GG-A (0) provides
396 // the delay extension.
397 // Maximum delay 1e6 -> minimum frq 1KHz
398 // DGG_A Pulser NimO1 invert latch
399 ret = CAMAC_DGG(udev, 0, 7, 1, tscc.delay/10, tscc.width/10, 0, 0);
400
401 // First clear before first LAM/readout
402 ret = CAMAC_read(udev, SLOT_ADC8, 0, 9, &d24, &q, &x);
403 // ret = CAMAC_read(udev, SLOT_ADCD, 0, 9, &d24, &q, &x);
404 // ret = CAMAC_read(udev, SLOT_TDC, 0, 9, &d24, &q, &x);
405
406 // Start DAQ mode
407 ret = xxusb_register_write(udev, 1, 0x1);
408 //
409 // NO CAMAC calls ALLOWED beyond this point!!!!!!!!
410 // as the Module is in acquisition mode now
411 //
412
413 // Count total events in run.
414 EventsInRun = 0;
415 // Set value for deferred transition (to readout last events).
418
419 return SUCCESS;
420}
#define CD16
Command D16.
Definition ccusb.h:18
void StackCreate(long int *stack)
Definition ccusb.h:97
int StackFill(int mode, int n, int a, int f, int d, long int *stack)
Stack builder.
Definition ccusb.h:36
#define MRAD16
Multiple Read on A D16.
Definition ccusb.h:13
#define WMARKER
Marker.
Definition ccusb.h:19
void StackClose(long int *stack)
Definition ccusb.h:106
#define FALSE
Definition cfortran.h:309
BOOL finished_clearing_buffer
Definition feccusb.cxx:191
#define SLOT_ADC8
Definition feccusb.cxx:74
CCUSB_SETTINGS tscc
Settings local structure (see OdbCCusb.h)
Definition feccusb.cxx:84
int EventsInRun
Definition feccusb.cxx:310
EQUIPMENT equipment[]
Definition feccusb.cxx:103
BOOL in_deferred_transition
Definition feccusb.cxx:190
usb_dev_handle * udev
Definition feccusb.cxx:81
#define SUCCESS
Definition mcstd.h:54
static std::string q(const char *s)
void ** info
Definition fesimdaq.cxx:41
INT i
Definition mdump.cxx:32
#define LAM_SOURCE_STATION(s)
Definition midas.h:487
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
INT lam_timeout
Definition OdbCCusb.h:6
INT buffer_size
Definition OdbCCusb.h:5
Here is the call graph for this function:

◆ ccUsbFlush()

int ccUsbFlush ( void  )

Definition at line 165 of file feccusb.cxx.

165 {
166 short IntArray [10000]; //for FIFOREAD
167
168 int ret=1;
169 int k=0;
170 while(ret>0) {
171 ret = xxusb_bulk_read(udev, IntArray, 8192, 100);
172 if(ret>0) {
173 printf("drain loops: %i (result %i)\n ",k,ret);
174 k++;
175 if (k>100) ret=0;
176
177 // Last event dump
178 for(int i =0; i < ret/2; i++){
179 printf("%x ",IntArray[i] & 0xffff);
180 if(i%8==7) printf("\n");
181 }
182 }
183 }
184 printf("\n");
185 printf("First bin %x\n",IntArray[0]);
186 return (IntArray[0] & 0xfff);
187
188}
INT k
Definition odbhist.cxx:40
Here is the caller graph for this function:

◆ clear_buffer_events()

BOOL clear_buffer_events ( int  transition,
BOOL  first 
)

Definition at line 196 of file feccusb.cxx.

196 {
197
198 if(first){
199
200 // Stop DAQ mode
201 int ret = xxusb_register_write(udev, 1, 0x0);
202 printf("stopping CAMAC xxusb_register_write=%d\n", ret);
203
207 printf("Starting deferred to clear USB buffer\n");
208 }
209
211 printf("Finished deferred transition after %i extra reads.\n",number_extra_reads);
212 return TRUE;
213 }
214
215 if(number_extra_reads > 10){
216 cm_msg(MERROR, "clear_buffer_events", "Didn't manage to clear CCUSB buffer after 10 extra reads.\n");
217 return TRUE;
218 }
219
220 return FALSE;
221}
int number_extra_reads
Definition feccusb.cxx:192
#define MERROR
Definition midas.h:559
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
Definition midas.cxx:915
#define TRUE
Definition midas.h:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ end_of_run()

INT end_of_run ( INT  run_number,
char error 
)

End of Run.

Called every stop run transition. Set equipment status in ODB, stop acquisition on the modules.

Parameters
[in]run_numberNumber of the run being ended
[out]errorCan be used to write a message string to midas.log

Definition at line 423 of file feccusb.cxx.

424{
425 // Stop DAQ mode
426 int ret = xxusb_register_write(udev, 1, 0x0);
427 printf("End of run Stop DAQ return:%d\n", ret);
428
429 // Set Inhibit
430 // CAMAC_I(udev, TRUE);
431
432 // Flush data.
433 // This shouldn't do anything, since we flushed all the events with deferred transition.
434 ret = ccUsbFlush();
435 if(ret > 0) cm_msg(MINFO, "ccusb", "Flushed %d events; surprising", ret);
436 EventsInRun += ret;
437 cm_msg(MINFO, "ccusb", "Total number of events read in this run: %i \n",EventsInRun);
438 return SUCCESS;
439}
int ccUsbFlush(void)
Definition feccusb.cxx:165
#define MINFO
Definition midas.h:560
Here is the call graph for this function:

◆ frontend_exit()

INT frontend_exit ( void  )

Frontend exit.

Runs at frontend shutdown. Disconnect hardware and set equipment status in ODB

Returns
Midas status code

Definition at line 302 of file feccusb.cxx.

303{
304 // Close device
306 return SUCCESS;
307}

◆ frontend_init()

INT frontend_init ( void  )

Frontend initialization.

Runs once at application startup. We initialize the hardware and optical interfaces and set the equipment status in ODB. We also lock the frontend to once physical cpu core.

Returns
Midas status code

Definition at line 226 of file feccusb.cxx.

226 {
227
228 int size, status;
229 char set_str[80];
231
233
234 // Map /equipment/<eq_name>/settings
235 sprintf(set_str, "/Equipment/CCUSB/Settings");
236
237 // create the ODB Settings if not existing under Equipment/<eqname>/
238 // If already existing, don't change anything
240 if (status != DB_SUCCESS) {
241 cm_msg(MERROR, "ccusb", "cannot create record (%s)", set_str);
242 return FE_ERR_ODB;
243 }
244
245 // Get the equipment/<eqname>/Settings key
247
248 // Enable hot-link on /Settings of the equipment
249 // Anything changed under /Settings will be triggering the callback (above)
250 size = sizeof(CCUSB_SETTINGS);
252 , seq_callback, NULL)) != DB_SUCCESS) {
253 cm_msg(MERROR, "ccusb", "cannot open record (%s)", set_str);
254 return CM_DB_ERROR;
255 }
256
257 // Setup a deferred transition so that we can read out any events that remain in
258 // buffer at the end of the run.
260
261 // hardware initialization
262 //Find XX_USB devices and open the first one found
263 printf("Initializing USB device\n");
264 int ret = xxusb_devices_find(devices);
265 printf("Testing first USB device; ret=%i\n",ret);
266 dev = devices[0].usbdev;
268
269 // Make sure CC_USB opened OK
270 if(!udev) {
271 cm_msg(MERROR, "ccusb", "Failed to Open CC_USB");
272 return FE_ERR_HW;
273 }
274
275 // Stop DAQ mode in case it was left running (after crash)
276 ret = xxusb_register_write(udev, 1, 0x0);
277
278 if(ret < 0){
279 cm_msg(MERROR, "ccusb", "Error writing to CCUSB; error message = %i",ret);
280 return FE_ERR_HW;
281 }
282
283 // printf("stop DAQ return:%d\n", ret);
284
285 // Flush old data first
286 ccUsbFlush();
287 // printf("Flush return:%d\n", ret);
288
289 // CAMAC CLEAR
290 CAMAC_C(udev);
291 // printf("CAMAC_C return:%d\n", ret);
292 // CAMAC Z
293 CAMAC_Z(udev);
294 // printf("CAMAC_Z return:%d\n", ret);
295
296 /* print message and return FE_ERR_HW if frontend should not be started */
297 cm_msg(MINFO, "ccusb", "CC-USB ready");
298 return SUCCESS;
299}
#define CCUSB_SETTINGS_STR(_name)
Definition OdbCCusb.h:12
void seq_callback(INT hDB, INT hseq, void *info)
Definition feccusb.cxx:155
xxusb_device_type devices[10]
Definition feccusb.cxx:79
BOOL clear_buffer_events(int transition, BOOL first)
Definition feccusb.cxx:196
HNDLE hDB
main ODB handle
Definition feccusb.cxx:83
struct usb_device * dev
Definition feccusb.cxx:80
HNDLE hSetCC
Midas equipment/<name>/Settings info handles.
Definition feccusb.cxx:83
INT cm_get_experiment_database(HNDLE *hDB, HNDLE *hKeyClient)
Definition midas.cxx:3011
INT cm_register_deferred_transition(INT transition, BOOL(*func)(INT, BOOL))
Definition midas.cxx:3837
#define CM_DB_ERROR
Definition midas.h:585
#define DB_SUCCESS
Definition midas.h:631
#define FE_ERR_ODB
Definition midas.h:718
#define FE_ERR_HW
Definition midas.h:719
#define MODE_READ
Definition midas.h:370
#define TR_STOP
Definition midas.h:406
INT db_open_record(HNDLE hDB, HNDLE hKey, void *ptr, INT rec_size, WORD access_mode, void(*dispatcher)(INT, INT, void *), void *info)
Definition odb.cxx:13291
std::string strcomb1(const char **list)
Definition odb.cxx:598
INT db_find_key(HNDLE hDB, HNDLE hKey, const char *key_name, HNDLE *subhKey)
Definition odb.cxx:4079
INT db_create_record(HNDLE hDB, HNDLE hKey, const char *orig_key_name, const char *init_str)
Definition odb.cxx:12800
DWORD status
Definition odbhist.cxx:39
Here is the call graph for this function:

◆ frontend_loop()

INT frontend_loop ( void  )

Frontend loop.

If frontend_call_loop is true, this routine gets called when the frontend is idle or once between every event.

Returns
Midas status code

Definition at line 478 of file feccusb.cxx.

479{
480 /* if frontend_call_loop is true, this routine gets called when
481 the frontend is idle or once between every event */
482 return SUCCESS;
483}

◆ interrupt_configure()

INT interrupt_configure ( INT  cmd,
INT  source,
POINTER_T  adr 
)

Definition at line 513 of file feccusb.cxx.

514{
515 switch (cmd) {
517 break;
519 break;
521 break;
523 break;
524 }
525 return SUCCESS;
526}
#define CMD_INTERRUPT_ATTACH
Definition midas.h:822
#define CMD_INTERRUPT_DISABLE
Definition midas.h:821
#define CMD_INTERRUPT_ENABLE
Definition midas.h:820
#define CMD_INTERRUPT_DETACH
Definition midas.h:823

◆ pause_run()

INT pause_run ( INT  run_number,
char error 
)

Pause Run.

Called every pause run transition.

Parameters
[in]run_numberNumber of the run being ended
[out]errorCan be used to write a message string to midas.log
Returns
Midas status code

Definition at line 442 of file feccusb.cxx.

443{
444 // Stop DAQ mode
445 xxusb_register_write(udev, 1, 0x0);
446
447 // Set Inhibit
448 CAMAC_I(udev, TRUE);
449
450 // -PAA-
451 // flush data, these data are lost as the run is already closed.
452 // will implement deferred transition later to fix this issue
453 ccUsbFlush();
454 return SUCCESS;
455}
Here is the call graph for this function:

◆ poll_event()

INT poll_event ( INT  source,
INT  count,
BOOL  test 
)

Definition at line 494 of file feccusb.cxx.

498{
499 int i;
500 DWORD lam=0;
501
502 for (i = 0; i < count; i++) {
503 ss_sleep(100);
504 if (lam & LAM_SOURCE_STATION(source))
505 if (!test)
506 return lam;
507 }
508
509 return 0;
510}
unsigned int DWORD
Definition mcstd.h:51
INT ss_sleep(INT millisec)
Definition system.cxx:3628
double count
Definition mdump.cxx:33
program test
Definition miniana.f:6
Here is the call graph for this function:

◆ read_scaler_event()

INT read_scaler_event ( char pevent,
INT  off 
)

Scaler event readout.

Scaler event readout routine. Not used in this example.

Parameters
[in]peventPointer to event buffer
[in]offCaller info (unused here), see mfe.c
Returns
Size of the event

Definition at line 295 of file ebfe.cxx.

296{
297 DWORD *pdata, a;
298
299 /* init bank structure */
300 bk_init(pevent);
301
302 /* create SCLR bank */
303 bk_create(pevent, Sclx, TID_DWORD, (void**)&pdata);
304
305 /* read scaler bank */
306 for (a = 0; a < N_SCLR; a++)
307 cam24i(CRATE, SLOT_SCLR, a, 0, pdata++);
308
309 bk_close(pevent, pdata);
310
311 return bk_size(pevent);
312}
#define SLOT_SCLR
Definition ebfe.cxx:63
char Sclx[5]
Definition ebfe.cxx:51
#define N_SCLR
Definition ebfe.cxx:56
#define CRATE
Definition ebfe.cxx:59
INT bk_close(void *event, void *pdata)
Definition midas.cxx:16780
void bk_init(void *event)
Definition midas.cxx:16406
void bk_create(void *event, const char *name, WORD type, void **pdata)
Definition midas.cxx:16561
INT bk_size(const void *event)
Definition midas.cxx:16495
EXTERNAL void EXPRT cam24i(const int c, const int n, const int a, const int f, DWORD *d)
#define TID_DWORD
Definition midas.h:336
Here is the call graph for this function:

◆ read_trigger_event()

INT read_trigger_event ( char pevent,
INT  off 
)

Event readout.

Trigger event readout.

Event readout routine. This is called by the polling or interrupt routines. (see mfe.c). For each module, read the event buffer into a midas data bank. If ZLE data exists, create another bank for it. Finally, create a statistical bank for data throughput analysis.

Parameters
[in]peventPointer to event buffer
[in]offCaller info (unused here), see mfe.c
Returns
Size of the event

Main trigger event readout routine. This is called by the polling or interrupt routines. (see mfe.c). For each module, read the event buffer into a midas data bank.

Parameters
[in]peventPointer to event buffer
[in]offCaller info (unused here), see mfe.c
Returns
Size of the event


Definition at line 529 of file feccusb.cxx.

530{
531 WORD *pdata;
532 int ret, nd16=0;
533
536 }
537
538 /* init bank structure */
539 bk_init(pevent);
540
541 /* create Midas bank named ADC8 for ADC card in slot 8*/
542 bk_create(pevent, "ADC8", TID_WORD, (void **)&pdata);
543
544 /* create Midas bank named ADCD D=13 for ADC card in slot 13*/
545 //bk_create(pevent, "ADCD", TID_WORD, (void **)&pdata);
546
547 /* create Midas bank named ADTD */
548// bk_create(pevent, "ADTD", TID_WORD, (void **)&pdata);
549
550 // Read CC-USB buffer, returns nbytes, use for 32-bit data
551 ret = xxusb_bulk_read(udev, pdata, 8192, 500);
552 if (ret > 0) {
553 nd16 = ret / 2; // # of d16
554 int nevents = (pdata[0]& 0xfff); // # of LAM in the buffer
556 #if 0
557 int evtsize = (pdata[1] & 0xffff); // # of words per event
558 printf("Read data: ret:%d nd16:%d nevent:%d, evtsize:%d\n", ret, nd16, nevents, evtsize);
559#endif
560
561 // if (nevents & 0x8000) return 0; // Skip event
562 if(pdata[0] & 0x8000)cm_msg(MINFO, "read_trigger_event", "Readout last CAMAC event in run.");
563
564
565 if (nd16 > 0) {
566 // Adjust pointer (include nevents, evtsize)
567 pdata += nd16;
568 }
569
570 // Close bank
571 bk_close(pevent, pdata);
572
573 printf("readout non-zero bytes from CAMAC usb\n");
574 // Done with a valid event
575 return bk_size(pevent);
576
577 } else {
578 // printf("no read ret:%d\n", ret);
579
580 // we finished the deferred transition when we do a read of USB buffer
581 // and don't get any extra data.
584 }
585 return 0;
586 }
587}
unsigned short int WORD
Definition mcstd.h:49
#define TID_WORD
Definition midas.h:332
Here is the call graph for this function:

◆ resume_run()

INT resume_run ( INT  run_number,
char error 
)

Resume Run.

Called every resume run transition.

Parameters
[in]run_numberNumber of the run being ended
[out]errorCan be used to write a message string to midas.log
Returns
Midas status code

Definition at line 458 of file feccusb.cxx.

459{
460 int q, x;
461 long d24;
462
463 // Clear module
464 CAMAC_read(udev, SLOT_ADC8, 0, 9, &d24, &q, &x);
465 //CAMAC_read(udev, SLOT_ADCD, 0, 9, &d24, &q, &x);
466 // CAMAC_read(udev, SLOT_TDC, 0, 9, &d24, &q, &x);
467
468 // Remove Inhibit
470
471 // Start DAQ mode
472 xxusb_register_write(udev, 1, 0x1);
473
474 return SUCCESS;
475}
Here is the call graph for this function:

◆ seq_callback()

void seq_callback ( INT  hDB,
INT  hseq,
void info 
)

Definition at line 155 of file feccusb.cxx.

156{
157 KEY key;
159 printf("odb ... %s touched (%d)\n", key.name, hseq);
160}
INT db_get_key(HNDLE hDB, HNDLE hKey, KEY *key)
Definition odb.cxx:6019
KEY key
Definition mdump.cxx:34
Definition midas.h:1026
char name[NAME_LENGTH]
Definition midas.h:1029
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ dev

Definition at line 80 of file feccusb.cxx.

◆ devices

xxusb_device_type devices[10]

Definition at line 79 of file feccusb.cxx.

◆ display_period

INT display_period = 000

Definition at line 53 of file feccusb.cxx.

◆ equipment

EQUIPMENT equipment[]
Initial value:
= {
{"CCUSB",
{1, 0,
"BUF8",
LAM_SOURCE(0, 0xFFFFFF),
"MIDAS",
TRUE,
10,
0,
0,
0,
"", "", "",},
},
{""}
}
INT read_trigger_event(char *pevent, INT off)
Event readout.
Definition feccusb.cxx:529
#define EQ_PERIODIC
Definition midas.h:414
#define RO_RUNNING
Definition midas.h:426
#define LAM_SOURCE(c, s)
Definition midas.h:469

Definition at line 103 of file feccusb.cxx.

103 {
104
105 {"CCUSB", /* equipment name */
106 {1, 0, /* event ID, trigger mask */
107 "BUF8", /* event buffer */
108 EQ_PERIODIC, /* equipment type */
109 LAM_SOURCE(0, 0xFFFFFF),/* event source crate 0, all stations */
110 "MIDAS", /* format */
111 TRUE, /* enabled */
112 RO_RUNNING, /* read only when running */
113 10, /* poll for 10ms */
114 0, /* stop run after this event limit */
115 0, /* number of sub events */
116 0, /* don't log history */
117 "", "", "",},
118 read_trigger_event, /* readout routine */
119 },
120
121 {""}
122};

◆ event_buffer_size

INT event_buffer_size = 100 * 10000

Definition at line 62 of file feccusb.cxx.

◆ EventsInRun

int EventsInRun = 0

Definition at line 310 of file feccusb.cxx.

◆ finished_clearing_buffer

BOOL finished_clearing_buffer = FALSE

Definition at line 191 of file feccusb.cxx.

◆ frontend_call_loop

BOOL frontend_call_loop = FALSE

Definition at line 50 of file feccusb.cxx.

◆ frontend_file_name

char const* frontend_file_name = __FILE__

Definition at line 47 of file feccusb.cxx.

◆ frontend_name

char const* frontend_name = "feccusb"

Definition at line 45 of file feccusb.cxx.

◆ hDB

HNDLE hDB

main ODB handle

Definition at line 83 of file feccusb.cxx.

◆ hSetCC

HNDLE hSetCC

Midas equipment/<name>/Settings info handles.

Definition at line 83 of file feccusb.cxx.

◆ in_deferred_transition

BOOL in_deferred_transition = FALSE

Definition at line 190 of file feccusb.cxx.

◆ max_event_size

INT max_event_size = 10000

Definition at line 56 of file feccusb.cxx.

◆ max_event_size_frag

INT max_event_size_frag = 5 * 1024 * 1024

Definition at line 59 of file feccusb.cxx.

◆ number_extra_reads

int number_extra_reads = 0

Definition at line 192 of file feccusb.cxx.

◆ tscc

Settings local structure (see OdbCCusb.h)

Definition at line 84 of file feccusb.cxx.

◆ udev

Definition at line 81 of file feccusb.cxx.