Low-Energy Muon (LEM) Experiment  0.5.2
k3390_scfe.cxx
Go to the documentation of this file.
1 /********************************************************************\
2 
3  Name: k3390_scfe.cxx
4  Created by: Zaher Salman
5 
6  Contents: Midas Slow control frontend for the Keithtley 3390 AFG
7 
8 \********************************************************************/
9 
10 #include <cstdio>
11 #include <cstdlib>
12 #include <cstring>
13 #include <cmath>
14 
15 #include "midas.h"
16 #include "mfe.h"
17 
18 #include "class/multi.h"
19 #include "bus/tcpip.h"
20 #include "keithley3390.h"
21 
22 //-- Globals -------------------------------------------------------
23 
25 const char *frontend_name = "K3390 SC";
27 const char *frontend_file_name = __FILE__;
28 
30 BOOL frontend_call_loop = TRUE;
31 
33 INT display_period = 1000;
34 
36 INT max_event_size = 10000;
37 
39 INT max_event_size_frag = 5*1024*1024;
40 
42 INT event_buffer_size = 10*10000;
43 
44 //-- Equipment list ------------------------------------------------
45 
49 DEVICE_DRIVER K3390_driver[] = {
50  { "K3390_in", keithley3390_in, 9, tcpip, DF_INPUT },
51  { "K3390_out", keithley3390_out, 9, tcpip, DF_OUTPUT },
52  { "" }
53 };
54 
64 
66 EQUIPMENT equipment[] = {
67 
68  { "K3390", // equipment name
69  {94, 0, // event ID, trigger mask
70  "SYSTEM", // event buffer
71  EQ_SLOW, // equipment type
72  0, // event source
73  "FIXED", // format
74  TRUE, // enabled
75  RO_RUNNING |
76  RO_TRANSITIONS, // read when running and on transitions
77  1000, // read every 1 sec
78  0, // stop run after this event limit
79  0, // number of sub events
80  1, // log history every event
81  "", "", "",},
82  cd_multi_read, // readout routine
83  cd_multi, // class driver main routine
84  K3390_driver, // device driver list
85  NULL, // init string
86  },
87 
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
INT max_event_size_frag
maximum event size for fragmented events (EQ_FRAGMENTED)
Definition: vme_fe.cxx:182
DEVICE_DRIVER K3390_driver[]
Definition: k3390_scfe.cxx:49
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