#include "pidf_local.h" SDDAS_INT BinIndex (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT sensor_num, SDDAS_INT *nsets) { SDDAS_INT swp_ndx; SDDAS_INT error_code; /* Read the the number of bin schemes set up. If none, return a 0 */ if ((error_code = ReadNewPidf (key, exten, BIN, NOTUSED, NOTUSED, NSETS, nsets)) != ALL_OKAY) return (error_code); /* if we have some bin sets defined, we must go to the sensor and find out which scan_block_info (SWPNDX) to use. */ if (*nsets != 0) { if ((error_code = ReadNewPidf (key, exten, SENSOR, sensor_num, NOTUSED, SWPNDX, (void *) &swp_ndx)) != ALL_OKAY) return (error_code); /* based on the scan block info, return the number of units within the scan unit */ if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, swp_ndx, NOTUSED, NUNITS, nsets)) != ALL_OKAY) return (error_code); } return (error_code); }