mdat_h

/*
**	Copyright 1998-2015, Fermi Research Alliance, LLC.  All rights reserved.
*/
/******************************************************************************/
/* mdat.h
**
**	This header file contains named constants for MDAT frames
**
*/
/******************************************************************************/

#ifndef MDAT_DEFINED				/* do this only once */
#define	MDAT_DEFINED

#define	MDAT_UNDEFINED		-1		/* undefined MDAT frame value */

#define	MDAT_MIN_FRAME		0		/* minimum valid MDAT frame */
#define	MDAT_MIN_WG_FRAME	0		/* minimum MDAT frame supported by waveform generators */
#define	MDAT_MAX_FRAME		0xFF		/* maximum valid MDAT frame */
#define	MDAT_MAX_WG_FRAME	0x77		/* maximum MDAT frame supported by waveform generators */
#define	MDAT_NUM_FRAMES		256		/* number of valid MDAT frames */

#define	MDAT03			3		/* system timestamp (low word) */
#define	MDAT_TIMESTAMP_LOW	3		/* system timestamp (low word) */
#define	MDAT04			4		/* system timestamp (high word) */
#define	MDAT_TIMESTAMP_HIGH	4		/* system timestamp (high word) */
#define	MDAT05			5		/* BSSB state */
#define	MDAT_BSSB_STATE		5		/* BSSB state */

#define	MDAT10			0x10		/* Tevatron programmed current */
#define	MDAT_TEV_PGM_I		0x10		/* Tevatron programmed current */
#define	MDAT12			0x12		/* Switchyard state */
#define	MDAT_SY_STATE		0x12		/* Switchyard state */
#define	MDAT20			0x20		/* Tevatron measured current */
#define	MDAT_TEV_MEAS_I		0x20		/* Tevatron measured current */
#define	MDAT11			0x11		/* Tevatron programmed I dot */
#define	MDAT_TEV_PGM_I_DOT	0x11		/* Tevatron programmed I dot */
#define	MDAT21			0x21		/* Tevatron measured I dot */
#define	MDAT_TEV_MEAS_I_DOT	0x21		/* Tevatron measured I dot */
#define	MDAT12			0x12		/* Tevatron state */
#define	MDAT_TEV_STATE		0x12		/* Tevatron state */
#define	MDAT13			0x13		/* Tevatron low beta squeeze sequence number */
#define	MDAT_LOWBETA_STEP	0x13		/* Tevatron low beta squeeze sequence number */

#define	MDAT30			0x30		/* Main Injector programmed momentum */
#define	MDAT_MI_PGM_P		0x30		/* Main Injector programmed momentum */
#define	MDAT40			0x40		/* Main Injector measured current */
#define	MDAT_MI_MEAS_I		0x40		/* Main Injector measured current */
#define	MDAT31			0x31		/* Main Injector programmed P dot */
#define	MDAT_MI_PGM_P_DOT	0x31		/* Main Injector programmed P dot */
#define	MDAT41			0x41		/* Main Injector measured I dot */
#define	MDAT_MI_MEAS_I_DOT	0x41		/* Main Injector measured I dot */

#define	MDAT50			0x50		/* Tevatron fixed target intensity */
#define	MDAT_TEV_FIXTAR_INT	0x50		/* Tevatron fixed target intensity */
#define	MDAT51			0x51		/* Tevatron colliding beams intensity */
#define	MDAT_TEV_CB_INT		0x51		/* Tevatron colliding beams intensity */
#define	MDAT52			0x52		/* Tevatron time at 150 GeV */
#define	MDAT_TEV_TIME_AT_150	0x52		/* Tevatron time at 150 GeV */
#define	MDAT53			0x53		/* Tevatron RF anode program */
#define	MDAT_TEV_RF_ANODE_PGM	0x53		/* Tevatron RF anode program */
#define	MDAT54			0x54		/* Main Injector programmed P dot (high word) */
#define	MDAT_MI_PGM_P_DOT_HI	0x54		/* Main Injector programmed P dot (high word) */
#define	MDAT55			0x55		/* Main Injector programmed P dot (low word) */
#define	MDAT_MI_PGM_P_DOT_LO	0x55		/* Main Injector programmed P dot (low word) */
#define	MDAT56			0x56		/* Main Injector cycle ID */
#define	MDAT_MI_CYCLE_ID	0x56		/* Main Injector cycle ID */
#define	MDAT57			0x57		/* Main Injector Booster batch count */
#define	MDAT_MI_BATCH_COUNT	0x57		/* Main Injector Booster batch count */

