blm_get_data_c

	status.i4.v = blm_get_data_c(type.i4.v, frame.i4.v, num_frames.i4.v,
				     losses.r4a.r [,status.i1a.r]
				     [,timestamp.u4.r] [,file_title.i1p.r]
				     [,time_in_cycle.r4a.r] [,frames_ret.i4.r]
				     [,returned_type.i4.r] [,data_view.u4.v])
				     [,timestamps.u4a.r] [,nano_offsets.u4a.r]
				     [,readout_spec.g.v] [,metadata.g.v])

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

	type		type of BLM frame
			(BPM_DISPLAY_FRAME -> display frame,
			 BPM_SNAPSHOT -> snapshot frame,
			 BPM_PROFILE -> profile frame,
			 BPM_FLASH -> flash frame,
			 BPM_INTEGRATED_LOSS_FRAME -> integrated loss frame
						      (Main Injector and
						       Recycler only))
	frame		frame number (Note: If this is negative, the data
			is retrieved from a save file using the absolute
			value of this parameter as its file number.)
	num_frames	number of frames  (If a value of zero is passed
			for this argument when retrieving file data,
			all saved frames will be returned.)
	losses		returned array of beam loss values in rads per second
	[status]	returned array of loss monitor status values
			(BPM_OK -> successful read,
			 BPM_ALARM -> reading was above alarm limit,
			 BPM_ABORT -> reading was above abort limit)
			(default is NULL)
	[timestamp]	returned timestamp in clinks when the data was retrieved
			(default is NULL)
	[file_title]	returned pointer to null-terminated file name
			(default is NULL)
	[time_in_cycle]	returned time in the cycle that the data was taken
			(default is NULL)
	[frames_ret]	number of frames actually returned (default is NULL)
	[returned_type]	type of BLM frame returned  (This is most useful
			for file data.) (default is NULL)
	[data_view]	data view requested which may result in data being
			returned for multiple machines
			(BPM_VIEW_DEFAULT -> single machine view (default),
			 BPM_VIEW_P1_ONLY -> P1 Line only (P1 Line),
			 BPM_VIEW_P1_P2 -> P1 and P2 lines (P1 Line),
			 BPM_VIEW_P1_P2_M1 -> P1, P2, and M1 lines (P1 Line),
			 BPM_VIEW_P1_P2_M1_M3 -> P1, P2, M1, amd M3 lines
						 (P1 Line),
			 BPM_VIEW_P1_P2_P3 -> P1, P2, and P3 lines (P1 Line),
			 BPM_VIEW_M1_ONLY -> M1 Line only (M1 Line),
			 BPM_VIEW_M1_M3 -> M1 and M3 lines (M1 Line))
	[timestamps]	returned array of timestamps in clinks
			(default is NULL)
	[nano_offsets]	returned array of timestamp fractions of a second
			in nanoseconds (default is NULL)
	[readout_spec]	readout specification
			(BPM_TEVATRON -> structure of type
					 BLM_TEVATRON_READOUT_SPEC,
			 BPM_TEV_DEVL -> structure of type
					 BLM_TEVATRON_READOUT_SPEC,
			 BPM_MAIN_INJECTOR -> structure of type
					      BLM_MI_READOUT_SPEC,
			 BPM_MI_DEVL -> structure of type
					BLM_MI_READOUT_SPEC,
			 BPM_RECYCLER -> structure of type
					 BLM_RECYCLER_READOUT_SPEC,
			 BPM_CDF -> structure of type
				    BLM_CDF_READOUT_SPEC)
			(default is NULL)
	[metadata]	returned metadata structure
			(BPM_TEVATRON -> structure of type
					 BLM_TEVATRON_METADATA,
			 BPM_TEV_DEVL -> structure of type
					 BLM_TEVATRON_METADATA,
			 BPM_MAIN_INJECTOR -> structure of type
					      BLM_MI_METADATA,
			 BPM_MI_DEVL -> structure of type
					BLM_MI_METADATA,
			 BPM_RECYCLER -> structure of type
					 BLM_RECYCLER_METADATA,
			 BPM_CDF -> structure of type
				    BLM_CDF_METADATA)
			 (default is NULL)

	This function returns ACNET status values as follows:

	OK			success
	CBS_NOTYET		BLM data is not available for the requested
				machine or 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, blm_get_names, blm_query, bpm_data_source_c,
	bpm_beam_cycle_info, bpm_get_data_c, bpm_get_intensity_c,
	bpm_plot_data, bpm_save_data, bpm_set_save_file, blm_name_to_index_c

	C/C++ usage:

	char		*status_values;
	char		**file_title = (char **) NULL;
	int		status;
	int		type = BPM_SNAPSHOT;
	int		frame = 0;
	int		num_frames = NUM_FRAMES;
	int		frames_ret;
	int		returned_type;
	int		num_blms;
	unsigned int	timestamp;
	unsigned int	data_view = BPM_VIEW_DEFAULT;
	unsigned int	timestamps[NUM_FRAMES];
	unsigned int	nano_offsets[NUM_FRAMES];
	float		time_in_cycle[NUM_FRAMES];
	float		*losses;
	void		*readout_spec = (void *) NULL;
	void		*metadata = (void *) NULL;

	blm_query(&num_blms);

	status_values = (char *) malloc(num_blms);
	losses = (float *) malloc(num_blms*(sizeof(float)));

	status = blm_get_data_c(type,frame,num_frames,losses,status_values,
				&timestamp,file_title,time_in_cycle,
				&frames_ret,&returned_type,data_view,
				timestamps,nano_offsets,readout_spec,
				metadata);