MIDAS
Loading...
Searching...
No Matches
sy2527.c
Go to the documentation of this file.
1/********************************************************************\
2
3 Name: sy2527.c
4 Created by: Stefan Ritt
5
6 Contents: Example Slow Control Frontend program. Defines two
7 slow control equipments, one for a HV device and one
8 for a multimeter (usually a general purpose PC plug-in
9 card with A/D inputs/outputs. As a device driver,
10 the "null" driver is used which simulates a device
11 without accessing any hardware. The used class drivers
12 cd_hv and cd_multi act as a link between the ODB and
13 the equipment and contain some functionality like
14 ramping etc. To form a fully functional frontend,
15 the device driver "null" has to be replaces with
16 real device drivers.
17
18 $Id: frontend.c 2779 2005-10-19 13:14:36Z ritt $
19
20\********************************************************************/
21
22#include <stdio.h>
23#include "midas.h"
24#include "class/hv.h"
25#include "device/dd_sy2527.h"
26#include "bus/null.h"
27
28/*-- Globals -------------------------------------------------------*/
29
30/* The frontend name (client name) as seen by other MIDAS clients */
31const char *frontend_name = "FeSy2527";
32/* The frontend file name, don't change it */
34
35/* frontend_loop is called periodically if this variable is TRUE */
37
38/* a frontend status page is displayed with this frequency in ms */
40
41/* maximum event size produced by this frontend */
43
44/* maximum event size for fragmented events (EQ_FRAGMENTED) */
45INT max_event_size_frag = 5 * 1024 * 1024;
46
47/* buffer size to hold events */
49
50/*-- Equipment list ------------------------------------------------*/
51
52/* device driver list */
57
59 {"HV_SY2527", /* equipment name */
60 {6, 0, /* event ID, trigger mask */
61 "SYSTEM", /* event buffer */
62 EQ_SLOW, /* equipment type */
63 0, /* event source */
64 "MIDAS", /* format */
65 TRUE, /* enabled */
66 RO_ALWAYS | RO_TRANSITIONS, /* read when running and on transitions */
67 60000, /* read every 60 sec */
68 0, /* stop run after this event limit */
69 0, /* number of sub events */
70 1, /* log history every event */
71 "", "", ""} ,
72 cd_hv_read, /* readout routine */
73 cd_hv, /* class driver main routine */
74 sy2527_driver, /* device driver list */
75 NULL, /* init string */
76 },
77
78 {""}
79};
80
81
82/*-- Dummy routines ------------------------------------------------*/
83
85{
86 return 1;
87};
89{
90 return 1;
91};
92
93/*-- Frontend Init -------------------------------------------------*/
94
96{
97 return CM_SUCCESS;
98}
99
100/*-- Frontend Exit -------------------------------------------------*/
101
103{
104 return CM_SUCCESS;
105}
106
107/*-- Frontend Loop -------------------------------------------------*/
108
109static int i;
111{
112 i+=1;
113 return CM_SUCCESS;
114}
115
116/*-- Begin of Run --------------------------------------------------*/
117
119{
120 return CM_SUCCESS;
121}
122
123/*-- End of Run ----------------------------------------------------*/
124
126{
127 return CM_SUCCESS;
128}
129
130/*-- Pause Run -----------------------------------------------------*/
131
133{
134 return CM_SUCCESS;
135}
136
137/*-- Resume Run ----------------------------------------------------*/
138
140{
141 return CM_SUCCESS;
142}
143
144/*------------------------------------------------------------------*/
#define CM_SUCCESS
Definition midas.h:582
#define RO_TRANSITIONS
Definition midas.h:434
#define RO_ALWAYS
Definition midas.h:436
#define EQ_SLOW
Definition midas.h:418
INT run_number[2]
Definition mana.cxx:246
double count
Definition mdump.cxx:33
#define DF_PRIO_DEVICE
Definition midas.h:1052
DWORD BOOL
Definition midas.h:105
int INT
Definition midas.h:129
#define DF_REPORT_CHSTATE
Definition midas.h:1059
#define DF_REPORT_STATUS
Definition midas.h:1058
#define TRUE
Definition midas.h:182
#define POINTER_T
Definition midas.h:166
#define resume_run
#define pause_run
program test
Definition miniana.f:6
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
BOOL frontend_call_loop
frontend_loop is called periodically if this variable is TRUE
Definition sy2527.c:36
INT poll_event(INT source[], INT count, BOOL test)
Definition sy2527.c:84
const char * frontend_file_name
The frontend file name, don't change it.
Definition sy2527.c:33
INT max_event_size
maximum event size produced by this frontend
Definition sy2527.c:42
INT frontend_exit()
Frontend exit.
Definition sy2527.c:102
INT frontend_init()
Frontend initialization.
Definition sy2527.c:95
INT event_buffer_size
buffer size to hold events
Definition sy2527.c:48
INT max_event_size_frag
maximum event size for fragmented events (EQ_FRAGMENTED)
Definition sy2527.c:45
INT interrupt_configure(INT cmd, INT source[], POINTER_T adr)
Definition sy2527.c:88
EQUIPMENT equipment[]
Main structure for midas equipment.
Definition sy2527.c:58
const char * frontend_name
The frontend name (client name) as seen by other MIDAS clients.
Definition sy2527.c:31
INT display_period
a frontend status page is displayed with this frequency in ms
Definition sy2527.c:39
DEVICE_DRIVER sy2527_driver[]
Definition sy2527.c:53
static int i
Definition sy2527.c:109
INT begin_of_run(INT run_number, char *error)
Begin of Run.
Definition sy2527.c:118
INT frontend_loop()
Frontend loop.
Definition sy2527.c:110
INT end_of_run(INT run_number, char *error)
End of Run.
Definition sy2527.c:125