bpm_get_crates_and_channels

	status.i4.v = bpm_get_crates_and_channels(horz_crates.i4a.r,
						  horz_channels.i4a.r,
						  vert_crates.i4a.r,
						  vert_channels.i4a.r
						  [,data_view.u4.v]
						  [,horz_machines.i4a.r]
						  [,vert_machines.i4a.r])

	This routine retrieves BPM detector crate and channel values for
	the machine last requested by a call to bpm_machine_c.  A value
	of NULL can be passed for any of the returned arguments that are
	not needed.  The names for the crates can be retrieved using a
	call to bpm_crate_info_c.

	horz_crates	array of horizontal detector crate values
			(0 -> number of crates - 1)
	horz_channels	array of horizontal detector channel values
			(0 -> number of channels - 1)
	vert_crates	array of vertical detector crate values
			(0 -> number of crates - 1)
	vert_channels	array of vertical detector channel values
			(0 -> number of channels - 1)
	[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))
	[horz_machines]	returned array of horizontal detector machine values
			(default is NULL)
	[vert_machines]	returned array of vertical detector machine values
			(default is NULL)

	This function returns ACNET status values as follows:

	OK			success
	CBS_NOTYET		not yet supported for the active machine
	SQL_xxx			database access error

	This function requires the following include files:

	ul_cbsaux/bpmuti.h, acnet_errors_h

	Related functions:

	bpm_crate_info_c, bpm_machine_c, bpm_get_names, bpm_query,
	bpm_name_to_index_c, bpm_get_offsets, bpm_get_locations,
	blm_get_locations, bpm_get_data_c, bpm_get_detector_status

	C/C++ usage:

	int	status;
	int	num_horizontal;
	int	num_vertical;
	int	*horz_crates;
	int	*horz_channels;
	int	*vert_crates;
	int	*vert_channels;
	int	*horz_machines;
	int	*vert_machines;
	unsigned int	data_view = BPM_VIEW_DEFAULT;

	bpm_query(&num_horizontal,&num_vertical,BPM_MODE_NORMAL,data_view);

	horz_crates = (int *) malloc(num_horizontal*(sizeof(int)));
	horz_channels = (int *) malloc(num_horizontal*(sizeof(int)));
	vert_crates = (int *) malloc(num_vertical*(sizeof(int)));
	vert_channels = (int *) malloc(num_vertical*(sizeof(int)));
	horz_machines = (int *) malloc(num_horizontal*(sizeof(int)));
	vert_machines = (int *) malloc(num_vertical*(sizeof(int)));

	status = bpm_get_crates_and_channels(horz_crates,horz_channels,
					     vert_crates,vert_channels,
					     data_view,horz_machines,
					     vert_machines);