Low-Energy Muon (LEM) Experiment  0.5.1
beamline_scfe.c File Reference
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "midas.h"
#include "msystem.h"
#include "bus/tcpip.h"
#include "class/generic.h"
#include "device/lem_epics.h"
#include "experim.h"
Include dependency graph for beamline_scfe.c:

Go to the source code of this file.

Macros

#define BL_CHANNELS   40
 number for muE4 beamline epics channels More...
 
#define BL_TOLERANCE   0.01
 when checking devices allow 1% difference between Demand/Measured values More...
 
#define BL_CHECK_MAX_COUNT   5
 

Functions

INT poll_event (INT source[], INT count, BOOL test)
 
INT interrupt_configure (INT cmd, INT source[], PTYPE adr)
 
void bl_check_info (INT hDB, INT hKey, void *dummy)
 
void bl_check_devices (INT hDB, INT hKey, void *dummy)
 
INT frontend_init ()
 
INT frontend_exit ()
 
INT frontend_loop ()
 
INT begin_of_run (INT run_number, char *error)
 
INT end_of_run (INT run_number, char *error)
 
INT pause_run (INT run_number, char *error)
 
INT resume_run (INT run_number, char *error)
 

Variables

char * frontend_name = "BeamLine SC"
 The frontend name (client name) as seen by other MIDAS clients. More...
 
char * frontend_file_name = __FILE__
 The frontend file name, don't change it. More...
 
BOOL frontend_call_loop = FALSE
 frontend_loop is called periodically if this variable is TRUE More...
 
INT display_period = 1000
 a frontend status page is displayed with this frequency in ms More...
 
INT max_event_size = 10000
 maximum event size produced by this frontend More...
 
INT max_event_size_frag = 5*1024*1024
 maximum event size for fragmented events (EQ_FRAGMENTED) More...
 
INT event_buffer_size = 10*10000
 buffer size to hold events More...
 
BEAMLINE_SETTINGS beamline_settings
 
BEAMLINE_MONITORING beamline_monitoring
 
BEAMLINE_EVENT beamline_event
 
INT bl_check_counter [BL_CHANNELS]
 counter needed in the beamline check More...
 
DEVICE_DRIVER bl_driver []
 device driver list More...
 
EQUIPMENT equipment []
 equipment structure for the mfe.c More...
 

Macro Definition Documentation

#define BL_CHANNELS   40

number for muE4 beamline epics channels

Definition at line 23 of file beamline_scfe.c.

Referenced by bl_check_devices(), bl_check_info(), and frontend_init().

#define BL_CHECK_MAX_COUNT   5

Definition at line 25 of file beamline_scfe.c.

Referenced by bl_check_devices().

#define BL_TOLERANCE   0.01

when checking devices allow 1% difference between Demand/Measured values

Definition at line 24 of file beamline_scfe.c.

Referenced by bl_check_devices().

Function Documentation

INT begin_of_run ( INT  run_number,
char *  error 
)

Called by the mfe at the begin of the run. Here it is only a dummy.

Definition at line 277 of file beamline_scfe.c.

void bl_check_info ( INT  hDB,
INT  hKey,
void *  dummy 
)
INT end_of_run ( INT  run_number,
char *  error 
)

Called by the mfe at the end of the run. Here it is only a dummy.

Definition at line 287 of file beamline_scfe.c.

INT frontend_exit ( )

Called by the mfe at exiting stage. Here it is only a dummy.

Definition at line 257 of file beamline_scfe.c.

INT frontend_init ( )

Called by the master frontend (mfe) at initializing stage. Here it is only a dummy.

Definition at line 185 of file beamline_scfe.c.

References beamline_monitoring, beamline_settings, BL_CHANNELS, bl_check_counter, bl_check_devices(), bl_check_info(), BEAMLINE_MONITORING::bl_checking, hDB, and hKey.

INT frontend_loop ( )

Called by the mfe in the main loop. Here it is only a dummy.

Definition at line 267 of file beamline_scfe.c.

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

Definition at line 96 of file beamline_scfe.c.

INT pause_run ( INT  run_number,
char *  error 
)

Called by the mfe when the run is paused. Here it is only a dummy.

Definition at line 297 of file beamline_scfe.c.

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

Definition at line 95 of file beamline_scfe.c.

INT resume_run ( INT  run_number,
char *  error 
)

Called by the mfe when the run is resumed. Here it is only a dummy.

Definition at line 307 of file beamline_scfe.c.

Variable Documentation

BEAMLINE_EVENT beamline_event

Definition at line 53 of file beamline_scfe.c.

BEAMLINE_MONITORING beamline_monitoring

bl_checking = 0: monitoring disabled bl_checking = 1: monitoring enabled bl_checking = 2: try also to switch on power supply

Definition at line 50 of file beamline_scfe.c.

Referenced by frontend_init().

BEAMLINE_SETTINGS beamline_settings

Definition at line 49 of file beamline_scfe.c.

Referenced by frontend_init().

INT bl_check_counter[BL_CHANNELS]

counter needed in the beamline check

Definition at line 54 of file beamline_scfe.c.

Referenced by bl_check_devices(), and frontend_init().

DEVICE_DRIVER bl_driver[]
Initial value:
= {
{ "Beamline", lem_epics, BL_CHANNELS, tcpip, DF_PRIO_DEVICE },
{ "" }
}
#define BL_CHANNELS
number for muE4 beamline epics channels
Definition: beamline_scfe.c:23
INT lem_epics(INT cmd,...)
Definition: lem_epics.c:407

device driver list

Definition at line 59 of file beamline_scfe.c.

INT display_period = 1000

a frontend status page is displayed with this frequency in ms

Definition at line 38 of file beamline_scfe.c.

EQUIPMENT equipment[]
Initial value:
= {
{ "Beamline",
{99, 0,
"SYSTEM",
EQ_SLOW,
0,
"FIXED",
TRUE,
RO_RUNNING |
RO_TRANSITIONS,
60000,
0,
0,
1,
"", "", "",},
cd_gen_read,
cd_gen,
NULL,
},
{ "" }
}
DEVICE_DRIVER bl_driver[]
device driver list
Definition: beamline_scfe.c:59

equipment structure for the mfe.c

Definition at line 66 of file beamline_scfe.c.

INT event_buffer_size = 10*10000

buffer size to hold events

Definition at line 47 of file beamline_scfe.c.

BOOL frontend_call_loop = FALSE

frontend_loop is called periodically if this variable is TRUE

Definition at line 35 of file beamline_scfe.c.

char* frontend_file_name = __FILE__

The frontend file name, don't change it.

Definition at line 32 of file beamline_scfe.c.

char* frontend_name = "BeamLine SC"

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

Definition at line 30 of file beamline_scfe.c.

INT max_event_size = 10000

maximum event size produced by this frontend

Definition at line 41 of file beamline_scfe.c.

INT max_event_size_frag = 5*1024*1024

maximum event size for fragmented events (EQ_FRAGMENTED)

Definition at line 44 of file beamline_scfe.c.