#include #include #include #include "ps_gap_ui.h" #include "hp34970.h" #include "runparam.h" int main (int argc, char *argv[]) { /* Declare variables */ struct run_param_struct run_param; int err; char log_file[80]; char gap_dat_file[80]; int hp34970_id; FILE* fid; if (InitCVIRTE (0, argv, 0) == 0) return -1; /* out of memory */ /* Get the run parameters from the user */ try_again: runparam_get_run_param(&run_param); /* Create all output files */ err = runparam_create_file(run_param, "logfile", log_file); if (err != 0) goto try_again; err = runparam_create_file(run_param, "gap_dat", gap_dat_file); if (err != 0) goto try_again; /* Write file headers */ runparam_write_header(run_param, log_file); fid = fopen(log_file, "a"); fprintf(fid, "\n\n"); fprintf(fid, " Date Time Enc (mm) Enc(count) Tref(C) Temp(C) Volt Up(V) Volt Dn(V) DistUp(mm) DistDn(mm) Gap (mm) \n"); fprintf(fid, "---------- -------- ---------- ---------- ------- ------- ---------- ---------- ---------- ---------- ----------\n"); fclose(fid); runparam_write_header(run_param, gap_dat_file); /*Initialize the instruments */ hp34970_init(0, 9, &hp34970_id); /* Initialize user interfaces */ ps_gap_ui_init(hp34970_id, log_file, gap_dat_file); /* Run the user interface */ RunUserInterface (); return 0; }