#define	MDAT60			0x60		/* Main Injector intensity */
#define	MDAT_MI_INT		0x60		/* Main Injector intensity */
#define	MDAT_TEST_FRAME		0x60		/* test frame */
#define	MDAT61			0x61		/* Main Injector 120 GeV fixed target intensity */
#define	MDAT_MI_FIXTAR_INT	0x61		/* Main Injector 120 GeV fixed target intensity */
#define	MDAT62			0x62		/* Main Injector quad difference current */
#define	MDAT_MI_QUAD_DIFF_I	0x62		/* Main Injector quad difference current */

#define	MDAT70			0x70		/* Tevatron FBI proton intensity sum */
#define	MDAT_TEV_FBI_PROT_INT	0x70		/* Tevatron FBI proton intensity sum */
#define	MDAT_RR_INT		0x70		/* Recycler intensity */
#define	MDAT71			0x71		/* Tevatron FBI antiproton intensity sum */
#define	MDAT_TEV_FBI_PBAR_INT	0x71		/* Tevatron FBI antiproton intensity sum */
#define	MDAT72			0x72		/* Tevatron intensity (via VME (TBEAM)) */
#define	MDAT_TEV_INT_VME	0x72		/* Tevatron intensity (via VME (TBEAM)) */
#define	MDAT73			0x73		/* Main Injector intensity (via VME (MIBEAM)) */
#define	MDAT_MI_INT_VME		0x73		/* Main Injector intensity (via VME (MIBEAM)) */
#define	MDAT74			0x74		/* filtered Main Injector intensity for QXR */
#define	MDAT_MI_INT_QXR		0x74		/* filtered Main Injector intensity for QXR */

/* MDAT frames below this point cannot be used by waveform generators. */

#define	MDAT80			0x80		/* Recycler A marker position */
#define	MDAT_RR_A_MARKER	0x80		/* Recycler A marker position */
#define	MDAT81			0x81		/* Recycler end of cold beam */
#define	MDAT_RR_COLD_BEAM_END	0x81		/* Recycler end of cold beam */
#define	MDAT82			0x82		/* Recycler start of stack beam */
#define	MDAT_RR_STACK_BEAM_START	0x82	/* Recycler start of stack beam */
#define	MDAT83			0x83		/* Recycler end of stack beam */
#define	MDAT_RR_STACK_BEAM_END	0x83		/* Recycler end of stack beam */
#define	MDAT84			0x84		/* Recycler start of transfer beam */
#define	MDAT_RR_XFER_BEAM_START	0x84		/* Recycler start of transfer beam */
#define	MDAT85			0x85		/* Recycler end of transfer beam */
#define	MDAT_RR_XFER_BEAM_END	0x85		/* Recycler end of transfer beam */
#define	MDAT86			0x86		/* Recycler cycle ID (from TLG) */
#define	MDAT_RR_CYCLE_ID	0x86		/* Recycler cycle ID (from TLG) */

#define	MDAT90			0x90		/* MI-8 line to Main Injector intensity (from I:TOR852) */
#define	MDAT_MI8_TO_MI_INT	0x90		/* MI-8 line to Main Injector intensity (from I:TOR852) */
#define	MDAT91			0x91		/* MI-8 line to Recycler intensity (from R:TOR853) */
#define	MDAT_MI8_TO_RR_INT	0x91		/* MI-8 line to Recycler intensity (from R:TOR853) */
#define	MDAT92			0x92		/* Recycler to Main Injector intensity (from R:TOR905) */
#define	MDAT_RR_TO_MI_INT	0x92		/* Recycler to Main Injector intensity (from R:TOR905) */
#define	MDAT93			0x93		/* Main Injector to NuMI intensity (from E:TOR101) */
#define	MDAT_MI_TO_NUMI_INT	0x93		/* Main Injector to NuMI intensity (from E:TOR101) */
#define	MDAT94			0x94		/* Main Injector to NuMI intensity (from I:TOR003) */
#define	MDAT_MI_TO_NUMI_INT_2	0x94		/* Main Injector to NuMI intensity (from I:TOR003) */
#define	MDAT95			0x95		/* Main Injector to NuMI intensity (from R:TOR003) */
#define	MDAT_MI_TO_NUMI_INT_3	0x95		/* Main Injector to NuMI intensity (from R:TOR003) */
#define	MDAT96			0x96		/* Main Injector to NuMI intensity (from I:TOR702) */
#define	MDAT_MI_TO_NUMI_INT_4	0x96		/* Main Injector to NuMI intensity (from I:TOR702) */
#define	MDAT97			0x97		/* Recycler to P1 line intensity (from R:TOR7xx) */
#define	MDAT_RR_TO_P1_LINE_INT	0x97		/* Recycler to P1 line intensity (from R:TOR7xx) */

#endif