TYPE large_int_by_byte = PACKED RECORD byte : PACKED ARRAY [0..7] OF byte ; END ; large_int_by_long = PACKED RECORD long : ARRAY [0..1] OF INTEGER ; END ; int_by_byte = [LONG] PACKED RECORD byte : PACKED ARRAY [0..3] OF byte ; END ; available_data_options = ( MP_sptrg_gsect, MP_datablock, MP_trgtwr, MP_refset, MP_gl_thrsh, MP_xsysmon, MP_per_bunch, MP_foreign ) ; mon_request = PACKED RECORD data_option : [LONG] available_data_options ; user_data : ARRAY [1..3] OF INTEGER ; user_name : STRING(16) ; proc_name : STRING(16) ; END ; {** All the "*_section" data types specify the data transferred ELN -> VMS } {** They must match the FORTRAN common block LV1_MPOOL_RAW.INC } {** Remember that FORTRAN and EPASCAL scan array indices in oposite order. } {** That is consecutive memory locations will be succcessive values of the: } {** last array index for EPASCAL } {** first array index for FORTRAN } general_section = PACKED RECORD delta_time : INTEGER ; delta_beam_crossing : INTEGER ; delta_veto_crossing : INTEGER ; delta_global_fired : INTEGER ; delta_event_transfer : INTEGER ; delta_level_0 : INTEGER ; framework_status : INTEGER ; trouble_warning_bits : INTEGER ; delta_68kstate_dbbbusy : INTEGER ; delta_68kstate_waitsvrd : INTEGER ; delta_68kstate_run68k : INTEGER ; delta_68kstate_searchvbd : INTEGER ; delta_68kstate_rundma : INTEGER ; delta_68kstate_none : INTEGER ; delta_l15_potential : INTEGER ; delta_l15_cycle : INTEGER ; delta_l15_pass : INTEGER ; delta_l15_reject : INTEGER ; delta_l15_skip : INTEGER ; delta_l15_timeout : INTEGER ; delta_l15_dead_crossing : INTEGER ; END ; sptrg_level15_counts = PACKED RECORD st_Confirm : INTEGER ; st_Reject : INTEGER ; st_Cycle : INTEGER ; st_Skip : INTEGER ; st_DeadX : INTEGER ; st_TimeOut : INTEGER ; END ; spec_trig_count_and_increment = PACKED RECORD stfired : INTEGER ; aofired : INTEGER ; stenbld : INTEGER ; stvetos : ARRAY [0..6] OF INTEGER ; not_L0_inc : INTEGER ; not_L0_cnt : INTEGER ; L15_incr : sptrg_level15_counts ; L15_cnt : sptrg_level15_counts ; END ; geo_sect_count_increment = PACKED RECORD gsectdgtz : ARRAY [0..31] OF INTEGER ; gsectbusy : ARRAY [0..31] OF INTEGER ; END ; sptrg_gsect_section = PACKED RECORD sptrgprog : ARRAY [0..31] OF spec_trig ; sptrgcnt : ARRAY [0..31] OF spec_trig_count_and_increment ; gsectprog : ARRAY [0..31] OF INTEGER ; gsectcnt : geo_sect_count_increment ; general : general_section ; END ; data_block_section = PACKED RECORD dblock : data_block_967 ; general : general_section ; END ; trig_tower_array = ARRAY [pos_e..neg_e,e_1..e_20,p_1..p_32] OF word ; trig_tower_section = PACKED RECORD twr : trig_tower_array ; general : general_section ; END ; {** the routines refreshing the monitoring pool use (hardcoded, direct access) } {** the definition of the data types refset_pattern and refset_section.pattern } refset_status = PACKED RECORD refset : ARRAY [EMEt_ref..TOTEt_ref,ref_0..ref_3] OF word ; general : general_section ; END ; refset_pattern = ARRAY [pos_e..neg_e,e_1..e_20,p_1..p_32] OF INTEGER ; LT_refset_pattern = ARRAY [pos_e..neg_e,e_1_4..e_17_20,p_1_8..p_25_32] OF INTEGER ; refset_section = PACKED RECORD status : refset_status ; pattern : ARRAY [EMEt_ref..TOTEt_ref,ref_0..ref_3] OF refset_pattern ; LT_pattern : ARRAY [ref_0..ref_7] OF LT_refset_pattern ; END ; global_threshold_section = PACKED RECORD gl_energy : ARRAY [1..7,0..31,0..1] OF INTEGER ; gl_count : ARRAY [EMEt_cmp..TOTEt_cmp,ref_0..ref_3,0..15,0..1] OF INTEGER; general : general_section ; END ; per_bunch_section = PACKED RECORD L1_fired : ARRAY [1..6] OF INTEGER ; Fast_L0_good : ARRAY [1..6] OF INTEGER ; Live_crossing : ARRAY [1..6] OF INTEGER ; LiveX_Fast_L0_Good : ARRAY [1..6] OF INTEGER ; LiveX_L0_Single : ARRAY [1..6] OF INTEGER ; LiveX_L0_Sgl_Ctr : ARRAY [1..6] OF INTEGER ; general : general_section ; END ; foreign_section = PACKED RECORD foreign_scaler : ARRAY [1..44] OF INTEGER ; general : general_section ; END ; xsysmon_section = PACKED RECORD command_id : INTEGER ; message_id : INTEGER ; priority : INTEGER ; status : level1_status ; prescale : ARRAY [0..31] OF INTEGER ; beam_x_g : INTEGER ; beam_x_u : INTEGER ; st_fired_g : ARRAY [0..31] OF INTEGER ; st_fired_u : ARRAY [0..31] OF INTEGER ; st_expos_g : ARRAY [0..31] OF INTEGER ; st_expos_u : ARRAY [0..31] OF INTEGER ; beam_x_sbsc : INTEGER ; st_andor : ARRAY [0..31] OF INTEGER ; st_vetos : ARRAY [0..31,0..7] OF INTEGER ; l0_good_g : INTEGER ; l0_good_u : INTEGER ; l1_fired_g : INTEGER ; l1_fired_u : INTEGER ; l1_trnsf_g : INTEGER ; l1_trnsf_u : INTEGER ; l15_cycle_g : INTEGER ; l15_cycle_u : INTEGER ; l15_deadX_g : INTEGER ; l15_deadX_u : INTEGER ; stl15_input : ARRAY [0..15] OF INTEGER ; stl15_reject : ARRAY [0..15] OF INTEGER ; END ; {** the following types describe the content of the ELN shared memory area } {** that will be used } {** i) by TRICS to refresh the monitoring pool } {** ii) by the MPOOL_SERVER job to retrieve and send monitoring data to VMS } {** (with minimal additional formatting) } spy_state_type = [BYTE] ( fresh, stale ) ; refresh_mpool_state = [BYTE] ( refreshed, not_refreshed ) ; level1_status = [LONG] PACKED RECORD framework : framework_state_type ; spy : spy_state_type ; monit_pool : refresh_mpool_state ; reserved : byte ; END ; sptrg_counts = PACKED RECORD stfired : large_int_by_byte ; stenbld : large_int_by_byte ; aofired : INTEGER ; stvetos : ARRAY [0..7] OF INTEGER ; enbld_and_notL0 : INTEGER ; L15 : sptrg_level15_counts ; END ; Foreign_Per_Bunch_Scalers = ( LiveX, LiveX_L0_S, LiveX_FL0_G, LiveX_L0_SC ) ; Foreign_Scalers = PACKED RECORD { ***** WARNING ***** the foreign scalers are recorded in descending order } CASE INTEGER OF { i.e. foreign.scaler[44] is foreign scaler #1 } 0 : ( scaler : ARRAY [1..44] OF large_int_by_byte ) ; {cf. warning} 1 : ( scaler_up : ARRAY [29..44] OF large_int_by_byte ; {cf. warning} per_bunch : ARRAY [1..6,LiveX..LiveX_L0_SC] OF large_int_by_byte ; scaler_down : ARRAY [1..4] OF large_int_by_byte ) ; {cf. warning} END ; count_snapshot = PACKED RECORD time : LARGE_INTEGER ; beamxcnt : large_int_by_byte ; transfcnt : large_int_by_byte ; stdigcnt : large_int_by_byte ; lv0cnt : large_int_by_byte ; vetoxcnt : INTEGER ; sptrgcnt : ARRAY [0..31] OF sptrg_counts ; strtdigtz : ARRAY [0..31] OF INTEGER ; fendbusy : ARRAY [0..31] OF INTEGER ; Vtrans_idle : large_int_by_byte ; DBB_busy : large_int_by_byte ; Vtrans_prepare : large_int_by_byte ; Vtrans_wait_VBD : large_int_by_byte ; Vtrans_wait_DMA : large_int_by_byte ; Vtrans_display : large_int_by_byte ; L1_per_bunch : ARRAY [1..6] OF large_int_by_byte ; L0_per_bunch : ARRAY [1..6] OF large_int_by_byte ; L15_potential : large_int_by_byte ; L15_Cycle : large_int_by_byte ; L15_Accept : large_int_by_byte ; L15_Reject : large_int_by_byte ; L15_Skip : large_int_by_byte ; L15_Timeout : large_int_by_byte ; L15_DeadX : large_int_by_byte ; foreign : Foreign_Scalers ; END ; monitoring_data = { *** WARNING *** don't forget to ZERO new entries in } RECORD { MOD404_HANDLE_MONIT_POOL.PAS } lock : AREA_LOCK_VARIABLE ; {^} status : level1_status ; {^} twb : int_by_byte ; {^} dblock : data_block_967 ; {^} sptrg : ARRAY [0..31] OF spec_trig ; {^} gsect : ARRAY [0..31] OF geographic_section ; {^} current : count_snapshot ; {^} previous : count_snapshot ; {^} twr : trig_tower_array ; {^} refset : refset_section ; {^} thresh : global_threshold_section {^} END ; {If a section is added, remember to zero data in handle_monit_pool}