Low-Energy Muon (LEM) Experiment  0.5.2
tfl_scfe.cxx
Go to the documentation of this file.
1 /********************************************************************\
2 
3  Name: tfl_scfe.cxx
4  Created by: Andreas Suter
5 
6  Contents: midas slowcontrol frontend to handle the
7  Phytron MCC controller needed for the transfer line.
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 "phytron_mcc.h"
21 #include "tcpip_rs232.h"
22 
23 //-- Globals -------------------------------------------------------
24 
26 const char *frontend_name = "TFL_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 //-- Equipment list ------------------------------------------------
46 
51 DEVICE_DRIVER tfl_driver[] = {
52  { "tfl_in", phytron_mcc_in, 3, tcpip_rs232, DF_INPUT },
53  { "tfl_out", phytron_mcc_out, 2, tcpip_rs232, DF_OUTPUT },
54  { "" }
55 };
56 
66 
68 EQUIPMENT equipment[] = {
69 
70  { "TFL", // equipment name
71  {76, 0, // event ID, trigger mask
72  "SYSTEM", // event buffer
73  EQ_SLOW, // equipment type
74  0, // event source
75  "FIXED", // format
76  TRUE, // enabled
77  RO_RUNNING |
78  RO_TRANSITIONS, // read when running and on transitions
79  30000, // read every 30 sec
80  0, // stop run after this event limit
81  0, // number of sub events
82  1, // log history every event
83  "", "", "",},
84  cd_multi_read, // readout routine
85  cd_multi, // class driver main routine
86  tfl_driver, // device driver list
87  NULL, // init string
88  },
89 
90  { "" }
91 };
92 
93 //-- Dummy routines ------------------------------------------------
94 
95 INT poll_event(INT source, INT count, BOOL test) {return 1;};
96 INT interrupt_configure(INT cmd, INT source, POINTER_T adr) {return 1;};
97 
98 //-- 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 -------------------------------------------------
130 {
131  return CM_SUCCESS;
132 }
133 
134 //-- Begin of Run --------------------------------------------------
139 INT begin_of_run(INT run_number, char *error)
140 {
141  return CM_SUCCESS;
142 }
143 
144 //-- End of Run ----------------------------------------------------
149 INT end_of_run(INT run_number, char *error)
150 {
151  return CM_SUCCESS;
152 }
153 
154 //-- Pause Run -----------------------------------------------------
159 INT pause_run(INT run_number, char *error)
160 {
161  return CM_SUCCESS;
162 }
163 
164 //-- Resume Run ----------------------------------------------------
169 INT resume_run(INT run_number, char *error)
170 {
171  return CM_SUCCESS;
172 }
173 
174 //------------------------------------------------------------------
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 tfl_driver[]
Definition: tfl_scfe.cxx:51
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