|
|
|
@ -102,14 +102,14 @@ int DAQ(int t_hrs, int sp_s)
|
|
|
|
|
{
|
|
|
|
|
FILE* dfp; // create a file pointer
|
|
|
|
|
const char colums[200] = "t(s)\tCO2 uf(ppm)\tCO2(ppm)\tCO uf(ppm)\t"\
|
|
|
|
|
"CO(ppm)\tO2(ppm)\tO2(%%)\tT C02(ºC*10)\t"\
|
|
|
|
|
"T 02(ºC)\tP C02(.mBar)\tP 02(mBar)\tRH(.)\n";
|
|
|
|
|
unsigned char co2_uf[10]="", co2_f[10]="",
|
|
|
|
|
co_uf[10]="", co_f[10]="",
|
|
|
|
|
o2_ppm[10]="", o2_xcent[10]="",
|
|
|
|
|
co2_temp[10]="", o2_temp[10]="",
|
|
|
|
|
co2_press[10]="", o2_press[10]="",
|
|
|
|
|
co2_relH[10]="", DATA[100]=""; //measurements varirables
|
|
|
|
|
"CO(ppm)\tO2(ppm)\tO2(%%)\tT C0(ºC*10)\t"\
|
|
|
|
|
"T 02(ºC)\tP C0(.mBar)\tP 02(mBar)\tRH(.)\n";
|
|
|
|
|
unsigned char co2_uf[10]="", co2_f[10]="",
|
|
|
|
|
co_uf[10]="", co_f[10]="",
|
|
|
|
|
o2_ppm[10]="", o2_xcent[10]="",
|
|
|
|
|
co_temp[10]="", o2_temp[10]="",
|
|
|
|
|
co_press[10]="", o2_press[10]="",
|
|
|
|
|
co_relH[10]="", DATA[100]=""; //measurements varirables
|
|
|
|
|
time_t curtime; //current time (date)
|
|
|
|
|
clock_t start_t, end_t; //processing time measurements variables
|
|
|
|
|
time_t next_samp_time, t0; //time control variables
|
|
|
|
@ -152,16 +152,16 @@ int DAQ(int t_hrs, int sp_s)
|
|
|
|
|
memcpy(co_f, getMeasures(receive[COAF], 'Z', 5), 5);
|
|
|
|
|
memcpy(o2_ppm, getMeasures(receive[LuminOX], 'O', 6), 6);
|
|
|
|
|
memcpy(o2_xcent, getMeasures(receive[LuminOX], '%', 6), 6);
|
|
|
|
|
memcpy(co2_temp, getMeasures(receive[SprintIR],'T', 5), 5);
|
|
|
|
|
memcpy(co_temp, getMeasures(receive[COAF], 'T', 5), 5);
|
|
|
|
|
memcpy(o2_temp, getMeasures(receive[LuminOX], 'T', 5), 5);
|
|
|
|
|
memcpy(co2_press,getMeasures(receive[SprintIR],'B', 5), 5);
|
|
|
|
|
memcpy(co_press, getMeasures(receive[COAF], 'B', 5), 5);
|
|
|
|
|
memcpy(o2_press, getMeasures(receive[LuminOX], 'P', 4), 4);
|
|
|
|
|
memcpy(co2_relH, getMeasures(receive[SprintIR],'H', 5), 5);
|
|
|
|
|
memcpy(co_relH, getMeasures(receive[COAF], 'H', 5), 5);
|
|
|
|
|
//saving formated measurements in string DATA
|
|
|
|
|
sprintf(DATA,
|
|
|
|
|
"%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s",
|
|
|
|
|
(int)t, co2_uf, co2_f, co_uf, co_f, o2_ppm, o2_xcent,
|
|
|
|
|
co2_temp, o2_temp, co2_press, o2_press, co2_relH);
|
|
|
|
|
co_temp, o2_temp, co_press, o2_press, co_relH);
|
|
|
|
|
printf("\r%s", DATA); //showing measurements on display
|
|
|
|
|
|
|
|
|
|
dfp = fopen(data_file_path, "a"); // open file for writing
|
|
|
|
|