/*============================================================================= Name: bpmparam.h Abs: This include file contains many sizes and limits used by the slc bpm threads, micros, and VMS code. Auth: 23-JUN-2005, Debbie Rogind (drogind): created Rev: 25-OCT-2006, Debbie Rogind (drogind: compatibility for HER/LER beam abort data params added per bpmparam.hc on VAX; Add RNQABO_MXINJTSTMP. -----------------------------------------------------------------------------*/ #include "copyright_SLAC.h" /* SLAC copyright comments */ /*----------------------------------------------------------------------------- Mod: (newest to oldest) 08-Mar-2004, Ron MacKenzie: Change slcGetJobIndexByName() to slcGetJobEnumByName() 09-DEC-2004, diane fairley: Changed names, etc to meet coding standards =============================================================================*/ #ifndef bpmparam_H #define bpmparam_H /*===========================================================================*/ /* */ /* */ /* Abs: This file defines many sizes and limits used commonly by the BPM */ /* code in the Vax and in the micro's. */ /* */ /* Name: bpmparam.hc. */ /* */ /* Prev: None. */ /* */ /* Note: If you dont find what you are looking for here, try looking in */ /* BPMPARAMV.H (Vax-only code) or in SLCRMXI:BPMPARAMM.HM (micro-only */ /* code). */ /* */ /* Auth: Joanne Bogart (JRB) */ /* Revw: */ /* */ /*---------------------------------------------------------------------------*/ /***************************************************************************** ****************************************************************************** *** *** *** NOTE: There also exists a FORTRAN header file; SLCTXT:BPMPARAM.TXT *** *** If you modify one file, please modify the other. *** *** *** ****************************************************************************** *****************************************************************************/ #define MBPMP 80 /* Max # of BPMP modules (of all types) */ /* per micro. */ #define MBPMS 200 /* Max # of BPMS units per micro. */ #define BPM_ULIST_PRIMS 14 /* Max # of BPM-related primaries and */ /* pseudo-primaries in explicit unit */ /* list. */ #define BPM_ULIST_MAX 80 /* Max # of unit #'s in explicit unit */ /* list. */ #define MAX_BPM_CHAN 6 /* Max # of BPM channels (including RMS */ /* but not raw) per unit of BPMS. */ #define MAX_BPM_RAW_CHAN 4 /* Max # of BPM raw channels per unit */ /* of BPMS. */ #define MAXTOR 16 /* Max # of TORO units per micro. */ #define TOR_CAL_MAX_READS 7 /* Max # of TORO calibration pulser */ /* settings. */ #define MGADC 30 /* Max # of GADC modules per micro. */ #define MGADCH 16 /* Max # of channels per GADC module. */ #define MDUGPRIMS 5 /* Max # of GADC-related primaries. */ #define MDUGUNITS 50 /* Max total # of units of all DUGADC */ /* primaries per micro. */ #define MWIRE 30 /* Max # of WIRE units per micro. */ #define MWVFM 4 /* Max # of WVFM units per micro. */ /* MGAPM, MSLIT, and MARRY are defined */ /* in BPMPARAMV.H. MDUGUNITS and */ /* MGWVFM are defined in BPMPARAMM.HM. */ #define MAX_WIRE_CHAN 3 /* Max # of GADC channels per unit of */ /* WIRE. */ #define MAX_ARRY_CHAN 12 /* Max # of GADC channels per unit of */ /* ARRY. */ #define MAXMAX_ARRY_CHAN 150 /* extension of chn array so bscn chn */ /* lum monitor unit can use it. */ #define MAX_SLIT_CHAN 2 /* Max # of GADC channels per unit of */ /* SLIT. */ #define MAX_WVFM_FPTS 12 /* Max # of points in "fast mode" per */ /* unit of WVFM (i.e., per channel of */ /* LeCroy 2262 Waveform Digitizer). */ #define MFIFO 6 /* Max # of FIFO units per micro. */ #define MAX_FIFO_CHAN 32 /* Max # of data channels (words) read */ /* from one FIFO unit, not counting */ /* stat (if any) or checksum. */ #define MAX_SCAN_STEPS 400 /* Max # of scan steps (repositionings).*/ #define MAX_SCAN_STEPS_P1 (MAX_SCAN_STEPS+1) #define MSCANCORMIC 4 /* Max # of corrector cctlw's for beam */ /* scan per micro. */ #define MAXNMUX 10 /* Max # of mux steps per averaging */ /* step = # of input jacks per SP10T */ /* or R10T. */ #define MAXMUXPROC 24 /* Max # of BPMP's having mux'ed input */ /* per micro. */ #define MAXSP10T (MAXMUXPROC*4) /* Max # of SP10T's + R10T's per micro. */ #define MAXPDUCC 144 /* Max # of PDU channels (adding across */ /* crates) used by BPM job in micro. */ #define MAXPTTP (MAXPDUCC*(MAXNMUX+2)) /* Max # of PDU timing memory loca'ns */ /* (adding across PDU's) used per */ /* buffer ring. */ #define BPM_RING_MAXCAL 4 /* Max # of calibrations used in a */ /* single buffer ring. */ #define BPM_MAXPP 10 /* Max # of PP's driving readout into a */ /* single buffer ring. */ #define POSD_EXTRA_FRONT 4 /* What MPG always adds to posdel[0]. */ #define DRDEL_MAX 2 /* Max DR readout PP phase lag. */ #define BPM_MFBCONNS 10 /* Max # of ffeedback connections per */ /* BPM hardware readout buffer ring. */ #define BPM_MFBCHANS 84 /* Max total # of channels (BPMS units */ /* + TORO units + DUGADC channels) per */ /* set of ffeedback connections to one */ /* BPM hardware readout buffer ring. */ #define BPM_MFELB_MES 76 /* Max total # of R*4 values per */ /* ffeedback connection (X's + Y's + */ /* TMIT's + CH's). */ #define BPMTORO_CIRCMAX 500 /* Max # of readouts per micro of TORO */ /* data held in circular buffer. */ #define BPMARRY_CIRCMAX 400 /* Max # of readouts per micro of ARRY */ /* data held in circular buffer. */ #define BPMARRY_DUG_MCH 6 /* Max # of channels per ARRY for circ */ /* buffer (these channels must start */ /* with ARRY's 1st channel). */ #define BPM_CONNSUSP_MAXIDS 14 /* Max # of loop id's in ffeedback loop */ /* susp/unsusp request message. */ /* Following macro generates a list of all DUGADC primary names */ /* (must be in same order as MEASGAPM_INDEX,...,MEASWIRE_INDEX */ /* defined below): */ #define DUGADCPRIMARIES(nam) char nam[MDUGPRIMS][4] = {"GAPM","SLIT","WVFM","ARRY","WIRE"} #define CALB_BPMP_BIT 0x00000001 /* Bits in CALBBITS. */ #define CALB_TORO_BIT 0x00000002 #define CALB_GADC_BIT 0x00000004 #define DIAGOFFL_BIT 0x08000000 /* Use offline BPM's marked "ok". */ #define CALB_RINQLER_BIT 0x10000000 /* Calibration includes RINQ LER units. */ /* Note: DIAGOFFL_BIT and CALB_RINQLER_BIT also occur in MEASBITS. */ #define CALB_BPMP_INDEX 0 /* High-order subscript in Vax array */ #define CALB_TORO_INDEX 1 /* calb_ok_mask. */ #define CALB_GADC_INDEX 2 /* (Each 1 less than Fortran value.) */ #define CALB_MAX_INDEX 3 /* Number of CALB_*_INDEX's. */ #define MEASBPM_BIT 0x00000001 /* Bits in MEASBITS. */ #define MEASTOR_BIT 0x00000002 /* */ #define MEASKLYS_BIT 0x00000004 /* */ #define MEASGAPM_BIT 0x00000008 /* */ #define MEASSLIT_BIT 0x00000010 /* */ #define MEASWVFM_BIT 0x00000020 /* */ #define MEASARRY_BIT 0x00000040 /* */ #define MEASWIRE_BIT 0x00000080 /* */ #define MEASFIFO_BIT 0x00000200 /* */ #define MEASPULSID_BIT 0x00000400 /* */ #define MEASVETO_BIT 0x00000800 /* */ #define MEASSBST_BIT 0x00001000 /* */ #define TORCALBM_BIT 0x00002000 /* */ #define ADDMVACT_BIT 0x00004000 /* */ #define MAXDIFFS_BIT 0x00008000 /* */ #define MEASPTGM_BIT 0x00010000 /* PEP2 Trigger Generator. */ /* 0x00020000 through 0x04000000 available */ #define MEASGADC_MASK (MEASGAPM_BIT|MEASSLIT_BIT|MEASWVFM_BIT|MEASARRY_BIT|MEASWIRE_BIT) #define MEASKLYS_MASK (MEASKLYS_BIT|MEASSBST_BIT) #define MEASBPM_INDEX 0 /* Subscript in array of unit counts in */ #define MEASTOR_INDEX 1 /* explicit unit list, also high-order */ #define MEASKLYS_INDEX 2 /* subscript in Vax arrays device_totlens, */ #define MEASDUGADC_INDEX 3 /* measdata_lens, measdata_offsets, */ #define MEASGAPM_INDEX 3 /* ulist_prims. */ #define MEASSLIT_INDEX 4 /* (Each 1 less than Fortran value.) */ #define MEASWVFM_INDEX 5 #define MEASARRY_INDEX 6 #define MEASWIRE_INDEX 7 #define MEASPTGM_INDEX 8 #define MEASFIFO_INDEX 9 #define MEASPULSID_INDEX 10 #define MEASVETO_INDEX 11 #define MEASSBST_INDEX 12 /* Bits in YYSEQ_TYPE: */ #define MUXCHAINBIT 0x01 /* Mux'ing expected. */ #define XTRAYY2BIT 0x02 /* YY2B will be sent. */ #define WVFMLARGBIT 0x04 /* Read max # of pts from WVFM's.*/ #define WIREYY2BIT 0x08 /* Initial YY2 will be sent for */ /* scan positioning. */ #define KEEPRINQABBIT 0x10 /* Leave RINQ beamabort BPMP's */ /* undisturbed. */ #define DUMPREQONLYBIT 0x20 /* Request dumper to fire only */ /* on excl/incl_strt masks. */ #define PRIVMUXBIT 0x40 /* Private mux'ed bufring. */ #define CALBNUYYBIT 0x80 /* Calibration (non-pulser). */ /* Bits in FLIP: */ #define FLIP_BPMS_XCOOR 0x0001 /* Flip sign of X coordinate. */ #define FLIP_BPMD_2BNCH 0x0004 /* Same as BPMD_HSTA_2BNCH. */ #define FLIP_BPMD_RVSGN 0x0008 /* If 2BNCH, then the two bunches have */ /* opposite sign. */ #define XYZOUT 0x0040 /* Outgoing beam (FF, DR). */ #define XYZEBOTH 0x0080 /* DGRP has both E- and E+. */ #define XYZTOROP 0x0400 /* Time TORO's for E+. */ #define XYZDRDEL 0x0800 /* Use DRDEL; no mux'ing. */ #define BUNCH_TRAIN 0x1000 /* Bunch train for PEPII BPMs. */ #define TIMING_FIDUCIAL 0x2000 /* If this FLIP bit is set then use */ /* the stored beam timing fiducial; */ /* if this bit is not set use the */ /* beam injection timing fiducial. */ #define FLIP_RINQ_TMUX 0x4000 /* Allow true multiplexing of PEP2 */ /* RINQ BPMP's. */ #define FLIP_RINQ_SHPMPT 0x8000 /* RINQ readout in sharable bufring is */ /* preemptable by SCP request. */ /* Bits in MORFLGS (longword in bpm_measprep _req_ts */ /* and in bpm_measringcre_r eq_ts): */ #define MORF_RINQPHAS 0x00000001 /* Ask RINQ DSP to return phase */ /* measurement in place of tmit. */ /* Bits in RESTFLG (calibration restore): */ #define RESTCALS 0x01 /* Restore cal values. */ #define RESTPEDS 0x02 /* Restore peds. */ #define RESTATTN 0x04 /* Restore attn's. */ #define SEGID_TIMING 0 /* Measdef and calibration id's */ #define CALID_TIMING 0 /* reserved for timing diagnostic. */ #define SEGID_RINQABO_HER 0xFFF8 /* Measdef id for HER RINQ beam abort. */ #define SEGID_RINQABO_LER 0xFFF9 /* Measdef id for LER RINQ beam abort. */ #define SEGID_RINQDSPBOOT 0xFFFA /* Reserved for booting RINQ DSP's. */ #define SEGID_DELET 0xFFFD /* Descriptor marked for deletion. */ #define SEGID_MAX 0xFFEF /* Highest allowed SCP measdef id. */ #define SEGID_ANY 0xFFFF /* Wildcard measdef id. */ #define CALID_ANY SEGID_ANY /* Wildcard calibration id. */ #define CALID_PRIV_MIN 1000 /* Lowest & highest private calibration */ #define CALID_PRIV_MAX SEGID_MAX /* id's. */ #define BPM_RINQ_HERX 0 /* PEP2 ring indices for RINQ */ #define BPM_RINQ_LERX 1 /* beamabort-related structures (same as */ /* MPG's convention, but reverse of LER/HER */ /* RINQ multiplexing convention). */ /* In-phase and Quadrature to calibration angle conversion for long pulse BPMs */ #define In_phase_offset 2047 #define Quadrature_offset 2047 #define In_phase_scale 2047 #define Quadrature_scale 2047 /* Parameters for long_pulse_bpm_phas_type in bpm_measprep_req_ts */ #define X_phase_modulator 0x01 #define Y_phase_modulator 0x02 #define TMIT_phase_modulator 0x04 #define Calibrator_phase_modulator 0x08 #define PEP2BPMP_NS_TO_VDUNITS 25.6 /* In RINQ (PEP2) BPMP, full range of */ /* each vernier timing offset register */ /* is 256 (8 bits) = 10 nanoseconds */ /* (approx.). */ #define EPBPMP_NS_TO_VDUNITS 25.6 /* In EPBPMP, full range of each vernier */ /* timing offset register is 256 */ /* (8 bits) = 10 nanoseconds (approx.). */ #define BPM_TOL_MULT 8.0 /* Multiplication factor on tolerance */ /* used in determining if a X or Y */ /* value is sick (in alarm). */ #define PEP2RINGFID_SUB_TURNS 100 /* If RINQ BPMP using ring fiducial, */ /* then we reduce final PPDU timing */ /* value by PEP2RINGFID_SUB_TURNS */ /* integral ring turns. */ #define RNQABO_MXINJTSTMP 4 /* Max # of timestamps of most recent */ /* injection cycles returned with */ /* beamabort data. */ /* Programmable RINQ (PEP2) BPMP modes: */ #define RINQ_DSP_MODE0 0 /* None (no RINQ BPMP's allowed). */ #define RINQ_DSP_MODE1 1 /* PB_MEASP_MEAS, ring fid. */ #define RINQ_DSP_MODE2 2 /* PB_MEASP_MEAS, inj fid. */ #define RINQ_DSP_MODE3 3 /* PB_MEASP_TIM, ring fid. */ #define RINQ_DSP_MODE4 4 /* PB_MEASP_TIM, inj fid. */ #define RINQ_DSP_MODE5 5 /* PB_MEASP_SCAN, ring fid. */ #define RINQ_DSP_MODE6 6 /* PB_MEASP_SCAN, inj fid. */ #define RINQ_DSP_MODE7 7 /* PB_MEASP_SIN, sine fit, ring fid. */ #define RINQ_DSP_MODE8 8 /* PB_MEASP_ABORT, rinqabort, ring fid. */ #define RINQ_DSP_MODE9 9 /* PB_MEASP_CAL, bunch train, ring fid. */ #define RINQ_DSP_MODEA 10 /* PB_MEASP_CAL, single bunch, ring fid. */ #define RINQ_DSP_MODEB 11 /* PB_MEASP_REFINECAL, calb refinement. */ #define bpmparam_H #endif