/* this is the structure of all variables for the status file status.xrf */ struct status_type { unsigned short sampling; /* is system currently in sampling mode? YES/NO */ unsigned short analyzing; /* is system currently in analyzing mode ? YES/NO */ unsigned short curr_sample_num; /* number 0-23 of sample position currently in use */ unsigned short curr_elapsed; /* elapsed minutes on the current sample */ unsigned short xrf_subsys_OK; /* is XRF sub-system OK? YES/NO */ unsigned short sample_OK; /* OK to actually sample (no wind or other problems) */ unsigned short NO_rain; /* OK to sample - NO rain detected */ unsigned short running; /* set when sample is actually running */ unsigned short rain_delay; /* amount of delay time remaining after rain event ends */ unsigned short wind_delay; /* amount of delay time remaining until new average is ready */ /* main CPU */ unsigned short maincpu_status; /* status "word": - power control: LOW = ON bit 0 - wind power bit 1 - met power bit 2 - rflink power bit 3 - XRF PC power bit 4 - XRF main power (relay) bit 5 - sample handler power bit 6 - inlet power bit 7 - unused */ /* inlet */ unsigned short inlet_open; /* is inlet open? YES/NO */ /* sample handler */ unsigned short x_intake; /* sample number at intake position */ unsigned short last_position; /* from sample handler status message (GOCW value) */ unsigned short last_sample_num; /* from sample handler status message (GOCW value) */ unsigned short curr_encoder; /* from sample handler status message (degrees * 10) */ unsigned short intake_open; /* is intake position open or closed? YES/NO (from sh_status) */ unsigned short xrf_open; /* is xrf (analysis) position open or closed? YES/NO (from sh_status) */ unsigned short sh_status; /* status "word": - power control: LOW = ON - limit switches: LOW at limit - dir control: LOW = CW bit 0 - purge valve power bit 1 - analog 0 power bit 2 - analog 1 power bit 3 - encoder power bit 4 - motor 2 CW limit (intake) bit 5 - motor 2 CCW limit bit 6 - motor 3 CW limit (xrf/analyze) bit 7 - motor 3 CCW limit bit 8 - motor 1 direction (platter) bit 9 - motor 1 enable bit 10 - motor 2 direction (intake) bit 11 - motor 2 enable bit 12 - motor 3 direction (xrf/analyze) bit 13 - motor 3 enable bit 14 - air pump power bit 15 - main motor power */ float last_AD[7]; /* most recent cal'd values of AD channels 0-6 */ /* MET/WND */ float last_wnd_dir; /* most recent wind direction value */ float last_wnd_speed; /* most recent wind speed value */ float last_RH; /* most recent RH% value */ float last_TMP; /* most recent Temp value */ float last_PRC; /* most recent PRC level value */ unsigned short rain_detect; /* rain detector value (rain = YES) */ /* XRF subsystem */ unsigned short analysis_retry; /* number of retries to do analysis before continuing with new sample */ unsigned short xrf_status; /* status returned by XRF PC "RetrieveStatus" command */ unsigned short xrf_warning; /* warning returned by XRF PC "RetrieveStatus" command */ }; /* this is the structure of all variables for the config file config.xrf */ struct config_type { short sample_time[24]; /* array of total sampling times for each sample */ short rain_delay; /* number of minutes to delay restart after end of rain */ short wind_check; /* 0 disables wind checking, non-zero enables it */ short max_wind; /* max allowed wind speed * 10 (m/s) */ short min_wind; /* minimum wind speed * 10 ?? - usually ignored */ short wind_delay; /* number of minutes to average wind until ready */ short analysis_retry; /* number of retries to do analysis before continuing with new sample */ };