Low-Energy Muon (LEM) Experiment  0.5.1
sample_scfe.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "midas.h"
#include "class/multi.h"
#include "lem_generic.h"
#include "LakeShore340.h"
#include "bronkhorst.h"
#include "thcd_100.h"
#include "tcpip_rs232.h"
#include "null.h"
Include dependency graph for sample_scfe.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[], PTYPE adr)
 
void sample_cryo_changed (INT hDB, INT dummy2, void *info)
 
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 = "Sample_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...
 
char sample_cryo [NAME_LENGTH]
 sample cryo name More...
 
DEVICE_DRIVER sample_driver []
 
EQUIPMENT equipment []
 equipment structure for the mfe.c More...
 

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 192 of file sample_scfe.c.

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 202 of file sample_scfe.c.

INT frontend_exit ( )

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

Definition at line 172 of file sample_scfe.c.

INT frontend_init ( )

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

Definition at line 139 of file sample_scfe.c.

References hDB, hKey, sample_cryo, and sample_cryo_changed().

INT frontend_loop ( )

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

Definition at line 182 of file sample_scfe.c.

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

Definition at line 99 of file sample_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 212 of file sample_scfe.c.

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

Definition at line 98 of file sample_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 222 of file sample_scfe.c.

void sample_cryo_changed ( INT  hDB,
INT  dummy2,
void *  info 
)

This routine writes the sample cryo name extracted from /Info/Sample Cryo (via hotlink) to the DD/ODB Names/LakeShore 340 Name. The DD has a hotlink itself onto the name and updates the calibration curves, zone settings, sensor names, ...

Parameters
hDBhandle to the ODB
dummy2not used
infonot used

Definition at line 111 of file sample_scfe.c.

References hKey, and sample_cryo.

Referenced by frontend_init().

Variable Documentation

INT display_period = 1000

a frontend status page is displayed with this frequency in ms

Definition at line 36 of file sample_scfe.c.

EQUIPMENT equipment[]
Initial value:
= {
{ "SampleCryo",
{70, 0,
"SYSTEM",
EQ_SLOW,
0,
"FIXED",
TRUE,
RO_RUNNING |
RO_TRANSITIONS,
30000,
0,
0,
1,
"", "", "",},
cd_multi_read,
cd_multi,
NULL,
},
{ "" }
}
DEVICE_DRIVER sample_driver[]
Definition: sample_scfe.c:54

equipment structure for the mfe.c

Definition at line 69 of file sample_scfe.c.

INT event_buffer_size = 10*10000

buffer size to hold events

Definition at line 45 of file sample_scfe.c.

BOOL frontend_call_loop = FALSE

frontend_loop is called periodically if this variable is TRUE

Definition at line 33 of file sample_scfe.c.

char* frontend_file_name = __FILE__

The frontend file name, don't change it.

Definition at line 30 of file sample_scfe.c.

char* frontend_name = "Sample_SC"

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

Definition at line 28 of file sample_scfe.c.

INT max_event_size = 10000

maximum event size produced by this frontend

Definition at line 39 of file sample_scfe.c.

INT max_event_size_frag = 5*1024*1024

maximum event size for fragmented events (EQ_FRAGMENTED)

Definition at line 42 of file sample_scfe.c.

char sample_cryo[NAME_LENGTH]

sample cryo name

Definition at line 48 of file sample_scfe.c.

Referenced by frontend_init(), and sample_cryo_changed().

DEVICE_DRIVER sample_driver[]
Initial value:
= {
{ "Lake340_Sample", ls340_in, 15, tcpip_rs232, DF_INPUT },
{ "Lake340_Sample", ls340_out, 8, tcpip_rs232, DF_OUTPUT },
{ "BH_Flow_1", bh_flow_in, 2, tcpip_rs232, DF_INPUT },
{ "BH_Flow_1", bh_flow_out, 2, tcpip_rs232, DF_OUTPUT },
{ "BH_Flow_2", bh_flow_in, 2, tcpip_rs232, DF_INPUT },
{ "BH_Flow_2", bh_flow_out, 2, tcpip_rs232, DF_OUTPUT },
{ "THCD_100_1", thcd_100_in, 1, tcpip_rs232, DF_INPUT },
{ "THCD_100_1", thcd_100_out, 1, tcpip_rs232, DF_OUTPUT },
{ "THCD_100_2", thcd_100_in, 1, tcpip_rs232, DF_INPUT },
{ "THCD_100_2", thcd_100_out, 1, tcpip_rs232, DF_OUTPUT },
{ "" }
}
INT ls340_in(INT cmd,...)
INT bh_flow_out(INT cmd,...)
Definition: bronkhorst.c:1141
INT bh_flow_in(INT cmd,...)
Definition: bronkhorst.c:1088
INT ls340_out(INT cmd,...)

device driver list for sample cryo and flow

Definition at line 54 of file sample_scfe.c.