AlcapDAQ  1
crate.h
Go to the documentation of this file.
1 #define FE_END_BLOCK 10001
2 #define FE_NEED_STOP 10002
3 #define FE_NEED_START 10003
4 
5 #ifndef MIN
6 #define MIN(a,b) ( ((a)<(b)) ? (a) : (b) )
7 #endif
8 
9 #ifndef MAX
10 #define MAX(a,b) ( ((a)>(b)) ? (a) : (b) )
11 #endif
12 
13 struct readout_module
14 {
15  // initialization
16  INT (*init)();
17 
18  // exit
19  void (*exit)();
20 
21  // begin run
22  INT (*pre_bor)();
23 
24  // begin run
25  INT (*bor)();
26 
27  // end run
28  INT (*eor)();
29 
30  // called periodically while running and the DAQ is live (during a block)
31  INT (*poll_live)();
32 
33  // called periodically while running and the DAQ is dead (between blocks)
34  INT (*poll_dead)();
35 
36  // called when we intend to start the next block
37  INT (*start_cycle)();
38 
39  // called when we intend to stop the current block
40  INT (*stop_cycle)();
41 
42  // reads data from modules into MIDAS event
43  INT (*read)(char *pevent);
44 };
45 
46 extern char *frontend_name;
47 extern int crate_number;
48 
49 #define MAX_CRATES 9
50 
51 extern BOOL crate_is_participating(INT crate_number);
52 
53 extern EQUIPMENT equipment[];