/* ************************************************************** */ /* * WIRPOS.H * * Zachary Wolf * 6/3/05 */ #ifndef __WIRPOS_HEADER #define __WIRPOS_HEADER #if defined(__cplusplus) || defined(__cplusplus__) extern "C" { #endif /* ************************************************************** */ /* CONSTANTS */ #define WIRPOS_MAX_NUM_CHAR 80 #define WIRPOS_MAX_NUM_WIR_DET 4 #define WIRPOS_COARSE_STEP_SIZE 0.0001 /* (m) */ #define WIRPOS_COARSE_NUM_POS 20 /* Locate wire within 2 mm of home position */ //mmm why would it be within 2 mm? #define WIRPOS_FINE_STEP_SIZE 0.00001 /* (m) */ #define WIRPOS_FINE_NUM_POS 40 #define WIRPOS_FIT_STEP_SIZE 0.000002 /* (m) */ #define WIRPOS_FIT_NUM_POS 5 #define WIRPOS_SENS 0.1 #define WIRPOS_COARSE_TRIES 2 #define WIRPOS_FINE_TRIES 4 /* ************************************************************* */ /* ENUM DEFINITIONS */ enum wirpos_device_type_enum {WIRPOS_ESP7000_HP34970, WIRPOS_MANUAL_HP34970, WIRPOS_NONE_NONE}; enum wirpos_binary_enum {WIRPOS_TRUE, WIRPOS_FALSE}; /* ************************************************************* */ /* STRUCTURE DEFINITIONS */ struct wirpos_det_info_struct { char name[WIRPOS_MAX_NUM_CHAR]; /* Name of the detector */ int move_axis; /* Axis number of the motion controller to move the detector */ int meas_channel; /* Channel number in the measurement device */ double zero_shift; /* Amount by which the motor shifts before starting the scan (in m). Needed when the wire is far from zero. */ }; struct wirpos_param_struct { int board_addr; /* GPIB board addr */ int esp7000_addr; /* ESP7000 GPIB address */ int hp34970_addr; /* HP34970 GPIB address */ enum wirpos_device_type_enum device_type; /* Type of device being used */ double acc; /* Detector acceleration */ double vel; /* Detector velocity */ int num_wire_det; /* Number of wire position detectors */ enum wirpos_binary_enum show_ui; /* Show graph, choices in enum */ struct wirpos_det_info_struct det_info[WIRPOS_MAX_NUM_WIR_DET]; /* Wire detector information */ }; /* ************************************************************** */ /* PUBLIC FUNCTION DECLARATIONS */ void wirpos_init(char log_file_in[], struct wirpos_param_struct wirpos_param_in); void wirpos_manual_move_to_wire(int det_num); void wirpos_move_home(int det_num); void wirpos_rel_move(int det_num, double dis); void wirpos_abs_move(int det_num, double pos); void wirpos_set_zero_pos(int det_num); void wirpos_get_pos(int det_num, double* pos); void wirpos_get_volt(int det_num, double* v); void wirpos_find_wire_coarse(int det_num, double* coarse_wire_pos); void wirpos_find_wire_fine(int det_num, double coarse_wire_pos, double* fine_wire_pos); void wirpos_find_wire(int det_num, double* wire_pos); void wirpos_exit(void); /* ************************************************************** */ /* DONE */ #if defined(__cplusplus) || defined(__cplusplus__) } #endif #endif