Low-Energy Muon (LEM) Experiment  0.5.2
lemvac_scfe.cxx
Go to the documentation of this file.
1 /********************************************************************\
2 
3  Name: lemvac_scfe.cxx
4  Created by: Andreas Suter
5 
6  Contents: Midas frontend to readout the LEM vacuum control unit
7 
8 \********************************************************************/
9 
10 #include <cstdio>
11 #include "midas.h"
12 #include "class/multi.h"
13 #include "lemvac.h"
14 #include "sps_tcpip.h"
15 #include "bus/null.h"
16 
17 //-- Globals -------------------------------------------------------
18 
20 const char *frontend_name = "LEMVAC_SC";
22 const char *frontend_file_name = __FILE__;
23 
25 BOOL frontend_call_loop = TRUE;
26 
28 INT display_period = 1000;
29 
31 INT max_event_size = 10000;
32 
34 INT max_event_size_frag = 5*1024*1024;
35 
37 INT event_buffer_size = 10*10000;
38 
39 //-- Equipment list ------------------------------------------------
40 
42 #ifdef DUMMY_SCFE
43 DEVICE_DRIVER lemvac_driver[] = {
44  { "LEMVAC in", lemvac_in, LEMVAC_IN_VARS, null, DF_INPUT },
45  { "LEMVAC out", lemvac_out, LEMVAC_OUT_VARS, null, DF_OUTPUT },
46  { "" }
47 };
48 #else
49 DEVICE_DRIVER lemvac_driver[] = {
50  { "LEMVAC in", lemvac_in, LEMVAC_IN_VARS, sps_tcpip, DF_INPUT },
51  { "LEMVAC out", lemvac_out, LEMVAC_OUT_VARS, sps_tcpip, DF_OUTPUT },
52  { "" }
53 };
54 #endif
55 
65 
67 EQUIPMENT equipment[] = {
68 
69  { "LEMVAC", // equipment name
70  {78, 0, // event ID, trigger mask
71  "SYSTEM", // event buffer
72  EQ_SLOW, // equipment type
73  0, // event source
74  "FIXED", // format
75  TRUE, // enabled
76  RO_RUNNING |
77  RO_TRANSITIONS, // read when running and on transitions
78  30000, // read every 30 sec
79  0, // stop run after this event limit
80  0, // number of sub events
81  1, // log history every event
82  "", "", "",},
83  cd_multi_read, // readout routine
84  cd_multi, // class driver main routine
85  lemvac_driver, // device driver list
86  NULL, // init string
87  },
88 
89  { "" }
90 };
91 
92 
93 
94 //-- Dummy routines ------------------------------------------------
95 
96 INT poll_event(INT source, INT count, BOOL test) {return 1;};
97 INT interrupt_configure(INT cmd, INT source, POINTER_T adr) {return 1;};
98 
99 //-- Frontend Init -------------------------------------------------
104 {
105  // de-register run-transition notifications
106  cm_deregister_transition(TR_START);
107  cm_deregister_transition(TR_STOP);
108  cm_deregister_transition(TR_PAUSE);
109  cm_deregister_transition(TR_RESUME);
110 
111  return CM_SUCCESS;
112 }
113 
114 //-- Frontend Exit -------------------------------------------------
120 {
121  return CM_SUCCESS;
122 }
123 
124 //-- Frontend Loop -------------------------------------------------
129 {
130  return CM_SUCCESS;
131 }
132 
133 //-- Begin of Run --------------------------------------------------
138 INT begin_of_run(INT run_number, char *error)
139 {
140  return CM_SUCCESS;
141 }
142 
143 //-- End of Run ----------------------------------------------------
148 INT end_of_run(INT run_number, char *error)
149 {
150  return CM_SUCCESS;
151 }
152 
153 //-- Pause Run -----------------------------------------------------
158 INT pause_run(INT run_number, char *error)
159 {
160  return CM_SUCCESS;
161 }
162 
163 //-- Resume Run ----------------------------------------------------
168 INT resume_run(INT run_number, char *error)
169 {
170  return CM_SUCCESS;
171 }
172 
173 //------------------------------------------------------------------
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
DEVICE_DRIVER lemvac_driver[]
device driver list
Definition: lemvac_scfe.cxx:49
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
#define LEMVAC_OUT_VARS
number of variables in the set list
Definition: lemvac.h:11
INT lemvac_out(INT cmd,...)
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
INT max_event_size_frag
maximum event size for fragmented events (EQ_FRAGMENTED)
Definition: vme_fe.cxx:182
float lemvac_in[27]
holds the status info of lemvac input variables
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
#define LEMVAC_IN_VARS
number of variables in the get list
Definition: lemvac.h:10
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