Low-Energy Muon (LEM) Experiment  0.5.2
sep61_ps64_vac_scfe.cxx
Go to the documentation of this file.
1 /********************************************************************\
2 
3  Name: sep61_ps64_vac_scfe.cxx
4  Created by: Andreas Suter
5 
6  Contents: Midas frontend to readout the Sep61 and PS64 vacuum control unit
7 
8 
9 \********************************************************************/
10 
11 #include <cstdio>
12 #include "midas.h"
13 #include "mfe.h"
14 #include "class/multi.h"
15 #include "ps64.h"
16 #include "sep61vac.h"
17 #include "sps_tcpip_old.h"
18 #include "sps_tcpip.h"
19 
20 //-- Globals -------------------------------------------------------
21 
23 const char *frontend_name = "SEP61_PS64_VAC_SC";
25 const char *frontend_file_name = __FILE__;
26 
28 BOOL frontend_call_loop = FALSE;
29 
31 INT display_period = 1000;
32 
34 INT max_event_size = 10000;
35 
37 INT max_event_size_frag = 5*1024*1024;
38 
40 INT event_buffer_size = 10*10000;
41 
42 //-- Equipment list ------------------------------------------------
43 
45 DEVICE_DRIVER sep61ps64vac_driver[] = {
46  { "Sep61Vac", sep61vac, SEP61VAC_VARS, sps_tcpip_old, DF_INPUT },
47  { "PS64 in", ps64_in, PS64_IN_VARS, sps_tcpip, DF_INPUT },
48  { "PS64 out", ps64_out, PS64_OUT_VARS, sps_tcpip, DF_OUTPUT },
49  { "" }
50 };
51 
61 
63 EQUIPMENT equipment[] = {
64 
65  { "Sep61Ps64Vac", // equipment name
66  {79, 0, // event ID, trigger mask
67  "SYSTEM", // event buffer
68  EQ_SLOW, // equipment type
69  0, // event source
70  "FIXED", // format
71  TRUE, // enabled
72  RO_RUNNING |
73  RO_TRANSITIONS, // read when running and on transitions
74  60000, // read every 60 sec
75  0, // stop run after this event limit
76  0, // number of sub events
77  1, // log history every event
78  "", "", "",},
79  cd_multi_read, // readout routine
80  cd_multi, // class driver main routine
81  sep61ps64vac_driver, // device driver list
82  NULL, // init string
83  },
84 
85  { "" }
86 };
87 
88 
89 
90 //-- Dummy routines ------------------------------------------------
91 
92 INT poll_event(INT source, INT count, BOOL test) {return 1;};
93 INT interrupt_configure(INT cmd, INT source, POINTER_T adr) {return 1;};
94 
95 //-- Frontend Init -------------------------------------------------
101 {
102  // de-register run-transition notifications
103  cm_deregister_transition(TR_START);
104  cm_deregister_transition(TR_STOP);
105  cm_deregister_transition(TR_PAUSE);
106  cm_deregister_transition(TR_RESUME);
107 
108  return CM_SUCCESS;
109 }
110 
111 //-- Frontend Exit -------------------------------------------------
117 {
118  return CM_SUCCESS;
119 }
120 
121 //-- Frontend Loop -------------------------------------------------
127 {
128  return CM_SUCCESS;
129 }
130 
131 //-- Begin of Run --------------------------------------------------
136 INT begin_of_run(INT run_number, char *error)
137 {
138  return CM_SUCCESS;
139 }
140 
141 //-- End of Run ----------------------------------------------------
146 INT end_of_run(INT run_number, char *error)
147 {
148  return CM_SUCCESS;
149 }
150 
151 //-- Pause Run -----------------------------------------------------
156 INT pause_run(INT run_number, char *error)
157 {
158  return CM_SUCCESS;
159 }
160 
161 //-- Resume Run ----------------------------------------------------
166 INT resume_run(INT run_number, char *error)
167 {
168  return CM_SUCCESS;
169 }
170 
171 //------------------------------------------------------------------
DEVICE_DRIVER sep61ps64vac_driver[]
device driver list
#define SEP61VAC_VARS
number of variables in the get list
Definition: sep61vac.h:12
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
INT ps64_out(INT cmd,...)
#define PS64_OUT_VARS
number of variables in the get list
Definition: ps64.h:11
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 ps64_in(INT cmd,...)
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
#define PS64_IN_VARS
number of variables in the get list
Definition: ps64.h:10
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
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
INT sep61vac(INT cmd,...)