/* ************************************************************* */ /* * IMAG.H * * Zachary Wolf * 8/17/98 */ #ifndef __IMAG_HEADER #define __IMAG_HEADER /* ************************************************************* */ /* ENUM DEFINITIONS */ enum imag_config_enum {IMAG_DAC488_HP3457, IMAG_DAC488HR_HP3457, IMAG_MANUAL_HP3457, IMAG_NONE}; enum imag_ramp_style_enum {IMAG_LINEAR, IMAG_THREE_LINEAR, IMAG_COSINE}; enum imag_binary_enum {IMAG_TRUE, IMAG_FALSE}; /* ************************************************************* */ /* STRUCTURE DEFINITIONS */ struct imag_param_struct { int board_addr; /* GPIB board addr */ int dac488_addr; /* DAC488 GPIB address */ int dac488hr_addr; /* DAC488HR GPIB address */ int hp3457_addr; /* readback HP3457 GPIB address */ int dac488_port; /* DAC488 port controlling power supply */ int dac488hr_port; /* DAC488HR port controlling power supply */ int hp3457_chan; /* readback HP3457 channel */ enum imag_config_enum config; /* hardware being used, choices in enum */ enum imag_binary_enum bipolar; /* if bipolar supply, TRUE; otherwise FALSE */ double ps_amps_per_dac_volt; /* PS transfer function (A/V) */ double trans_volts_per_amp; /* transductor transfer function (V/A) */ enum imag_ramp_style_enum ramp_style; /* ramp style, choices in enum */ double max_curr_limit; /* software max current limit (A), stripchart max */ double min_curr_limit; /* software min current limit (A), stripchart min */ double ramp_rate; /* ramp rate for setting magnet (A/s) */ double wait_after_ramp; /* time to wait (sec) after a ramp for things to settle */ double stand_ramp_rate; /* ramp rate for standardizing magnet (A/s) */ double wait_after_stand_ramp; /* time to wait (sec) after a standardization ramp for things to settle */ enum imag_binary_enum init_zero_current_meas; /* if TRUE, perform an initial zero current measurement to correct offsets */ enum imag_binary_enum init_turn_on; /* initial power supply turn on if TRUE, skip if FALSE */ double init_turn_on_current; /* current to go to for initial turn on */ enum imag_binary_enum show_ui; /* show stripchart, etc., choices in enum */ }; /* ************************************************************* */ /* PUBLIC FUNCTION DECLARATIONS */ void imag_init(char log_file[], struct imag_param_struct imag_param); void imag_init_zero_current_meas(void); void imag_init_turn_on(void); void imag_write_header(char* file_name, int num_stand_cycles, double istand_max, double istand_min, int num_test_currents, double test_currents[]); void imag_ramp(double desired_current); void imag_standardize(double stand_max_current, double stand_min_current, int num_cycles); void imag_get_current(double* current); void imag_get_ave_current(double* ave_current, double* sig_current); void imag_get_present_nominal_current(double* current); void imag_set_ramp_rate(double ramp_rate); void imag_monitor(void); void imag_exit(void); /* ************************************************************* */ /* CONSTANTS */ #define IMAG_MAX_NUM_RAMP_POINTS 5000 /* size of ramp current array */ #define IMAG_TIME_BETWEEN_CURRENT_STEPS .1 /* time between ramp steps (sec) */ #define IMAG_NUM_MEAS_AVE 4 /* number of measurements for ave and rms */ /* ************************************************************** */ /* DONE */ #endif