Low-Energy Muon (LEM) Experiment  0.5.2
omega_scfe.cxx
Go to the documentation of this file.
1 /********************************************************************\
2 
3  Name: omega_scfe.cxx
4  Created by: Andreas Suter
5 
6  Contents: Midas Slowcontrol Frontend to readout all devices related
7  to the sample region (except high voltages)
8 
9 \********************************************************************/
10 
11 #include <cstdio>
12 #include <cstdlib>
13 #include <cstring>
14 #include <cmath>
15 
16 #include "midas.h"
17 #include "mfe.h"
18 
19 #include "class/multi.h"
20 #include "omega_cn616tc1.h"
21 #include "tcpip_rs232.h"
22 
23 //-- Globals -------------------------------------------------------
24 
26 const char *frontend_name = "Omega SC";
28 const char *frontend_file_name = __FILE__;
29 
31 BOOL frontend_call_loop = TRUE;
32 
34 INT display_period = 1000;
35 
37 INT max_event_size = 10000;
38 
40 INT max_event_size_frag = 5*1024*1024;
41 
43 INT event_buffer_size = 10*10000;
44 
45 
46 //-- Equipment list ------------------------------------------------
47 
48 
52 DEVICE_DRIVER oven_driver[] = {
53  { "Omega", omega_cn616tc1_in, 10, tcpip_rs232, DF_INPUT },
54  { "Omega", omega_cn616tc1_out, 4, tcpip_rs232, DF_OUTPUT },
55  { "" }
56 };
57 
67 
69 EQUIPMENT equipment[] = {
70 
71  { "Omega", // equipment name
72  {75, 0, // event ID, trigger mask
73  "SYSTEM", // event buffer
74  EQ_SLOW, // equipment type
75  0, // event source
76  "FIXED", // format
77  TRUE, // enabled
78  RO_RUNNING |
79  RO_TRANSITIONS, // read when running and on transitions
80  30000, // read every 30 sec
81  0, // stop run after this event limit
82  0, // number of sub events
83  1, // log history every event
84  "", "", "",},
85  cd_multi_read, // readout routine
86  cd_multi, // class driver main routine
87  oven_driver, // device driver list
88  NULL, // init string
89  },
90 
91  { "" }
92 };
93 
94 
95 
96 //-- Dummy routines ------------------------------------------------
97 
98 INT poll_event(INT source, INT count, BOOL test) {return 1;};
99 INT interrupt_configure(INT cmd, INT source, POINTER_T adr) {return 1;};
100 
101 //-- Frontend Init -------------------------------------------------
107 {
108  // de-register run-transition notifications
109  cm_deregister_transition(TR_START);
110  cm_deregister_transition(TR_STOP);
111  cm_deregister_transition(TR_PAUSE);
112  cm_deregister_transition(TR_RESUME);
113 
114  return CM_SUCCESS;
115 }
116 
117 //-- Frontend Exit -------------------------------------------------
123 {
124  return CM_SUCCESS;
125 }
126 
127 //-- Frontend Loop -------------------------------------------------
133 {
134 
135  return CM_SUCCESS;
136 }
137 
138 //-- Begin of Run --------------------------------------------------
143 INT begin_of_run(INT run_number, char *error)
144 {
145  return CM_SUCCESS;
146 }
147 
148 //-- End of Run ----------------------------------------------------
153 INT end_of_run(INT run_number, char *error)
154 {
155  return CM_SUCCESS;
156 }
157 
158 //-- Pause Run -----------------------------------------------------
163 INT pause_run(INT run_number, char *error)
164 {
165  return CM_SUCCESS;
166 }
167 
168 //-- Resume Run ----------------------------------------------------
173 INT resume_run(INT run_number, char *error)
174 {
175  return CM_SUCCESS;
176 }
177 
178 //------------------------------------------------------------------
const char * frontend_name
&lt; created by ODBedit, command &quot;make&quot;
Definition: vme_fe.cxx:167
INT max_event_size
maximum event size produced by this frontend
Definition: vme_fe.cxx:179
BOOL frontend_call_loop
frontend_loop is called periodically if this variable is TRUE
Definition: vme_fe.cxx:173
INT display_period
a frontend status page is displayed with this frequency in ms
Definition: vme_fe.cxx:176
INT event_buffer_size
buffer size to hold events
Definition: vme_fe.cxx:185
INT frontend_exit()
Definition: vme_fe.cxx:565
EQUIPMENT equipment[]
Definition: vme_fe.cxx:343
INT begin_of_run(INT run_number, char *error)
Definition: vme_fe.cxx:597
INT interrupt_configure(INT cmd, INT source, PTYPE adr)
Definition: vme_fe.cxx:2105
INT frontend_loop()
Definition: vme_fe.cxx:957
INT resume_run(INT run_number, char *error)
Definition: vme_fe.cxx:900
DEVICE_DRIVER oven_driver[]
Definition: omega_scfe.cxx:52
INT max_event_size_frag
maximum event size for fragmented events (EQ_FRAGMENTED)
Definition: vme_fe.cxx:182
INT frontend_init()
Definition: vme_fe.cxx:429
BOOL equipment_common_overwrite
Definition: vme_fe.cxx:341
INT end_of_run(INT run_number, char *error)
Definition: vme_fe.cxx:865
INT poll_event(INT source, INT count, BOOL test)
Definition: vme_fe.cxx:2088
INT pause_run(INT run_number, char *error)
Definition: vme_fe.cxx:893
const char * frontend_file_name
The frontend file name, don&#39;t change it.
Definition: vme_fe.cxx:170