dio_dev_type

	status.i4.v = dio_dev_type(device_indices.i4a.r, properties.i2a.r,
				   device_numbers.i4a.r, device_types.i4a.r,
				   errors.i2a.r [,sub_types.i4a.r]
				   [,num_devices.i4.r] [,generic_types.i4a.r])

	This routine returns the device number and type for a device and
	property (DI/PI).  If "sub_types" is specified, either the GAS type
	code or the CAMAC type code is returned.  In the special case of an
	MADC controller, the MADC number is returned in the low byte and the
	channel number is returned in the high byte of "sub_types".  If
	"num_devices" is specified, data for a list of devices/properties can
	be retrieved.  If a particular returned parameter is not desired, a
	value of NULL can be passed for that argument.

	device_indices	device index or array of device indices
	properties	property index or array of indices
			(If the first value is less than zero, all devices
			 will be requested with a property index which is
			 equal to the absolute value of this argument.)
			(constants are in 'dbprops')
	device_numbers	returned device number or array of numbers
			(constants for CAMAC devices are in camac_devices)
			(if type is DIO_CAMAC_DEVICE -> returns device
							driver code,
			 if type is DIO_GAS_DEVICE -> returns SSDR code,
			 if type is DIO_GAS_GLOBAL_DEVICE -> returns SSDR code,
			 if type is DIO_VIRTUAL_DEVICE -> returns class of
							  device,
			 if type is DIO_LINAC_DEVICE -> returns device type,
			 if type is DIO_INSTRUMENTATION_DEVICE -> returns
								  device type,
			 if type is DIO_FRIG_DEVICE -> returns OID value,
			 if type is DIO_FRIG_GLOBAL_DEVICE -> returns OID value,
			 if type is DIO_BPM_DEVICE -> returns OID value,
			 if type is DIO_QPM_DEVICE -> returns OID value,
			 if type is DIO_D0_DEVICE -> returns device type,
			 if type is DIO_RF_MAC_DEVICE -> returns analog
							 index number,
			 if type is DIO_MOOC_DEVICE -> returns OID value,
			 if type is DIO_MECAR_DEVICE -> returns OID value,
			 if type is DIO_TECAR_DEVICE -> returns OID value,
			 if type is DIO_E811_DEVICE -> returns OID value,
			 if type is DIO_GPIB_DEVICE -> returns OID value,
			 if type is DIO_QXR_DEVICE -> returns OID value,
			 if type is DIO_LLRF_DEVICE -> returns OID value,
			 if type is DIO_CHL_DEVICE -> returns OID value,
			 if type is DIO_GFSDA_DEVICE -> returns OID value,
			 if type is DIO_CNSLIDTR_DEVICE -> returns OID value or
							   table number,
			 if type is DIO_OOC_DEVICE -> returns OID value,
			 if type is DIO_ACCUM_RF_DEVICE -> returns OID value,
			 if type is DIO_SWIC_DEVICE -> returns OID value,
			 if type is DIO_VACUUM_DEVICE -> returns OID value,
			 if type is DIO_BULB_DEVICE -> returns OID value,
			 if type is DIO_STEP_MOTOR_DEVICE -> returns OID
							     value,
			 if type is DIO_EPICURE_DEVICE -> returns OID value,
			 if type is DIO_TWT_DEVICE -> returns OID value,
			 if type is DIO_MDAT_DEVICE -> returns OID value,
			 if type is DIO_MOOC_CAMAC_DEVICE -> returns OID value,
			 if type is DIO_FBI_DEVICE -> returns OID value,
			 if type is DIO_GMPS_DEVICE -> returns OID value,
			 if type is DIO_DAMPER_DEVICE -> returns OID value,
			 if type is DIO_RF_TUNING_DEVICE -> returns OID value,
			 if type is DIO_TIMER_DEVICE -> returns OID value,
			 if type is DIO_ACC_STATS_DEVICE -> returns OID value,
			 if type is DIO_SCHOTTKY_DEVICE -> returns OID value)
			(A value of NULL may be passed if no device numbers
			 are needed.)
	device_types	returned type of device or array of types
			(DIO_CAMAC_DEVICE -> CAMAC device,
			 DIO_GAS_DEVICE -> GAS device,
			 DIO_GAS_GLOBAL_DEVICE -> multihouse GAS device,
			 DIO_VIRTUAL_DEVICE -> virtual (software) device,
			 DIO_FE_CALCULATED_DEVICE -> front end calculated
						     device,
			 DIO_FRIG_DEVICE -> cryogenic device (not GAS),
			 DIO_FRIG_GLOBAL_DEVICE -> multihouse cryogenic
						   device (not GAS),
			 DIO_LINAC_DEVICE -> Linac device,
			 DIO_INSTRUMENTATION_DEVICE -> generic instrumentation
						       device,
			 DIO_RF_MAC_DEVICE -> Lockheed MAC RF device,
			 DIO_BPM_DEVICE -> BPM device (not GAS),
			 DIO_BLM_DEVICE -> BLM device (not GAS),
			 DIO_QPM_DEVICE -> QPM device (not GAS),
			 DIO_RAW_CAMAC_DEVICE -> raw CAMAC command device,
			 DIO_D0_DEVICE -> D0 experiment device,
			 DIO_MRPS_DEVICE -> Main Ring power supply control
					    device,
			 DIO_MECAR_DEVICE -> MECAR Main Injector power supply
					     control device,
			 DIO_TECAR_DEVICE -> TECAR Tevatron power supply
					     control device,
			 DIO_CNSLIDTR_DEVICE -> consolidator device,
			 DIO_MOOC_DEVICE -> MOOC device,
			 DIO_E811_DEVICE -> E811 device,
			 DIO_GPIB_DEVICE -> VME interfaced GPIB device,
			 DIO_QXR_DEVICE -> QXR device,
			 DIO_LLRF_DEVICE -> Low Level RF device,
			 DIO_HLRF_DEVICE -> High Level RF device,
			 DIO_CHL_DEVICE -> Central Helium Liquifier device,
			 DIO_GFSDA_DEVICE -> General Finite State Data
					     Acquisition device,
			 DIO_IRM_DEVICE -> Internet Rack Monitor device,
			 DIO_OOC_DEVICE -> OOC device,
			 DIO_ACCUM_RF_DEVICE -> Accumulator RF device,
			 DIO_SWIC_DEVICE -> SWIC device,
			 DIO_VACUUM_DEVICE -> VME interfaced vacuum device,
			 DIO_BULB_DEVICE -> Basic Micro Learning Box,
			 DIO_STEP_MOTOR_DEVICE -> stepping motor device,
			 DIO_EPICURE_DEVICE -> Epicure (external beam line)
					       device,
			 DIO_TWT_DEVICE -> Travelling Wave Tube (TWT) device,
			 DIO_MDAT_DEVICE -> MDAT transmitter device,
			 DIO_MOOC_CAMAC_DEVICE -> MOOC-based CAMAC device,
			 DIO_FBI_DEVICE -> Fast Bunch Integrator device,
			 DIO_EMITTANCE_DEVICE -> emittance measurement device,
			 DIO_GMPS_DEVICE -> Booster GMPS device,
			 DIO_DAMPER_DEVICE -> beam damper device,
			 DIO_RF_TUNING_DEVICE -> RF tuning device,
			 DIO_TIMER_DEVICE -> timer device,
			 DIO_ACC_STATS_DEVICE -> accelerator statistics device,
			 DIO_SCHOTTKY_DEVICE -> Schottky monitor device,
			 DIO_BUNCH_LENGTH_DEVICE -> bunch length monitor device,
			 DIO_SMTF_DEVICE -> SMTF device,
			 DIO_HINS_DEVICE -> HINS device,
			 DIO_NML_DEVICE -> NML device,
			 DIO_HRM_DEVICE -> HRM device,
			 DIO_EBL_DEVICE -> external beam line device)
			(A value of NULL may be passed if no device types
			 are needed.)
	errors		returned ACNET status value or array of status values
	[sub_types]	returned device subtype or array of subtypes
			(default is NULL)
			(if type is DIO_CAMAC_DEVICE -> returns the MADC
							number (low byte) and
							channel number (high
							byte) if the device is
							an MADC, otherwise the
							third word of the SSDN
							is returned,
			 if type is DIO_GAS_DEVICE -> returns GAS type code,
			 if type is DIO_GAS_GLOBAL_DEVICE -> returns GAS
							     type code,
			 if type is DIO_FRIG_DEVICE -> returns raw device type,
			 if type is DIO_FRIG_GLOBAL_DEVICE -> returns house
							      type,
			 if type is DIO_VIRTUAL_DEVICE -> device subtype,
			 if type is DIO_MOOC_DEVICE -> returns raw device type,
			 if type is DIO_MECAR_DEVICE -> returns raw device type,
			 if type is DIO_TECAR_DEVICE -> returns raw device type,
			 if type is DIO_E811_DEVICE -> returns raw device type,
			 if type is DIO_GPIB_DEVICE -> returns raw device type,
			 if type is DIO_QXR_DEVICE -> returns raw device type,
			 if type is DIO_LLRF_DEVICE -> returns raw device type,
			 if type is DIO_CHL_DEVICE -> returns raw device type,
			 if type is DIO_GFSDA_DEVICE -> returns raw device type,
			 if type is DIO_CNSLIDTR_DEVICE -> returns table number,
			 if type is DIO_OOC_DEVICE -> returns raw device type,
			 if type is DIO_ACCUM_RF_DEVICE -> returns raw device
							   type,
			 if type is DIO_SWIC_DEVICE -> returns raw device type,
			 if type is DIO_VACUUM_DEVICE -> returns raw
							 device type,
			 if type is DIO_BULB_DEVICE -> returns raw device type,
			 if type is DIO_STEP_MOTOR_DEVICE -> returns raw
							     device type,
			 if type is DIO_EPICURE_DEVICE -> returns raw
							  device type,
			 if type is DIO_TWT_DEVICE -> returns raw device type,
			 if type is DIO_MDAT_DEVICE -> returns raw device type,
			 if type is DIO_MOOC_CAMAC_DEVICE -> returns raw device type,
			 if type is DIO_FBI_DEVICE -> returns raw device type,
			 if type is DIO_GMPS_DEVICE -> returns raw device type,
			 if type is DIO_DAMPER_DEVICE -> returns raw
							 device type,
			 if type is DIO_RF_TUNING_DEVICE -> returns raw
							    device type,
			 if type is DIO_TIMER_DEVICE -> returns raw device type,
			 if type is DIO_ACC_STATS_DEVICE -> returns raw
							    device type,
			 if type is DIO_SCHOTTKY_DEVICE -> returns raw
							   device type)
	[num_devices]	number of devices (default is 1)
	[generic_types]	device generic type (At present, this is only valid for
			GAS, CAMAC, frig, virtual, Linac, MOOC, MECAR, TECAR,
			GPIB, QXR, LLRF, E811, CHL, GFSDA, instrumentation, OOC,
			Accumulator RF, SWIC, vacuum, BULB, stepping motor,
			Epicure, TWT, MDAT, MOOC CAMAC, FBI, GMPS, damper,
			RF tuning, timer, accelerator statistics, Schottky,
			bunch length, SMTF, HINS, NML, HRM, EBL, and
			consolidator devices.) (default is NULL)
			(constants are in 'device_types' unless a literal
			 CAMAC module number is returned)

	This function returns status values as follows:

	OK			success
	DIO_BADARG		invalid number of devices passed
	DIO_MEMFAIL		memory allocation failure
	negative value		ACNET format error indicating overall failure
	positive value		number of devices in error indicating partial
				success

	This function requires the following include files:

	dbprops_h, diolib_h, camac_devices_h, device_types_h, acnet_errors_h

	Related functions:

	dio_device_type_c, dio_ssdn_to_device_type_c, dio_dev_ssdn(_c),
	dio_device_location_c, error_in_list(_c), dio_enable_obsolete_dev_info,
	dio_disable_obsolete_dev_info

	C/C++ usage:

	short	errors[NUM_DEVICES];
	short	properties = -PRREAD;
	int	status;
	static const int	device_indices[NUM_DEVICES] = {14430, 14431};
	int	device_numbers[NUM_DEVICES];
	int	device_types[NUM_DEVICES];
	int	sub_types[NUM_DEVICES];
	int	generic_types[NUM_DEVICES];
	int	num_devices = NUM_DEVICES;

	status = dio_dev_type(device_indices,&properties,device_numbers,
			      device_types,errors,sub_types,&num_devices,
			      generic_types);