/*============================================================================= Name: bpmstat.h Abs: Bit definitions for HSTA (supertype 2) and STAT (supertype 3) for various BPM-related primaries. Auth: 23-JUN-2005, Debbie Rogind (drogind): Rev: 02-SEP-2005, DROGIND added STAT_GOOD, STAT_OK, STAT_DEAD, STAT_SICK -----------------------------------------------------------------------------*/ #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 =============================================================================*/ /*============================================================================== **CMS**=C_INC Abs: Bit definitions for HSTA (supertype 2) and STAT (supertype 3) for various BPM-related primaries. Name: BPMSTAT.HC Prev: STATUS.HC (Optional) STAT_SICK, STAT_DEAD, STAT_OK. Auth: Joanne Bogart (JRB). ****************************************************************************** ****************************************************************************** *** *** *** NOTE: There also exists a FORTRAN header file; SLCTXT:BPMSTAT.TXT *** *** If you modify one file, please modify the other. *** *** *** ****************************************************************************** ****************************************************************************** Mod: 11-Mar-2004, Mike Zelazny (zelazny): BPMS HSTA&STAT Maintenance & Checkout. 17-Nov-2003, Tony Gromme (TEG): Add HSTA_ABKMONINJ. 04-Nov-2003, Mike Zelazny (zelazny): HSTA_BPMP_(H|L)ER_REJECT for auto-calibration. 09-Feb-2000 Karey Krauter (KEK) add hsta bit for a pep bpm variety that Ron Johnson is playing with 17-Dec-1997, Tony Gromme (TEG): Old old bug: For GADC's only, usage of HSTA bit ADD7T conflicted with usage of GADC11BT (both were 0x1000), so moved former for GADC's only, and changed *ADD7T names. 28-Oct-1996, Linda Hendrickson (LJH): Oops, move STAT_BADFIT from 4000 to 20. 22-Oct-1996, Mike Zelazny (MIKE): New to increment N_STATS for BPMP STAT_BADPHASE and STAT_BADFIT. 21-Oct-1996, Linda Hendrickson: Add STAT_BADPHASE and STAT_BADFIT for PEP2 BPMP STAT. 08-Aug-1995, Mike Zelazny (MIKE): Added HSTA_BPMP_PEP2_ABORT, and HSTA_BPMP_PEP2_HER. If the BPMP is a PEP2 BPMP that can monitor HER beam abort data then the HSTA_BPMPPEP2, HSTA_BPMP_PEP2_ABORT, and HSTA_BPMP_PEP2_HER HSTA bits are set; but, if the BPMP is a PEP2 BPMP that can monitor LER beam abort data then only HSTA_BPMPPEP2, and HSTA_BPMP_PEP2_ABORT are set; finally if the BPMP is a PEP2 BPMP that is used by fast feedback then only HSTA_BPMPPEP2 is set. 06-Jul-1995, Mike Zelazny (MIKE): Added HSTA_BPMPPEP2 for PEP2 BPMPs, and HSTA_BPMPAL for long pulse A-line BPMPs. 06-Jun-1995, Mike Zelazny (MIKE): Increasing GADC HSTA, TORO HSTA, GAPM HSTA, SLIT HSTA, ARRY HSTA, WIRE HSTA, and FIFO HSTA from 16 bits to 32 bits. 17-May-1995, Mike Zelazny (MIKE): Increased BPMP and BPMS HSTA from 16 bits to 32 bits. 19-Jan-1994, Lee Ann Yasukawa (LEEANN): Add new wire hsta bit definition HSTA_WIRE_POS_READOUT. 18-Feb-1993, Lee Ann Yasukawa (LEEANN): Move DUGADC calculation bits to HDSC in WS_PARMS.H to make room for extra HSTA bits. 08-Dec-1992, Linda Hendrickson (LJH): Add definition for STAT_BADCAL. 08-Sep-1992, K. Luchini (LUCHINI): STAT_GOOD, STAT_OK, STAT_DEAD, STAT_SICK can be found in slctxt:status.hc 07-May-1992, Kristi Luchini (LUCHINI) Added bpm calibration statisticts N_STAT, IND_DEAD, IND_NOCAL Added STAT_GOOD, STAT_OK, STAT_DEAD, STAT_SICK 25-Oct-1991, Steve Levitt (LEVITT): Converted from BPMSTAT.TXT. 31-May-1991, Linda Hendrickson Change HSTA_WIRE_LOCKED to use new HSTA_WIRE_DBGADC. 15-Mar-1991, Linda Hendrickson Added HSTA_WIRE_DUMPTHIS and HSTA_WIRE_DUMPOTHER. 25-feb-1991, Lou Sanchez-Chopitea (LSC): Added HSTA_WIRE_WESPD. 24-Oct-1990, Linda Hendrickson (LJH): Added HSTA_WIRE_MICRSTEP. 26-jul-1990, Lou Sanchez-Chopitea (LSC): Added HSTA_WIRE_LOCKED. 18-may-1990, Lou Sanchez-Chopitea (LSC): Added HSTA_WIRE_WIREEMIT and HSTA_WIRE_DIVERGE. 8-Mar-1990, Linda Hendrickon (LJH): Add HSTA_WIRE_QUADEMIT. 14-Nov-1989, Linda Hendrickson (LJH): Add HSTA_BMSTRELE to implement two beam strengths. 3-MAY-1989, Linda Hendrickson (LJH): Added parameters for calibration statistics. 9-MAR-1989, Linda Hendrickson (LJH): Added HSTA_ENERGY_FOIL to indicate that this ARRY unit is an energy foil spectrometer, and HSTA_ENERGY_X and HSTA_ENERGY_Y to indicate plane of spectrometer. 21-FEB-1989, Linda Hendrickson (LJH): Added HSTA_SAVE_ATTN to block rescaling attenuation scale. 20-JAN-1988, Lou Sanchez-Chopitea (LSC): Added STAT_NOREF. ==============================================================================*/ #ifndef BPMSTAT_HC /* The following are added from slctxt:status.hc */ #define STAT_GOOD 0x0001 #define STAT_OK 0x0002 #define STAT_DEAD 0x0004 #define STAT_SICK 0x0008 /* following are for general HSTAs */ #define HSTA_ONLINE 0x00000001 #define HSTA_OFFLINE 0x00000004 #define HSTA_MAINT 0x00040001 #define HSTA_CHECK 0x00080001 /* Following are for BPMS:HSTA: */ #define HSTA_3RDORD 0x00000010 /* If NiTnH (XY), make 3rd order correction.*/ #define HSTA_ROT 0x00000020 /* Electrodes rotated (e.g., 45 deg., not */ /* upright). */ #define HSTA_XONLY 0x00000040 /* X-only. */ #define HSTA_YONLY 0x00000080 /* Y-only. */ #define HSTA_RVRS 0x00000200 /* If not POLOVRRIDE, E-/E+ is reversed. */ #define HSTA_EMINUSOVR 0x00000200 /* If POLOVRRIDE, E- always. */ #define HSTA_XINV 0x00000400 /* Invert X-coord (but HSTA_XINV is */ /* exclusive-or'ed with PREP:FLIP). */ #define HSTA_POLOVRRIDE 0x00000800 /* Modifies '0200'X bit. */ #define HSTA_BTADD7T 0x00001000 /* Add 7 ticks if DGRP:XYZ:EBOTH ("BT" = */ /* BPMS's & TORO's). */ #define HSTA_SAVE_ATTN 0x00002000 /* Don't rescale atten if set; protects */ /* ASCL from scaling. */ #define HSTA_BMSTRELE 0x00004000 /* For two-beam definitions, use E- beam */ /* strength. */ #define HSTA_EP2ND 0x00008000 /* Second of two BPMS's pointing to one EP */ /* (two-bunch) BPMP module. */ #define HSTA_EPMUXTFF 0x00010000 /* BPMS should use its own MUXT even if 2nd */ /* of two EP (two-bunch) BPMS's. */ #define HSTA_P2MUXSZRO 0x00020000 /* RINQ BPMP should see mux bit = 0 even */ /* though MUXS > 0. */ #define HSTA_MAINTENANCE 0x00040000 /* BPMS is in maintenance mode */ #define HSTA_CHECKOUT 0x00080000 /* BPMS is in checkout mode */ /* Following are for BPMS:STAT (not in database, but returned */ /* by micro for each measurement; note that STAT_NOGATE is */ /* the same as STAT_NOQ under BPMP:STAT): */ #define STAT_XBAD 0x0010 #define STAT_YBAD 0x0020 #define STAT_XSAT 0x0040 #define STAT_YSAT 0x0080 #define STAT_SUMSAT 0x0100 #define STAT_SUMLOW 0x0200 #define STAT_SUMWILD 0x0400 #define STAT_VETOED 0x0800 #define STAT_NOGATE 0x1000 #define STAT_ONEQ 0x2000 #define STAT_NOX 0x4000 #define STAT_MISREF 0x8000 #if defined(STAT_SICK) && defined(STAT_DEAD) && defined(STAT_OK) #define STAT_BADCAL (STAT_SICK | STAT_DEAD) /* Bad calibration. */ #define STAT_BADCHKSM (STAT_SICK | STAT_DEAD | STAT_OK) /* DSP ram is corrupted. */ #define STAT_MAINTENANCE (STAT_DEAD | STAT_XBAD) /* BPMS was in maintenance mode when read */ #define STAT_CHECKOUT (STAT_DEAD | STAT_YBAD) /* BPMS was in checkout mode when read */ #endif /* Following are for BPMS:STAT in a reference orbit: */ #define STAT_NOREF 0x8000 /* Following are for BPMP:HSTA: */ #define HSTA_BPMPARC 0x00000010 /* Combines with 0x40 and 0x80 bits. */ #define HSTA_BPMPNGAT 0x00000020 /* Processor is to be run in DC-gate mode. */ #define HSTA_BPMPIP 0x00000040 /* Combines with 0x10 and 0x80 bits. */ #define HSTA_BPMPNI 0x00000080 /* Combines with 0x10 and 0x40 bits. See */ /* below. */ #define HSTA_BPMPFDBK 0x00000100 /* Processor's gate is PP-driven. */ #define HSTA_BPMPFFWD 0x00000200 /* Processor is reserved for hardware fast */ /* feed-forward. */ #define HSTA_BPMPGAD 0x00000400 /* No BPMP module as such, but BPMP:CALP */ /* points to GADC. */ #define HSTA_BPMPGANS 0x00000800 /* Sum signal is meaningless. */ #define HSTA_BPMPGAFP 0x00001000 /* Use fixed pedestals from database */ /* (GADC:FPED). */ #define HSTA_BPMPIVPU 0x00002000 /* Invert calibration pulser polarity. */ #define HSTA_BPMPSNTK 0x00004000 /* Two non-calibrated BPMP's used for */ /* Y-only Shintake BPMS. */ #define HSTA_BPMPRPDM 0x00008000 /* For Shintake BPM, read data with */ /* processor in pedestal mode. */ #define HSTA_BPMPPEP2 0x00010000 /* PEP2 RINQ BPMP. */ #define HSTA_BPMPAL 0x00020000 /* Long pulse A-line BPMP. */ #define HSTA_BPMP_PEP2_ABORT 0x00040000 /* Monitoring PEP2 aborted beam. */ #define HSTA_BPMP_PEP2_HER 0x00080000 /* When set monitors HER, else LER. */ #define HSTA_BPMP4P2T 0x00100000 /* BPMP has NLCTA two-position multiplexer. */ #define HSTA_BPMPEP 0x00200000 /* EP (two-bunch) Linac replacement BPMP. */ #define HSTA_BPMPXTRG 0x00400000 /* Run BPMP in external trigger mode. */ #define HSTA_BPMP_PEP2_476MHz 0x00800000 /* special Ron Johnson test pep bpm */ #define HSTA_BPMP_CKSM_NOCHK 0x01000000 /* RINQ DSP should not self-checksum. */ #define HSTA_BPMP_NOBOOT 0x02000000 /* Micro should not auto-reboot RINQ DSP. */ #define HSTA_BPMP_LER_REJECT 0x04000000 /* if set latest LER multi-bunch calibration was rejected */ #define HSTA_BPMP_HER_REJECT 0x08000000 /* if set latest HER multi-bunch calibration was rejected */ /* If the BPMP is a PEP2 BPMP that can monitor HER beam abort data then the HSTA_BPMPPEP2, */ /* HSTA_BPMP_PEP2_ABORT, and HSTA_BPMP_PEP2_HER HSTA bits are set; but, if the BPMP is a */ /* PEP2 BPMP that can monitor LER beam abort data then only HSTA_BPMPPEP2, and */ /* HSTA_BPMP_PEP2_ABORT are set; finally if the BPMP is a PEP2 BPMP that is used by fast */ /* feedback then only HSTA_BPMPPEP2 is set. */ /* The default BPMP type is linac BPMP, i.e., 4-input */ /* BPMP that does summing and differencing, receives a */ /* PDU gate from the camac backplane, and requires actual */ /* beam (rather than a pulser) for calibration. Linac */ /* BPMP's are also used in the damping rings and positron */ /* return line, and in a few places in the arcs. */ /* BPMPARC means arc-type BPMP, i.e., 2-input BPMP that */ /* does not do summing or differencing, can receive two */ /* gate signals on its front panel, and requires a */ /* pulser for calibration. */ /* BPMPIP means interaction-point-type BPMP, i.e., */ /* 2-input BPMP that does summing and differencing, */ /* receives a gate signal at its front panel, and */ /* requires a pulser for calibration. */ /* BPMPARC together with BPMPIP means modified arc-type, */ /* known as IParc-type. */ /* BPMPARC together with BPMPIP and BPMPNI means yet */ /* further modified arc-type, known as NiTnH. */ /* BPMPSNTK together with BPMPARC, BPMPIP and BPMPNI means */ /* NiTnH is used for Shintake microwave BPM. */ /* BPMPGAD overrides the above, and means that the */ /* digitizing is done by a GADC. */ /* BPMPGANS modifies BPMPGAD, and indicates that there is */ /* no sum signal. */ /* BPMPGAFP modifies BPMPGAD, and means use fixed */ /* pedestals from the database. */ /* BPMPEP means EP-type (two-bunch electron-positron, not */ /* to be confused with HSTA_BPMPPEP2). */ /* Following are for BPMP:STAT (not in database, but returned by */ /* micro for each calibration (as opposed to measurement)). */ /* Note that STAT_NOQ is the same as STAT_NOGATE under BPMS:STAT, */ /* and that BPMP:STAT can also contain the STAT_NOX bit (0x4000 */ /* from BPMS:STAT: */ #define STAT_BADFIT 0x0020 /* bad fit results, (PEP2 sine fit) */ #define STAT_DRIFT 0x0040 #define STAT_BGRATIO 0x0080 #define STAT_BADPED 0x0100 #define STAT_VARBIG 0x0200 #define STAT_GAINLOW 0x0400 #define STAT_OVERSAT 0x0800 #define STAT_NOQ STAT_NOGATE #define STAT_BADPHASE 0x2000 /* unreasonable phase offset (PEP2) */ /* STAT_NOX is 0x4000, under BPMS STAT also */ #define STAT_ATTEN 0x8000 /* Following are for TORO:HSTA: */ #define HSTA_TORO16BIT 0x00000010 /* 16-bit data (as opposed to 10-bit data). */ #define HSTA_TORONGAT 0x00000020 /* Ungated (regardless of PDUC). */ #define HSTA_TOROCIRC 0x00000080 /* Maintain circular buffer of this unit's */ /* most recent data. */ #define HSTA_TORONPRD 0x00000100 /* Suppress pre-read if any. */ /* Following are for TORO:STAT (not in database, but returned */ /* by micro for each measurement): */ #define STAT_STOL 0x0200 /* Following are for BSMD:STAT (not in database, but returned */ /* by micro for each measurement): */ #define STAT_PULSID 0x0020 /* Following are for GADC:HSTA: */ #define HSTA_GADCTDC 0x00000010 /* Module is a TDC (not an ADC), or collecting */ /* pedestals at BPM calibration time is to be */ /* suppressed. */ #define HSTA_GADCNGAT 0x00000020 /* Module should be read with no gate. */ #define HSTA_GADCF0 0x00000040 /* Module should be read with F0, not F2. */ #define HSTA_SEPGATE 0x00000080 /* Module has separate gates per channel. */ #define HSTA_GADCNPRD 0x00000100 /* Omit pre-read (assuming ungated). */ #define HSTA_GADCRDLA 0x00000200 /* GADC should be read RDLA pulses late. */ #define HSTA_GADC3623 0x00000400 /* Module is Kinetic Systems 3623 scaler. */ #define HSTA_GADC7167 0x00000800 /* Module is Phillips Scientific 7167. */ #define HSTA_GADC11BT 0x00001000 /* GADC has 11-bit ADC's. */ #define HSTA_GADC12BT 0x00002000 /* GADC has 12-bit ADC's. */ #define HSTA_GADCWVFM 0x00004000 /* Module is a LeCroy 2262 waveform digitizer */ /* (not an ordinary GADC). */ #define HSTA_GADCBLM 0x00008000 /* Module is a BLM (not an ordinary GADC): */ /* 10 ADC channels, read with F1A0-F1A9. */ #define HSTA_GADCPIC 0x00010000 /* Module is a PIC (not an ordinary GADC): */ /* 5 integrator channels, read with F4. */ #define HSTA_GADCZBHD 0x00020000 /* Assume BUNCHDEL=0 for this GADC's timing */ /* (all channels). */ #define HSTA_GADCM680 0x00040000 /* Module is a Highland Technology M680 TDC. */ #define HSTA_GADCHPED 0x00100000 /* If 7166/7167, enable hardware pedestals. */ #define HSTA_GADCLTHR 0x00200000 /* If 7166/7167, enable hardware lower */ /* thresholds. */ #define HSTA_GADCUTHR 0x00400000 /* If 7166/7167, enable hardware upper */ /* thresholds. */ #define HSTA_GADD7T 0x00800000 /* Add 7 ticks if DGRP:XYZ:EBOTH is set */ /* (as for HSTA_BTADD7T). */ #define HSTA_GADCWVBA 0x01000000 /* If LeCroy 2262 waveform digitizer: */ /* chans 0 & 1 are biphased together. */ #define HSTA_GADCWVBB 0x02000000 /* If LeCroy 2262 waveform digitizer: */ /* chans 2 & 3 are biphased together. */ #define HSTAGADCSATBTX 12 /* Shift count to get to HSTA_GADC11BT. */ /* Following are for DUGADC:HSTA (DUGADC is a generic name */ /* for GAPM, SLIT, WVFM, WIRE, ARRY, etc.): */ #define HSTA_FIXED_PED 0x00000010 /* Use fixed pedestals from */ /* database, not from calibration. */ #define HSTA_NORM_POLY 0x00000020 /* Use POLY's if any given for this */ /* DUGADC's channels. */ #define HSTA_WIRE_DUMPTHIS 0x00000040 /* Dump this beam during scan. */ #define HSTA_WIRE_DUMPOTHER 0x00000080 /* Dump other beam during scan. */ #define HSTA_WIRE_SLDLOCK 0x00000100 /* Obtain SLD LOCK before scan. */ #define HSTA_WIRE_WAIT 0x00000200 /* Wait for return after scan? */ #define HSTA_WIRE_POS_READOUT 0X00000400 /* Use wire transducer for posn */ #define HSTA_WIRE_SBD 0x00000800 /* Dump beam while wire moves. */ #define HSTA_AVGEXCL 0x00001000 /* Exclude from averaging those */ /* values below FPED. */ #define HSTA_WIRE_SWINDOW 0x00010000 /* Allow SLD_WINDOW to be caused by */ /* scan using this WIRE. */ #define HSTA_ENERGY_FOIL 0x00002000 /* Energy foil spectrometer. */ #define HSTA_ENERGY_X 0x00004000 /* Spread in X-Z plane. */ #define HSTA_ENERGY_Y 0x00008000 /* Spread in Y-Z plane. */ #define HSTA_ABKMONDAT 0x00020000 /* This ARRY points to GADC devices used */ /* for monitoring behavior of HER/LER */ /* beamabort kickers. */ #define HSTA_ABKMONLER 0x00040000 /* LER as opposed to HER. */ #define HSTA_ABKMONINJ 0x00080000 /* This ARRY points to GADC device */ /* (scaler) for measuring time to */ /* beamabort since most recent preceding */ /* bunch injection (ring-independent). */ /* Following are for DUGADC:STAT: */ /* (Note that the following, defined above, are also used for */ /* DUGADC:STAT: */ /* STAT_NOGATE = 0x1000 STAT_VETOED = 0x0800 */ /* STAT_NOX = 0x4000 STAT_BADCAL = 0x000C */ /* STAT_XSAT = 0x0040 STAT_BADCHKSM = 0x000E */ #define STAT_SMCBAD 0x0100 /* Bad status bits read out from stepper. */ #define STAT_BLWFPED 0x0400 /* HSTA_AVGEXCL set, and data below FPED. */ /* Following are for FIFO:HSTA and CAR:HSTA: */ #define HSTA_FIFOSTATW 0x00000010 #define HSTA_CARBSMD 0x00000200 /* Following are parameters used for calibration statistics: */ #define N_STATS 15 /* total number of stat types */ #define IND_DEAD 15 /* index of DEAD stat */ #define IND_NOCAL 14 /* index of NOCAL stat */ #define BPMSTAT_HC #endif