#include <stdio.h>
#include <stdlib.h>
#include "midas.h"
#include "mcstd.h"
Go to the source code of this file.
|
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) |
|
INT | read_scaler_event (char *pevent, INT off) |
| Scaler event readout.
|
|
INT | get_frontend_index () |
|
INT | poll_event (INT source, INT count, BOOL test) |
|
INT | interrupt_configure (INT cmd, INT source, POINTER_T adr) |
|
◆ CRATE
◆ N_ADC
◆ N_SCLR
◆ N_TDC
◆ SLOT_ADC
◆ SLOT_IO
◆ SLOT_SCLR
◆ SLOT_TDC
◆ begin_of_run()
Begin of Run.
Called every run start transition. Set equipment status in ODB, start acquisition on the modules.
- Parameters
-
[in] | run_number | Number of the run being started |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 168 of file ebfe.cxx.
◆ end_of_run()
End of Run.
Called every stop run transition. Set equipment status in ODB, stop acquisition on the modules.
- Parameters
-
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 176 of file ebfe.cxx.
◆ frontend_exit()
Frontend exit.
Runs at frontend shutdown. Disconnect hardware and set equipment status in ODB
- Returns
- Midas status code
Definition at line 162 of file ebfe.cxx.
◆ frontend_init()
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 133 of file ebfe.cxx.
134{
135
139
140
141
145
146
148
149
151
152
155
156
157
159}
EXTERNAL void EXPRT cam_lam_enable(const int c, const int n)
EXTERNAL int EXPRT cam_init(void)
EXTERNAL void EXPRT camo(const int c, const int n, const int a, const int f, WORD d)
EXTERNAL void EXPRT cam_crate_clear(const int c)
EXTERNAL void EXPRT camc(const int c, const int n, const int a, const int f)
EXTERNAL void EXPRT cam_crate_zinit(const int c)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
◆ frontend_loop()
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 194 of file ebfe.cxx.
195{
196
197
200}
INT cm_yield(INT millisec)
◆ get_frontend_index()
INT get_frontend_index |
( |
| ) |
|
|
extern |
Definition at line 2368 of file mfe.cxx.
2368 {
2370}
static INT frontend_index
◆ interrupt_configure()
Definition at line 232 of file ebfe.cxx.
233{
234 switch (cmd) {
236 break;
238 break;
240 break;
242 break;
243 }
245}
#define CMD_INTERRUPT_ATTACH
#define CMD_INTERRUPT_DISABLE
#define CMD_INTERRUPT_ENABLE
#define CMD_INTERRUPT_DETACH
◆ pause_run()
Pause Run.
Called every pause run transition.
- Parameters
-
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
- Returns
- Midas status code
Definition at line 182 of file ebfe.cxx.
◆ poll_event()
Definition at line 211 of file ebfe.cxx.
215{
218
225 }
226
227 return 0;
228}
EXTERNAL void cam_lam_read(const int c, DWORD *lam)
#define LAM_SOURCE_STATION(s)
#define LAM_SOURCE_CRATE(c)
◆ read_scaler_event()
Scaler event readout.
Placeholder.
Scaler event readout routine. Not used in this example.
- Parameters
-
[in] | pevent | Pointer to event buffer |
[in] | off | Caller info (unused here), see mfe.c |
- Returns
- Size of the event
Definition at line 295 of file ebfe.cxx.
296{
298
299
301
302
304
305
306 for (a = 0; a <
N_SCLR; a++)
308
310
312}
INT bk_close(void *event, void *pdata)
void bk_init(void *event)
void bk_create(void *event, const char *name, WORD type, void **pdata)
INT bk_size(const void *event)
EXTERNAL void EXPRT cam24i(const int c, const int n, const int a, const int f, DWORD *d)
◆ read_trigger_event()
Definition at line 249 of file ebfe.cxx.
250{
252
253
255
256
258
259
260 for (a = 0; a <
N_ADC; a++)
262
263
265
267
268
270
271
272 for (a = 0; a <
N_TDC; a++)
274
275
277
279
280
282
283
285
286
289
291}
EXTERNAL void EXPRT cam_lam_clear(const int c, const int n)
◆ resume_run()
Resume Run.
Called every resume run transition.
- Parameters
-
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
- Returns
- Midas status code
Definition at line 188 of file ebfe.cxx.
◆ Adcx
◆ display_period
INT display_period = 3000 |
◆ equipment
Initial value:= {
{"Eqp%0d",
{2, 0,
"BUF%0d",
"MIDAS",
500,
0,
0,
0,
"", "", "",},
},
{""}
}
INT read_trigger_event(char *pevent, INT off)
Definition at line 84 of file ebfe.cxx.
84 {
85
86 {"Eqp%0d",
87 {2, 0,
88 "BUF%0d",
89#ifdef USE_INT
91#else
93#endif
95 "MIDAS",
99 500,
100 0,
101 0,
102 0,
103 "", "", "",},
105 },
106 {""}
107 };
◆ equipment_common_overwrite
◆ event_buffer_size
INT event_buffer_size = 10 * 1000 |
◆ frontend_call_loop
◆ frontend_file_name
◆ frontend_name
◆ max_event_size
INT max_event_size = 1000 |
◆ max_event_size_frag
INT max_event_size_frag = 0 |
◆ Sclx
◆ Tdcx