bpm_get_raw_data_c

	status.i4.v = bpm_get_raw_data_c(type.i4.v, frame.i4.v, num_frames.i4.v,
					 readout_spec.g.v, data_view.u4.v,
					 horz_data.g.v, horz_status.i1a.r,
					 vert_data.g.v, vert_status.i1a.r,
					 timestamps.u4a.r, nano_offsets.u4a.r,
					 time_in_cycle.r4a.r,
					 turn_numbers.i4a.r, cycle.i4.r,
					 num_timing.i4.r, timing_params.i4a.r,
				         metadata.g.v, frames_ret.i4.r,
					 returned_type.i4.r)

	This routine retrieves raw BPM data for the machine last requested by
	a call to bpm_machine_c.

	type		type of BPM frame
			(BPM_DISPLAY_FRAME -> display frame,
			 BPM_SNAPSHOT -> snapshot frame,
			 BPM_SLOW_SNAPSHOT -> slow snapshot frame,
			 BPM_PROFILE -> profile frame,
			 BPM_USER_FRAME -> user triggered closed orbit frame,
			 BPM_FLASH -> flash frame,
			 BPM_INJECTION_FRAME -> injection closed orbit frame)
	frame		frame number
	num_frames	number of frames
	readout_spec	readout specification
			(BPM_TEVATRON -> structure of type
					 BPM_TEVATRON_READOUT_SPEC,
			 BPM_TEV_DEVL -> structure of type
					 BPM_TEVATRON_READOUT_SPEC,
			 BPM_MAIN_INJECTOR -> structure of type
					      BPM_MI_READOUT_SPEC,
			 BPM_MI_DEVL -> structure of type
					BPM_MI_READOUT_SPEC,
			 BPM_RECYCLER -> structure of type
					 BPM_RECYCLER_READOUT_SPEC)
			(A value of NULL can be passed for this argument
			 to use the default readout specification.)
	data_view	data view requested which may result in data being
			returned for multiple machines
			(BPM_VIEW_DEFAULT -> single machine view,
			 BPM_VIEW_P1_ONLY -> P1 line only (P1 line),
			 BPM_VIEW_P1_P2 -> P1 and P2 lines (P1 line),
			 BPM_VIEW_P1_P2_AP1 -> P1, P2, and AP1 lines (P1 line),
			 BPM_VIEW_P1_P2_AP1_AP3	-> P1, P2, AP1, amd AP3 lines
						   (P1 line),
			 BPM_VIEW_P1_P2_AP1_AP2	-> P1, P2, AP1, amd AP2 lines
						   (P1 line),
			 BPM_VIEW_AP1_ONLY -> AP1 line only (AP1 line),
			 BPM_VIEW_AP1_AP2 -> AP1 and AP2 lines (AP1 line),
			 BPM_VIEW_AP1_AP3 -> AP1 and AP3 lines (AP1 line))
	horz_data	returned array of horizontal position data
			(BPM_TEVATRON -> array of structures of type
					 BPM_TEVATRON_IQ_DATA,
			 BPM_TEV_DEVL -> array of structures of type
					 BPM_TEVATRON_IQ_DATA,
			 BPM_MAIN_INJECTOR -> array of structures of type
					      BPM_MI_IQ_DATA,
			 BPM_MI_DEVL -> array of structures of type
					BPM_MI_IQ_DATA,
			 BPM_RECYCLER -> array of structures of type
					 BPM_RECYCLER_IQ_DATA)
			(A value of NULL can be passed if this information
			 is not needed.)
	horz_status	returned array of horizontal position detector
			status values
			(BPM_OK -> successful read,
			 BPM_INVALID ->invalid data,
			 BPM_ALARM -> reading was above alarm limit,
			 BPM_ABORT -> reading was above abort limit)
			(A value of NULL can be passed if this information
			 is not needed.)
	vert_data	returned array of vertical position data
			(BPM_TEVATRON -> array of structures of type
					 BPM_TEVATRON_IQ_DATA,
			 BPM_TEV_DEVL -> array of structures of type
					 BPM_TEVATRON_IQ_DATA,
			 BPM_MAIN_INJECTOR -> array of structures of type
					      BPM_MI_IQ_DATA,
			 BPM_MI_DEVL -> array of structures of type
					BPM_MI_IQ_DATA,
			 BPM_RECYCLER -> array of structures of type
					 BPM_RECYCLER_IQ_DATA)
			(A value of NULL can be passed if this information
			 is not needed.)
	vert_status	returned array of vertical position detector
			status values
			(BPM_OK -> successful read,
			 BPM_INVALID ->invalid data,
			 BPM_ALARM -> reading was above alarm limit,
			 BPM_ABORT -> reading was above abort limit)
			(A value of NULL can be passed if this information
			 is not needed.)
	timestamps	returned array of timestamps in clinks
			(A value of NULL can be passed if this information
			 is not needed.)
	nano_offsets	returned array of timestamp fractions of a second
			in nanoseconds
			(A value of NULL can be passed if this information
			 is not needed.)
	time_in_cycle	returned time in seconds in the cycle that the data
			was taken
			(A value of NULL can be passed if this information
			 is not needed.)
	turn_numbers	returned array of turn numbers when data was taken
			(A value of NULL can be passed if this information
			 is not needed.)
	cycle		cycle event that data was taken on
			(A value of NULL can be passed if this information
			 is not needed.)
	num_timing	returned number of timing parameters (files only)
			(A value of NULL can be passed if this information
			 is not needed.)
	timing_params	returned timing parameters (files only)
			(A value of NULL can be passed if this information
			 is not needed.)
	metadata	returned metadata structure
			(BPM_TEVATRON -> structure of type
					 BPM_TEVATRON_METADATA,
			 BPM_TEV_DEVL -> structure of type
					 BPM_TEVATRON_METADATA,
			 BPM_MAIN_INJECTOR -> structure of type
					      BPM_MI_METADATA,
			 BPM_MI_DEVL -> structure of type
					BPM_MI_METADATA,
			 BPM_RECYCLER -> structure of type
					 BPM_RECYCLER_METADATA)
			(A value of NULL can be passed if this information
			 is not needed.)
	frames_ret	number of frames actually returned
			(A value of NULL can be passed if this information
			 is not needed.)
	returned_type	type of frame returned  (This is most useful
			for file data.)
			(A value of NULL can be passed if this information
			 is not needed.)

	This function returns ACNET status values as follows:

	OK			success
	CBS_NOTYET		data is not available for the requested frame
	CBS_INVARG		invalid number of frames requested
	CBS_INVTYP		frame(s) retrieved, but frame type differs
				from requested type
	otherwise		other ACNET error

	This function requires the following include files:

	ul_cbsaux/bpmuti.h, acnet_errors_h

	Related functions:

	bpm_machine_c, bpm_get_data_c, bpm_get_names, bpm_query,
	bpm_name_to_index_c, bpm_data_source_c, bpm_beam_cycle_info,
	blm_get_data_c, bpm_get_intensity_c, bpm_plot_data, bpm_save_data,
	bpm_set_save_file, bpm_get_detector_status, bpm_get_crates_and_channels

	C/C++ usage:

	char		*horz_status;
	char		*vert_status;
	int		status;
	int		type = BPM_SNAPSHOT;
	int		frame = 0;
	int		num_frames = NUM_FRAMES;
	int		num_horz_bpms;
	int		num_vert_bpms;
	int		turn_numbers[NUM_FRAMES];
	int		cycle;
	int		num_timing;
	int		timing_params[BPM_MAX_TIMING_PARAMS];
	int		frames_ret;
	int		returned_type;
	unsigned int	data_view = BPM_VIEW_DEFAULT;
	unsigned int	timestamps[NUM_FRAMES];
	unsigned int	nano_offsets[NUM_FRAMES];
	unsigned int	attributes;
	float		time_in_cycle[NUM_FRAMES];
	void		*readout_spec = (void *) NULL;
	void		*metadata = (void *) NULL;
	BPM_TEVATRON_IQ_DATA	*horz_data = (BPM_TEVATRON_IQ_DATA *) NULL;
	BPM_TEVATRON_IQ_DATA	*vert_data = (BPM_TEVATRON_IQ_DATA *) NULL;

	bpm_query(&num_horz_bpms,&num_vert_bpms);

	horz_status = (char *) malloc(num_horz_bpms);
	vert_status = (char *) malloc(num_vert_bpms);
	horz_data = (BPM_TEVATRON_IQ_DATA *) malloc(num_horz_bpms*(sizeof(BPM_TEVATRON_IQ_DATA)));
	vert_data = (BPM_TEVATRON_IQ_DATA *) malloc(num_vert_bpms*(sizeof(BPM_TEVATRON_IQ_DATA)));

	status = bpm_get_raw_data_c(type,frame,num_frames,readout_spec,
				    data_view,(void *) horz_data,horz_status,
				    (void *) vert_data,vert_status,
				    timestamps,nano_offsets,time_in_cycle,
				    turn_numbers,&cycle,&num_timing,
				    timing_params,metadata,
				    &frames_ret,&returned_type);