/*********************************************** * * ************************************************/ #include #include #include #include #include #define BASE_ADDR 0x02000600 #define HIGH_FLOW_D1 0 #define HIGH_FLOW_D2 48 #define LOW_FLOW_D1 24 #define LOW_FLOW_D2 72 #define IN + 2 * #define OUT + 1 + 2 * main(argc, argv) int argc; char **argv; { FLOW_MBOX *mod; int gains_set[96], gains_read[96], data[96]; float datv[96]; unsigned base; int ndata, gain_mode, diff_mode, i; float vmin = 0.; /* give range of the A/D : settable only hardware ! */ float vmax = 10.; float nch = 4096; int cpu_nr, tcp_ip_nr; char *hv_config[3]; int pin, balc, i_o_code, ch_i, ch_nr, id12; char line[80], i_o[1], ch[2]; int linel, channel; float p_in, p_out; base = (unsigned) BASE_ADDR; if (get_config( &tcp_ip_nr, &cpu_nr, hv_config) != 0){ printf (" error in get_config \n"); exit (0); } diff_mode = 0; /* 1: 48 diff chan's; 0: 96 single ended chan's */ gain_mode = 1; /* 1: common amplification for all chan's 0: individual amplification */ gains_set[0] = gain_word(1); /* -> amplification = 1 */ anl_adc_init(base, &gain_mode, gains_set, &diff_mode); anl_adc_read(base, data, &ndata, &gain_mode, gains_read, &diff_mode); for ( i = 0; i < ndata; i++) datv[i] = (vmax - vmin)/(nch-1) * (float) data[i] + vmin; p_in = 1000. * (datv[LOW_FLOW_D1 IN 10] - 0.08) / 3.25 ; p_out= 1000. * (datv[LOW_FLOW_D1 OUT 10] - 0.08)/ }