MIDAS
Loading...
Searching...
No Matches
sy2527.c File Reference
#include <stdio.h>
#include "midas.h"
#include "class/hv.h"
#include "device/dd_sy2527.h"
#include "bus/null.h"
Include dependency graph for sy2527.c:

Go to the source code of this file.

Functions

INT poll_event (INT source[], INT count, BOOL test)
 
INT interrupt_configure (INT cmd, INT source[], POINTER_T adr)
 
INT frontend_init ()
 Frontend initialization.
 
INT frontend_exit ()
 Frontend exit.
 
INT frontend_loop ()
 Frontend loop.
 
INT begin_of_run (INT run_number, char *error)
 Begin of Run.
 
INT end_of_run (INT run_number, char *error)
 End of Run.
 
INT pause_run (INT run_number, char *error)
 Pause Run.
 
INT resume_run (INT run_number, char *error)
 Resume Run.
 

Variables

const charfrontend_name = "FeSy2527"
 The frontend name (client name) as seen by other MIDAS clients.
 
const charfrontend_file_name = __FILE__
 The frontend file name, don't change it.
 
BOOL frontend_call_loop = TRUE
 frontend_loop is called periodically if this variable is TRUE
 
INT display_period = 000
 a frontend status page is displayed with this frequency in ms
 
INT max_event_size = 10000
 maximum event size produced by this frontend
 
INT max_event_size_frag = 5 * 1024 * 1024
 maximum event size for fragmented events (EQ_FRAGMENTED)
 
INT event_buffer_size = 10 * 10000
 buffer size to hold events
 
DEVICE_DRIVER sy2527_driver []
 
EQUIPMENT equipment []
 Main structure for midas equipment.
 
static int i
 

Function Documentation

◆ begin_of_run()

INT begin_of_run ( INT  run_number,
char error 
)

Begin of Run.

Called every run start transition. Set equipment status in ODB, start acquisition on the modules.

Parameters
[in]run_numberNumber of the run being started
[out]errorCan be used to write a message string to midas.log

Definition at line 118 of file sy2527.c.

119{
120 return CM_SUCCESS;
121}
#define CM_SUCCESS
Definition midas.h:582

◆ end_of_run()

INT end_of_run ( INT  run_number,
char error 
)

End of Run.

Called every stop run transition. Set equipment status in ODB, stop acquisition on the modules.

Parameters
[in]run_numberNumber of the run being ended
[out]errorCan be used to write a message string to midas.log

Definition at line 125 of file sy2527.c.

126{
127 return CM_SUCCESS;
128}

◆ frontend_exit()

INT frontend_exit ( void  )

Frontend exit.

Runs at frontend shutdown. Disconnect hardware and set equipment status in ODB

Returns
Midas status code

Definition at line 102 of file sy2527.c.

103{
104 return CM_SUCCESS;
105}

◆ frontend_init()

INT frontend_init ( void  )

Frontend initialization.

Runs once at application startup. We initialize the hardware and optical interfaces and set the equipment status in ODB. We also lock the frontend to once physical cpu core.

Returns
Midas status code

Definition at line 95 of file sy2527.c.

96{
97 return CM_SUCCESS;
98}

◆ frontend_loop()

INT frontend_loop ( void  )

Frontend loop.

If frontend_call_loop is true, this routine gets called when the frontend is idle or once between every event.

Returns
Midas status code

Definition at line 110 of file sy2527.c.

111{
112 i+=1;
113 return CM_SUCCESS;
114}
static int i
Definition sy2527.c:109

◆ interrupt_configure()

INT interrupt_configure ( INT  cmd,
INT  source[],
POINTER_T  adr 
)

Definition at line 88 of file sy2527.c.

89{
90 return 1;
91};

◆ pause_run()

INT pause_run ( INT  run_number,
char error 
)

Pause Run.

Called every pause run transition.

Parameters
[in]run_numberNumber of the run being ended
[out]errorCan be used to write a message string to midas.log
Returns
Midas status code

Definition at line 132 of file sy2527.c.

133{
134 return CM_SUCCESS;
135}

◆ poll_event()

INT poll_event ( INT  source[],
INT  count,
BOOL  test 
)

Definition at line 84 of file sy2527.c.

85{
86 return 1;
87};

◆ resume_run()

INT resume_run ( INT  run_number,
char error 
)

Resume Run.

Called every resume run transition.

Parameters
[in]run_numberNumber of the run being ended
[out]errorCan be used to write a message string to midas.log
Returns
Midas status code

Definition at line 139 of file sy2527.c.

140{
141 return CM_SUCCESS;
142}

Variable Documentation

◆ display_period

INT display_period = 000

a frontend status page is displayed with this frequency in ms

Definition at line 39 of file sy2527.c.

◆ equipment

EQUIPMENT equipment[]
Initial value:
= {
{"HV_SY2527",
{6, 0,
"SYSTEM",
0,
"MIDAS",
TRUE,
60000,
0,
0,
1,
"", "", ""} ,
NULL,
},
{""}
}
#define RO_TRANSITIONS
Definition midas.h:434
#define RO_ALWAYS
Definition midas.h:436
#define EQ_SLOW
Definition midas.h:418
#define TRUE
Definition midas.h:182
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
DEVICE_DRIVER sy2527_driver[]
Definition sy2527.c:53

Main structure for midas equipment.

Definition at line 58 of file sy2527.c.

58 {
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};

◆ event_buffer_size

INT event_buffer_size = 10 * 10000

buffer size to hold events

Definition at line 48 of file sy2527.c.

◆ frontend_call_loop

BOOL frontend_call_loop = TRUE

frontend_loop is called periodically if this variable is TRUE

Definition at line 36 of file sy2527.c.

◆ frontend_file_name

const char* frontend_file_name = __FILE__

The frontend file name, don't change it.

Definition at line 33 of file sy2527.c.

◆ frontend_name

const char* frontend_name = "FeSy2527"

The frontend name (client name) as seen by other MIDAS clients.

Definition at line 31 of file sy2527.c.

◆ i

int i
static

Definition at line 109 of file sy2527.c.

◆ max_event_size

INT max_event_size = 10000

maximum event size produced by this frontend

Definition at line 42 of file sy2527.c.

◆ max_event_size_frag

INT max_event_size_frag = 5 * 1024 * 1024

maximum event size for fragmented events (EQ_FRAGMENTED)

Definition at line 45 of file sy2527.c.

◆ sy2527_driver

DEVICE_DRIVER sy2527_driver[]
Initial value:
= {
{""}
}
#define DF_PRIO_DEVICE
Definition midas.h:1052
#define DF_REPORT_CHSTATE
Definition midas.h:1059
#define DF_REPORT_STATUS
Definition midas.h:1058

Definition at line 53 of file sy2527.c.

53 {
55 {""}
56};