C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 1 C51 COMPILER V8.16, COMPILATION OF MODULE MAIN_C NO OBJECT MODULE REQUESTED COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE MAIN_C.C BROWSE ORDER MODP2 DEBUG OBJECTEXTEND SRC(.\MAIN_C.SRC) line level source 1 /*------------------------------------------------------------------------------ 2 Main_C.C 3 ------------------------------------------------------------------------------*/ 4 5 #include /* prototype declarations for I/O functions */ 6 #include 7 8 /*------------------------------------------------ 9 The main C function. Program execution starts 10 here after stack initialization. 11 ------------------------------------------------*/ 12 void main(void){ 13 1 #pragma asm 14 1 15 1 extrn code (START) 16 1 JMP START /* start main program */ 17 1 18 1 #pragma endasm 19 1 } 20 21 /* public constants */ 22 code double DP = 1e-3; /* calibration-radiation in Sievert */ 23 code double DTC = 90e-6; /* dead time constant of the tubes */ 24 code double II0AL = 0.913931185; /* ?manually calculated transmission of Beta and Gamma for 0.3 cm 13A -l */ 25 code double IIAALPB = 45.299015e-3; /* ?manually calculated transmission for Beta and Gamma for 0.3 c -m 13AL + 5.7 cm 82Pb, not used */ 26 code double C0GMZC = 1.0; /* initial unknown constant */ 27 code double II0ALPB = 38.320104e-3; /* ?manually calculated transmission for Neutrons for 0.3 cm 13Al -+ 5.7 cm 82Pb */ 28 /* code int q20 = 20; /* Alpha valuation 29 code int q10 = 10; /* fast Neutron valuation 30 code int q4 = 4; /* therm. Neutron valuation 31 code int q1 = 1; /* Beta + Gamma valuation */ 32 33 /* Variables for all functions */ 34 xdata signed int DBP; /* digits behind point */ 35 xdata char *UNIT[7]; /* unit of the value */ 36 xdata double VAL; /* a double-help */ 37 xdata unsigned long int HELP00; /* C-Help-Variables following */ 38 xdata unsigned long int HELP10; 39 xdata unsigned long int HELP20; 40 xdata unsigned long int COUNT0; 41 xdata unsigned long int COUNT1; 42 xdata unsigned long int COUNT2; 43 44 /* Flash-ROM-constants */ 45 extern code double CGMZC; /* the searched constant for the Geiger-Müller-Zähler */ 46 extern code double CMAFAL; /* measured transmission factor of the 13AL-filter for Beta and Gamma */ 47 extern code double CMAFPB; /* measured transmission factor of the 82Pb-filter for Beta and Gamma */ 48 49 /* data-variables */ 50 extern data unsigned int COUNTER0; 51 extern data unsigned int COUNTER1; 52 extern data unsigned int COUNTER2; C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 2 53 extern data unsigned int HELP0; 54 extern data unsigned int HELP1; 55 extern data unsigned int HELP2; 56 57 /* xdata-variables */ 58 extern xdata char *DSP_BUF0[34]; /* the addresses of the 5 ASCII-buffers */ 59 extern xdata char *DSP_BUF1[17]; 60 extern xdata char *DSP_BUF2[17]; 61 extern xdata char *DSP_BUF3[17]; 62 extern xdata char *DSP_BUF4[17]; 63 extern xdata double MEA_VALUE; /* the result */ 64 extern xdata unsigned char ALARM_QUIT; /* 1 if return alarm is confirmed */ 65 66 extern xdata unsigned int CALIBRATE01; /* extern variable-addresses from calibration-routine */ 67 extern xdata unsigned int CALIBRATE11; /* 5 measurements with 3 values */ 68 extern xdata unsigned int CALIBRATE21; /* measurement 1 */ 69 extern xdata unsigned int CALIBRATE02; 70 extern xdata unsigned int CALIBRATE12; 71 extern xdata unsigned int CALIBRATE22; /* measurement 2 */ 72 extern xdata unsigned int CALIBRATE03; 73 extern xdata unsigned int CALIBRATE13; 74 extern xdata unsigned int CALIBRATE23; /* measurement 3 */ 75 extern xdata unsigned int CALIBRATE04; 76 extern xdata unsigned int CALIBRATE14; 77 extern xdata unsigned int CALIBRATE24; /* measurement 4 */ 78 extern xdata unsigned int CALIBRATE05; 79 extern xdata unsigned int CALIBRATE15; 80 extern xdata unsigned int CALIBRATE25; /* measurement 5 */ 81 82 extern xdata unsigned int CALIBRATE0; /* middles from 5 measurements tube 0 */ 83 extern xdata unsigned int CALIBRATE1; /* middles from 5 measurements tube 1 */ 84 extern xdata unsigned int CALIBRATE2; /* middles from 5 measurements tube 2 */ 85 86 extern xdata double GMZC; /* the searched constant for the Geiger-Müller-Zähler */ 87 extern xdata double MAFAL; /* measured transmission factor of the AL-filter for Beta and Gamma */ 88 extern xdata double MAFPB; /* measured transmission factor of the Al-Pb-filter for Neutrons */ 89 90 /* measuring-factor */ 91 extern xdata unsigned int MEA_FACTOR; /* measurement-factor, depending from used measurement-time */ 92 93 /* LOGGER_BYTE */ 94 extern xdata unsigned int LOGGER_BYTE; /* index of the next free buffer of data logger buffer */ 95 96 /* C subroutines */ 97 void C_ALARM(void); /* handels alarm */ 98 99 void C_CAL0 (void){ 100 1 /* the math. calibration routine for 1 mSv Beta + Gamma Radiation to calculate the tube constant and A -L-filter-transmission */ 101 1 /* build the middle from 5 measurements for tubes 0 to 2 */ 102 1 CALIBRATE0 = (CALIBRATE01+CALIBRATE02+CALIBRATE03+CALIBRATE04+CALIBRATE05)*MEA_FACTOR/5; 103 1 CALIBRATE1 = (CALIBRATE11+CALIBRATE12+CALIBRATE13+CALIBRATE14+CALIBRATE15)*MEA_FACTOR/5; 104 1 CALIBRATE2 = (CALIBRATE21+CALIBRATE22+CALIBRATE23+CALIBRATE24+CALIBRATE25)*MEA_FACTOR/5; 105 1 106 1 if (CALIBRATE0>100){ 107 2 /* calculate the correction for the dead-time of the tubes */ 108 2 CALIBRATE0 = CALIBRATE0/(1-DTC*CALIBRATE0); 109 2 CALIBRATE1 = CALIBRATE1/(1-DTC*CALIBRATE1); 110 2 CALIBRATE2 = CALIBRATE2/(1-DTC*CALIBRATE2); 111 2 112 2 /* calculate the constant of the used Geiger-Müller-Zähler */ 113 2 GMZC = CALIBRATE0/DP; C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 3 114 2 115 2 /* measured transmission of the AL-filter for Beta and Gamma */ 116 2 MAFAL = CALIBRATE1/CALIBRATE0; 117 2 118 2 /* manual calculated transmission of the Al-Pb-filter for Beta and Gamma */ 119 2 MAFPB = IIAALPB; 120 2 121 2 /* print to buffer */ 122 2 sprintf(*DSP_BUF0,"Uint %u %c",CALIBRATE0,0); 123 2 sprintf(*DSP_BUF1,"Uint %u %c",CALIBRATE1,0); 124 2 sprintf(*DSP_BUF2,"Uint %u %c",CALIBRATE2,0); 125 2 sprintf(*DSP_BUF3,"%f %c",GMZC,0); 126 2 sprintf(*DSP_BUF4,"%f %c",MAFAL,0); 127 2 } 128 1 129 1 else{ 130 2 131 2 GMZC = C0GMZC; /* set to 1, to prevent errors */ 132 2 MAFAL = II0AL; /* set to manually or corrected calculated value */ 133 2 MAFPB = II0ALPB; /* set to manually or corrected calculated value */ 134 2 135 2 } 136 1 } 137 138 void C_CAL1 (void){ 139 1 /* the math. calibration routine for 1 mSv fast Neutron-radiation to calculate the AL-Pb-filter-transm -ission */ 140 1 /* build the middle from 5 measurements for tubes 0 and 2 */ 141 1 CALIBRATE0 = (CALIBRATE01+CALIBRATE02+CALIBRATE03+CALIBRATE04+CALIBRATE05)*MEA_FACTOR/5; 142 1 CALIBRATE2 = (CALIBRATE21+CALIBRATE22+CALIBRATE23+CALIBRATE24+CALIBRATE25)*MEA_FACTOR/5; 143 1 144 1 if (CALIBRATE0>100){ 145 2 /* calculate the correction for the dead-time of the tubes */ 146 2 CALIBRATE0 = CALIBRATE0/(1-DTC*CALIBRATE0); 147 2 CALIBRATE2 = CALIBRATE2/(1-DTC*CALIBRATE2); 148 2 149 2 /* calculated transmission of the Al-Pb-filter for Neutrons */ 150 2 MAFPB = CALIBRATE2/CALIBRATE0; 151 2 152 2 sprintf(*DSP_BUF0,"%f %c",MAFPB,0); 153 2 sprintf(*DSP_BUF1,"Uint %u %c",CALIBRATE0,0); 154 2 sprintf(*DSP_BUF2,"Uint %u %c",CALIBRATE2,0); 155 2 156 2 } 157 1 158 1 else{ 159 2 160 2 MAFPB = II0ALPB; /* set to manually or corrected calculated value */ 161 2 162 2 } 163 1 } 164 165 void C_ADL_MES (void){ 166 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 167 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 168 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 169 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 170 1 171 1 /* calculate the ADL in Sv/h */ 172 1 /* MEA_VALUE = ((COUNTER0-COUNTER1)*(q20/2+q10*(1/2+1/100))+(COUNTER1-COUNTER2)*q1+(COUNTER2-(COUNTER0-CO -UNTER1)*(1/2+1/100))*q4)/CGMZC*3600; */ 173 1 MEA_VALUE = ((COUNTER0-COUNTER1)*604/40)+(COUNTER1-COUNTER2)+(COUNTER2-(COUNTER0-COUNTER1)*204/100)/CGMZC C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 4 -*3600; 174 1 175 1 if (MEA_VALUE!=0){ 176 2 177 2 DBP = ceil(log10(MEA_VALUE)); 178 2 if (DBP<=0) DBP--; 179 2 180 2 } 181 1 182 1 else{ 183 2 184 2 DBP=0; 185 2 186 2 }; /* digits behind point */ 187 1 188 1 /* select the right format */ 189 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv/h"+0;}; 190 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 191 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 192 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 193 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv/h"+0;}; 194 1 195 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 196 1 if (LOGGER_BYTE==0){ 197 2 198 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 199 2 200 2 } 201 1 202 1 else{ 203 2 204 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 205 2 206 2 } 207 1 208 1 } 209 210 void C_ADLALPHA_MES (void){ 211 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 212 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 213 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 214 1 215 1 /* calculate the ADL-Alpha in Sv/h */ 216 1 /* MEA_VALUE = ((COUNTER1-COUNTER0)*604/40)/CGMZC*3600; */ 217 1 MEA_VALUE = ((COUNTER1-COUNTER0)*604/40)/CGMZC*3600; 218 1 219 1 if (MEA_VALUE!=0){ 220 2 221 2 DBP = ceil(log10(MEA_VALUE)); 222 2 if (DBP<=0) DBP--; 223 2 224 2 } 225 1 226 1 else{ 227 2 228 2 DBP=0; 229 2 230 2 }; /* digits behind point */ 231 1 232 1 /* select the right format */ 233 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv/h"+0;}; 234 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 5 235 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 236 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 237 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv/h"+0;}; 238 1 239 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 240 1 if (LOGGER_BYTE==0){ 241 2 242 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 243 2 244 2 } 245 1 246 1 else{ 247 2 248 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 249 2 250 2 } 251 1 252 1 } 253 254 void C_ADLBETA_MES (void){ 255 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 256 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 257 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 258 1 259 1 /* calculate the ADL-Beta + Gamma in Sv/h */ 260 1 /* MEA_VALUE = (COUNTER1-COUNTER2)/CGMZC*3600; */ 261 1 MEA_VALUE = (COUNTER1-COUNTER2)/CGMZC*3600; 262 1 263 1 if (MEA_VALUE!=0){ 264 2 265 2 DBP = ceil(log10(MEA_VALUE)); 266 2 if (DBP<=0) DBP--; 267 2 268 2 } 269 1 270 1 else{ 271 2 272 2 DBP=0; 273 2 274 2 }; /* digits behind point */ 275 1 276 1 /* select the right format */ 277 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv/h"+0;}; 278 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 279 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 280 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 281 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv/h"+0;}; 282 1 283 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 284 1 if (LOGGER_BYTE==0){ 285 2 286 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 287 2 288 2 } 289 1 290 1 else{ 291 2 292 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 293 2 294 2 } 295 1 296 1 } C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 6 297 298 void C_ADLTNEUT_MES (void){ 299 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 300 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 301 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 302 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 303 1 304 1 /* calculate the ADL-therm. Neutrons in Sv/h */ 305 1 /* MEA_VALUE = (COUNTER2-(COUNTER0-COUNTER1)*(1/2+1/100))*q4/CGMZC*3600; */ 306 1 MEA_VALUE = (COUNTER2-(COUNTER0-COUNTER1)*204/100)/CGMZC*3600; 307 1 308 1 if (MEA_VALUE!=0){ 309 2 310 2 DBP = ceil(log10(MEA_VALUE)); 311 2 if (DBP<=0) DBP--; 312 2 313 2 } 314 1 315 1 else{ 316 2 317 2 DBP=0; 318 2 319 2 }; /* digits behind point */ 320 1 321 1 /* select the right format */ 322 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv/h"+0;}; 323 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 324 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 325 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 326 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv/h"+0;}; 327 1 328 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 329 1 if (LOGGER_BYTE==0){ 330 2 331 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 332 2 333 2 } 334 1 335 1 else{ 336 2 337 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 338 2 339 2 } 340 1 341 1 } 342 343 void C_ADLFNEUT_MES (void){ 344 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 345 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 346 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 347 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 348 1 349 1 /* calculate the ADL-fast Neutrons in Sv/h */ 350 1 /* MEA_VALUE = (COUNTER0-COUNTER1)*(20/4+10/100)*q10/CGMZC*3600; */ 351 1 MEA_VALUE = (COUNTER0-COUNTER1)*510/100/CGMZC*3600; 352 1 353 1 if (MEA_VALUE!=0){ 354 2 355 2 DBP = ceil(log10(MEA_VALUE)); 356 2 if (DBP<=0) DBP--; 357 2 358 2 } C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 7 359 1 360 1 else{ 361 2 362 2 DBP=0; 363 2 364 2 }; /* digits behind point */ 365 1 366 1 /* select the right format */ 367 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv/h"+0;}; 368 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 369 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 370 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 371 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv/h"+0;}; 372 1 373 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 374 1 if (LOGGER_BYTE==0){ 375 2 376 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 377 2 378 2 } 379 1 380 1 else{ 381 2 382 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 383 2 384 2 } 385 1 386 1 } 387 388 void C_ADLSALPHA_MES (void){ 389 1 /* calculate the correction for the dead-time of the tubes */ 390 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 391 1 392 1 /* calculate the ADL-Alpha in Sv/h, if surly only Alpha-radiation */ 393 1 /* MEA_VALUE = COUNTER0*q20/CGMZC*3600 */ 394 1 MEA_VALUE = COUNTER0*20/CGMZC*3600; 395 1 396 1 if (MEA_VALUE!=0){ 397 2 398 2 DBP = ceil(log10(MEA_VALUE)); 399 2 if (DBP<=0) DBP--; 400 2 401 2 } 402 1 403 1 else{ 404 2 405 2 DBP=0; 406 2 407 2 }; /* digits behind point */ 408 1 409 1 /* select the right format */ 410 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv/h"+0;}; 411 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 412 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 413 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 414 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv/h"+0;}; 415 1 416 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 417 1 if (LOGGER_BYTE==0){ 418 2 419 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 420 2 C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 8 421 2 } 422 1 423 1 else{ 424 2 425 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 426 2 427 2 } 428 1 429 1 } 430 431 void C_ADLSBETGAM_MES (void){ 432 1 /* calculate the correction for the dead-time of the tubes */ 433 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 434 1 435 1 /* calculate the ADL-Beta + Gamma in Sv/h, if surly only Beta and Gamma-radiation */ 436 1 /* MEA_VALUE = COUNTER0*q1/CGMZC*3600 */ 437 1 MEA_VALUE = COUNTER0/CGMZC*3600; 438 1 439 1 if (MEA_VALUE!=0){ 440 2 441 2 DBP = ceil(log10(MEA_VALUE)); 442 2 if (DBP<=0) DBP--; 443 2 444 2 } 445 1 446 1 else{ 447 2 448 2 DBP=0; 449 2 450 2 }; /* digits behind point */ 451 1 452 1 /* select the right format */ 453 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv/h"+0;}; 454 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 455 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 456 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 457 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv/h"+0;}; 458 1 459 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 460 1 if (LOGGER_BYTE==0){ 461 2 462 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 463 2 464 2 } 465 1 466 1 else{ 467 2 468 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 469 2 470 2 } 471 1 472 1 } 473 474 void C_ADLSNEUT_MES (void){ 475 1 /* calculate the correction for the dead-time of the tubes */ 476 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2); 477 1 478 1 /* calculate the ADL-Neutrons in Sv/h, if surly only Neutron-radiation, q4-valuation */ 479 1 /* MEA_VALUE = COUNTER2*q4/II0ALPB/CGMZC*3600 */ 480 1 MEA_VALUE = COUNTER2*4/II0ALPB/CGMZC*3600; 481 1 482 1 if (MEA_VALUE!=0){ C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 9 483 2 484 2 DBP = ceil(log10(MEA_VALUE)); 485 2 if (DBP<=0) DBP--; 486 2 487 2 } 488 1 489 1 else{ 490 2 491 2 DBP=0; 492 2 493 2 }; /* digits behind point */ 494 1 495 1 /* select the right format */ 496 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv/h"+0;}; 497 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 498 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 499 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv/h"+0;}; 500 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv/h"+0;}; 501 1 502 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 503 1 if (LOGGER_BYTE==0){ 504 2 505 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 506 2 507 2 } 508 1 509 1 else{ 510 2 511 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 512 2 513 2 } 514 1 515 1 } 516 517 void C_EDL_MES (void){ 518 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 519 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 520 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 521 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 522 1 523 1 /* calculate the EDL in Gy/h */ 524 1 /* MEA_VALUE = ((COUNTER0-COUNTER1)+(COUNTER1-COUNTER2)+COUNTER2)/CGMZC*3600; */ 525 1 MEA_VALUE = ((COUNTER0-COUNTER1)+(COUNTER1-COUNTER2)+COUNTER2)/CGMZC*3600; 526 1 527 1 if (MEA_VALUE!=0){ 528 2 529 2 DBP = ceil(log10(MEA_VALUE)); 530 2 if (DBP<=0) DBP--; 531 2 532 2 } 533 1 534 1 else{ 535 2 536 2 DBP=0; 537 2 538 2 }; /* digits behind point */ 539 1 540 1 /* select the right format */ 541 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Gy/h"+0;}; 542 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 543 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 544 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 10 545 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uGy/h"+0;}; 546 1 547 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 548 1 if (LOGGER_BYTE==0){ 549 2 550 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 551 2 552 2 } 553 1 554 1 else{ 555 2 556 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 557 2 558 2 } 559 1 560 1 } 561 562 void C_EDLALPHA_MES (void){ 563 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 564 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 565 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 566 1 567 1 /* calculate the EDL-Alpha in Gy/h */ 568 1 /* MEA_VALUE = (COUNTER1-COUNTER0)/CGMZC*3600; */ 569 1 MEA_VALUE = (COUNTER1-COUNTER0)/CGMZC*3600; 570 1 571 1 if (MEA_VALUE!=0){ 572 2 573 2 DBP = ceil(log10(MEA_VALUE)); 574 2 if (DBP<=0) DBP--; 575 2 576 2 } 577 1 578 1 else{ 579 2 580 2 DBP=0; 581 2 582 2 }; /* digits behind point */ 583 1 584 1 /* select the right format */ 585 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Gy/h"+0;}; 586 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 587 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 588 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 589 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uGy/h"+0;}; 590 1 591 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 592 1 if (LOGGER_BYTE==0){ 593 2 594 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 595 2 596 2 } 597 1 598 1 else{ 599 2 600 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 601 2 602 2 } 603 1 604 1 } 605 606 void C_EDLBETA_MES (void){ C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 11 607 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 608 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 609 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 610 1 611 1 /* calculate the EDL-Beta + Gamma in Gy/h */ 612 1 /* MEA_VALUE = (COUNTER1-COUNTER2)/CGMZC*3600; */ 613 1 MEA_VALUE = (COUNTER1-COUNTER2)/CGMZC*3600; 614 1 615 1 if (MEA_VALUE!=0){ 616 2 617 2 DBP = ceil(log10(MEA_VALUE)); 618 2 if (DBP<=0) DBP--; 619 2 620 2 } 621 1 622 1 else{ 623 2 624 2 DBP=0; 625 2 626 2 }; /* digits behind point */ 627 1 628 1 /* select the right format */ 629 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Gy/h"+0;}; 630 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 631 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 632 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 633 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uGy/h"+0;}; 634 1 635 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 636 1 if (LOGGER_BYTE==0){ 637 2 638 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 639 2 640 2 } 641 1 642 1 else{ 643 2 644 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 645 2 646 2 } 647 1 648 1 } 649 650 void C_EDLTNEUT_MES (void){ 651 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ - 652 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 653 1 654 1 /* calculate the EDL-therm. Neutrons in Gy/h */ 655 1 /* MEA_VALUE = COUNTER2/CGMZC*3600; */ 656 1 MEA_VALUE = COUNTER2/CGMZC*3600; 657 1 658 1 if (MEA_VALUE!=0){ 659 2 660 2 DBP = ceil(log10(MEA_VALUE)); 661 2 if (DBP<=0) DBP--; 662 2 663 2 } 664 1 665 1 else{ 666 2 667 2 DBP=0; C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 12 668 2 669 2 }; /* digits behind point */ 670 1 671 1 /* select the right format */ 672 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Gy/h"+0;}; 673 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 674 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 675 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 676 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uGy/h"+0;}; 677 1 678 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 679 1 if (LOGGER_BYTE==0){ 680 2 681 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 682 2 683 2 } 684 1 685 1 else{ 686 2 687 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 688 2 689 2 } 690 1 691 1 } 692 693 void C_EDLFNEUT_MES (void){ 694 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 695 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 696 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 697 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 698 1 699 1 /* calculate the EDL-fast Neutrons in Gy/h */ 700 1 /* MEA_VALUE = (COUNTER2-(COUNTER0-COUNTER1)*(1/2+1/100)))/CGMZC*3600; */ 701 1 MEA_VALUE = (COUNTER2-(COUNTER0-COUNTER1)*51/100)/CGMZC*3600; 702 1 703 1 if (MEA_VALUE!=0){ 704 2 705 2 DBP = ceil(log10(MEA_VALUE)); 706 2 if (DBP<=0) DBP--; 707 2 708 2 } 709 1 710 1 else{ 711 2 712 2 DBP=0; 713 2 714 2 }; /* digits behind point */ 715 1 716 1 /* select the right format */ 717 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Gy/h"+0;}; 718 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 719 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 720 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 721 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uGy/h"+0;}; 722 1 723 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 724 1 if (LOGGER_BYTE==0){ 725 2 726 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 727 2 728 2 } 729 1 C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 13 730 1 else{ 731 2 732 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 733 2 734 2 } 735 1 736 1 } 737 738 void C_EDLSALPHA_MES (void){ 739 1 /* calculate the correction for the dead-time of the tubes */ 740 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 741 1 742 1 /* calculate the EDL-Alpha in Gy/h, if surly only Alpha-radiation */ 743 1 /* MEA_VALUE = COUNTER0/CGMZC*3600 */ 744 1 MEA_VALUE = COUNTER0/CGMZC*3600; 745 1 746 1 if (MEA_VALUE!=0){ 747 2 748 2 DBP = ceil(log10(MEA_VALUE)); 749 2 if (DBP<=0) DBP--; 750 2 751 2 } 752 1 753 1 else{ 754 2 755 2 DBP=0; 756 2 757 2 }; /* digits behind point */ 758 1 759 1 /* select the right format */ 760 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Gy/h"+0;}; 761 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 762 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 763 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 764 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uGy/h"+0;}; 765 1 766 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 767 1 if (LOGGER_BYTE==0){ 768 2 769 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 770 2 771 2 } 772 1 773 1 else{ 774 2 775 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 776 2 777 2 } 778 1 779 1 } 780 781 void C_EDLSBETGAM_MES (void){ 782 1 /* calculate the correction for the dead-time of the tubes */ 783 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 784 1 785 1 /* calculate the EDL-Beta + Gamma in Gy/h, if surly only Beta and Gamma-radiation */ 786 1 /* MEA_VALUE = COUNTER0/CGMZC*3600 */ 787 1 MEA_VALUE = COUNTER0/CGMZC*3600; 788 1 789 1 if (MEA_VALUE!=0){ 790 2 791 2 DBP = ceil(log10(MEA_VALUE)); C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 14 792 2 if (DBP<=0) DBP--; 793 2 794 2 } 795 1 796 1 else{ 797 2 798 2 DBP=0; 799 2 800 2 }; /* digits behind point */ 801 1 802 1 /* select the right format */ 803 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Gy/h"+0;}; 804 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 805 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 806 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 807 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uGy/h"+0;}; 808 1 809 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 810 1 if (LOGGER_BYTE==0){ 811 2 812 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 813 2 814 2 } 815 1 816 1 else{ 817 2 818 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 819 2 820 2 } 821 1 822 1 } 823 824 void C_EDLSNEUT_MES (void){ 825 1 /* calculate the correction for the dead-time of the tubes */ 826 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2); 827 1 828 1 /* calculate the EDL-Neutrons in Gy/h, if surly only Neutron-radiation */ 829 1 /* MEA_VALUE = COUNTER2/II0ALPB/CGMZC*3600 */ 830 1 MEA_VALUE = COUNTER2/II0ALPB/CGMZC*3600; 831 1 832 1 if (MEA_VALUE!=0){ 833 2 834 2 DBP = ceil(log10(MEA_VALUE)); 835 2 if (DBP<=0) DBP--; 836 2 837 2 } 838 1 839 1 else{ 840 2 841 2 DBP=0; 842 2 843 2 }; /* digits behind point */ 844 1 845 1 /* select the right format */ 846 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Gy/h"+0;}; 847 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 848 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 849 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mGy/h"+0;}; 850 1 851 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 852 1 if (LOGGER_BYTE==0){ 853 2 C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 15 854 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 855 2 856 2 } 857 1 858 1 else{ 859 2 860 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 861 2 862 2 } 863 1 864 1 } 865 866 void C_ED_MES (void){ 867 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 868 1 HELP00 = COUNTER0*65536+HELP0; 869 1 HELP10 = COUNTER1*65536+HELP1; 870 1 HELP20 = COUNTER2*65536+HELP2; 871 1 COUNT0 = MEA_FACTOR*HELP00/(1-DTC*HELP00); 872 1 COUNT1 = MEA_FACTOR*HELP10/(1-DTC*HELP10)/CMAFAL; 873 1 COUNT2 = MEA_FACTOR*HELP20/(1-DTC*HELP20)/CMAFPB; 874 1 875 1 /* calculate the equivalent ED in Sv */ 876 1 /* MEA_VALUE =((COUNT0-COUNT1)*(q20/2+q10/2+q10/100))+(COUNT1-COUNT2)+(COUNT2-(COUNT0-COUNT1)*(1/2+/100)* -q4)/CGMZC; */ 877 1 MEA_VALUE = ((COUNT0-COUNT1)*604/40)+(COUNT1-COUNT2)+(COUNT2-(COUNT0-COUNT1)*204/100)/CGMZC; 878 1 if (MEA_VALUE!=0){ 879 2 880 2 DBP = ceil(log10(MEA_VALUE)); 881 2 if (DBP<=0) DBP--; 882 2 883 2 C_ALARM(); 884 2 885 2 } 886 1 887 1 else{ 888 2 889 2 DBP=0; 890 2 891 2 }; /* digits behind point */ 892 1 893 1 /* select the right format */ 894 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv"+0;}; 895 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 896 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 897 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 898 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv"+0;}; 899 1 900 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 901 1 if (LOGGER_BYTE==0){ 902 2 903 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 904 2 905 2 } 906 1 907 1 else{ 908 2 909 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 910 2 911 2 } 912 1 913 1 } 914 C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 16 915 void C_EDALPHA_MES (void){ 916 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 917 1 HELP00 = COUNTER0*65536+HELP0; 918 1 HELP10 = COUNTER1*65536+HELP1; 919 1 COUNT0 = MEA_FACTOR*HELP00/(1-DTC*HELP00); 920 1 COUNT1 = MEA_FACTOR*HELP10/(1-DTC*HELP10)/CMAFAL; 921 1 922 1 /* calculate the equivalent ED-Alpha in Sv */ 923 1 /* MEA_VALUE = (COUNT1-COUNT0)*q20/CGMZC */ 924 1 MEA_VALUE = (COUNT1-COUNT0)*20/CGMZC; 925 1 926 1 if (MEA_VALUE!=0){ 927 2 928 2 DBP = ceil(log10(MEA_VALUE)); 929 2 if (DBP<=0) DBP--; 930 2 931 2 C_ALARM(); 932 2 933 2 } 934 1 935 1 else{ 936 2 937 2 DBP=0; 938 2 939 2 }; /* digits behind point */ 940 1 941 1 /* select the right format */ 942 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv"+0;}; 943 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 944 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 945 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 946 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv"+0;}; 947 1 948 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 949 1 if (LOGGER_BYTE==0){ 950 2 951 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 952 2 953 2 } 954 1 955 1 else{ 956 2 957 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 958 2 959 2 } 960 1 961 1 } 962 963 void C_EDBETA_MES (void){ 964 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 965 1 HELP10 = COUNTER1*65536+HELP1; 966 1 HELP20 = COUNTER2*65536+HELP2; 967 1 COUNT1 = MEA_FACTOR*HELP10/(1-DTC*HELP10)/CMAFAL; 968 1 COUNT2 = MEA_FACTOR*HELP20/(1-DTC*HELP20)/CMAFPB; 969 1 970 1 /* calculate the equivalent ED-Beta + Gamma in Sv */ 971 1 /* MEA_VALUE = (COUNT1-COUNT2)*q1/CGMZC; */ 972 1 MEA_VALUE = (COUNT1-COUNT2)/CGMZC; 973 1 974 1 if (MEA_VALUE!=0){ 975 2 976 2 DBP = ceil(log10(MEA_VALUE)); C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 17 977 2 if (DBP<=0) DBP--; 978 2 979 2 C_ALARM(); 980 2 981 2 } 982 1 983 1 else{ 984 2 985 2 DBP=0; 986 2 987 2 }; /* digits behind point */ 988 1 989 1 /* select the right format */ 990 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv"+0;}; 991 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 992 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 993 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 994 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv"+0;}; 995 1 996 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 997 1 if (LOGGER_BYTE==0){ 998 2 999 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 1000 2 1001 2 } 1002 1 1003 1 else{ 1004 2 1005 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 1006 2 1007 2 } 1008 1 1009 1 } 1010 1011 void C_EDTNEUT_MES (void){ 1012 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ - 1013 1 HELP20 = COUNTER2*65536+HELP2; 1014 1 COUNT2 = MEA_FACTOR*HELP20/(1-DTC*HELP20)/CMAFPB; 1015 1 1016 1 /* calculate the equivalent ED-therm. Neutrons in Sv */ 1017 1 /* MEA_VALUE = COUNT2*q4/CGMZC; */ 1018 1 MEA_VALUE = COUNT2*4/CGMZC; 1019 1 1020 1 if (MEA_VALUE!=0){ 1021 2 1022 2 DBP = ceil(log10(MEA_VALUE)); 1023 2 if (DBP<=0) DBP--; 1024 2 1025 2 C_ALARM(); 1026 2 1027 2 } 1028 1 1029 1 else{ 1030 2 1031 2 DBP=0; 1032 2 1033 2 }; /* digits behind point */ 1034 1 1035 1 /* select the right format */ 1036 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv"+0;}; 1037 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 18 1038 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1039 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1040 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv"+0;}; 1041 1 1042 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1043 1 if (LOGGER_BYTE==0){ 1044 2 1045 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 1046 2 1047 2 } 1048 1 1049 1 else{ 1050 2 1051 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 1052 2 1053 2 } 1054 1 1055 1 } 1056 1057 void C_EDSNEUT_MES (void){ 1058 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1059 1 HELP00 = COUNTER0*65536+HELP0; 1060 1 HELP10 = COUNTER1*65536+HELP1; 1061 1 HELP20 = COUNTER2*65536+HELP2; 1062 1 COUNT0 = MEA_FACTOR*HELP00/(1-DTC*HELP00); 1063 1 COUNT1 = MEA_FACTOR*HELP10/(1-DTC*HELP10)/CMAFAL; 1064 1 COUNT2 = MEA_FACTOR*HELP20/(1-DTC*HELP20)/CMAFPB; 1065 1 1066 1 /* calculate the equivalent ED-fast Neutrons in Sv */ 1067 1 /* MEA_VALUE = (COUNT2-(COUNT0-COUNT1)*(1/2+1/100)))*q10/CGMZC; */ 1068 1 MEA_VALUE = (COUNT2-(COUNT0-COUNT1)*51/100)*10/CGMZC; 1069 1 1070 1 if (MEA_VALUE!=0){ 1071 2 1072 2 DBP = ceil(log10(MEA_VALUE)); 1073 2 if (DBP<=0) DBP--; 1074 2 1075 2 C_ALARM(); 1076 2 1077 2 } 1078 1 1079 1 else{ 1080 2 1081 2 DBP=0; 1082 2 1083 2 }; /* digits behind point */ 1084 1 1085 1 /* select the right format */ 1086 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv"+0;}; 1087 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1088 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1089 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1090 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv"+0;}; 1091 1 1092 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1093 1 if (LOGGER_BYTE==0){ 1094 2 1095 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 1096 2 1097 2 } 1098 1 1099 1 else{ C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 19 1100 2 1101 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 1102 2 1103 2 } 1104 1 1105 1 } 1106 1107 void C_EDSALPHA_MES (void){ 1108 1 /* calculate the correction for the dead-time of the tubes */ 1109 1 HELP00 = COUNTER0*65536+HELP0; 1110 1 COUNT0 = MEA_FACTOR*HELP00/(1-DTC*HELP00); 1111 1 1112 1 /* calculate the equivalent ED-Alpha, single in Sv, if surly only Alpha-radiation */ 1113 1 /* MEA_VALUE = COUNT0*q20/CGMZC */ 1114 1 MEA_VALUE = COUNT0*20/CGMZC; 1115 1 1116 1 if (MEA_VALUE!=0){ 1117 2 1118 2 DBP = ceil(log10(MEA_VALUE)); 1119 2 if (DBP<=0) DBP--; 1120 2 1121 2 C_ALARM(); 1122 2 1123 2 } 1124 1 1125 1 else{ 1126 2 1127 2 DBP=0; 1128 2 1129 2 }; /* digits behind point */ 1130 1 1131 1 /* select the right format */ 1132 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv"+0;}; 1133 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1134 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1135 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1136 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv"+0;}; 1137 1 1138 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1139 1 if (LOGGER_BYTE==0){ 1140 2 1141 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 1142 2 1143 2 } 1144 1 1145 1 else{ 1146 2 1147 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 1148 2 1149 2 } 1150 1 1151 1 } 1152 1153 void C_EDSBETGAM_MES (void){ 1154 1 /* calculate the correction for the dead-time of the tubes */ 1155 1 HELP00 = COUNTER0*65536+HELP0; 1156 1 COUNT0 = MEA_FACTOR*HELP00/(1-DTC*HELP00); 1157 1 1158 1 /* calculate the equivalent ED-Beta + Gamma in Sv, if surly only Beta and Gamma-radiation */ 1159 1 /* MEA_VALUE = COUNT0*q1/CGMZC */ 1160 1 MEA_VALUE = COUNT0/CGMZC; 1161 1 C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 20 1162 1 if (MEA_VALUE!=0){ 1163 2 1164 2 DBP = ceil(log10(MEA_VALUE)); 1165 2 if (DBP<=0) DBP--; 1166 2 1167 2 C_ALARM(); 1168 2 1169 2 } 1170 1 1171 1 else{ 1172 2 1173 2 DBP=0; 1174 2 1175 2 }; /* digits behind point */ 1176 1 1177 1 /* select the right format */ 1178 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv"+0;}; 1179 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1180 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1181 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1182 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv"+0;}; 1183 1 1184 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1185 1 if (LOGGER_BYTE==0){ 1186 2 1187 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 1188 2 1189 2 } 1190 1 1191 1 else{ 1192 2 1193 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 1194 2 1195 2 } 1196 1 1197 1 } 1198 1199 void C_ED0SNEUT_MES (void){ 1200 1 /* calculate the correction for the dead-time of the tubes */ 1201 1 HELP20 = COUNTER2*65536+HELP2; 1202 1 COUNT2 = MEA_FACTOR*HELP20/(1-DTC*HELP20); 1203 1 1204 1 /* calculate the equivalent ED-Neutrons in Sv/h, if surly only Neutron-radiation */ 1205 1 /* MEA_VALUE = COUNT2*q10/II0ALPB/CGMZC */ 1206 1 MEA_VALUE = COUNT2*10/II0ALPB/CGMZC; 1207 1 1208 1 if (MEA_VALUE!=0){ 1209 2 1210 2 DBP = ceil(log10(MEA_VALUE)); 1211 2 if (DBP<=0) DBP--; 1212 2 1213 2 C_ALARM(); 1214 2 1215 2 } 1216 1 1217 1 else{ 1218 2 1219 2 DBP=0; 1220 2 1221 2 }; /* digits behind point */ 1222 1 1223 1 /* select the right format */ C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 21 1224 1 switch (DBP>=0) {VAL = MEA_VALUE; *UNIT = 13+"Sv"+0;}; 1225 1 switch (DBP==-1){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1226 1 switch (DBP==-2){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1227 1 switch (DBP==-3){VAL = MEA_VALUE*1e3; *UNIT = 13+"mSv"+0;}; 1228 1 switch (DBP<=-4){VAL = MEA_VALUE*1e6; *UNIT = 13+"uSv"+0;}; 1229 1 1230 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1231 1 if (LOGGER_BYTE==0){ 1232 2 1233 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 1234 2 1235 2 } 1236 1 1237 1 else{ 1238 2 1239 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 1240 2 1241 2 } 1242 1 1243 1 } 1244 1245 void C_IR_MES (void){ 1246 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1247 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 1248 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 1249 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 1250 1 1251 1 /* calculate the impuls-rate in 1/s */ 1252 1 MEA_VALUE = (COUNTER0-COUNTER1)+(COUNTER1-COUNTER2)+(COUNTER2-(COUNTER0-COUNTER1)); 1253 1 *UNIT = 13+"1/s"+0; 1254 1 1255 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1256 1 if (LOGGER_BYTE==0){ 1257 2 1258 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1259 2 1260 2 } 1261 1 1262 1 else{ 1263 2 1264 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1265 2 1266 2 } 1267 1 1268 1 } 1269 1270 void C_IRA_MES (void){ 1271 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1272 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 1273 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 1274 1 1275 1 /* calculate the IRA in 1/s */ 1276 1 /* MEA_VALUE = COUNTER1-COUNTER0; */ 1277 1 MEA_VALUE = COUNTER1 - COUNTER0; 1278 1 *UNIT = 13+"1/s"+0; 1279 1 1280 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1281 1 if (LOGGER_BYTE==0){ 1282 2 1283 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1284 2 1285 2 } C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 22 1286 1 1287 1 else{ 1288 2 1289 2 sprintf(*DSP_BUF0," %u %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1290 2 1291 2 } 1292 1 1293 1 } 1294 1295 void C_IRB_MES (void){ 1296 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1297 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 1298 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 1299 1 1300 1 /* calculate the IR-Beta + Gamma in 1/s */ 1301 1 /* MEA_VALUE = COUNTER1-COUNTER2 */ 1302 1 MEA_VALUE = COUNTER1-COUNTER2; 1303 1 *UNIT = 13+"1/s"+0; 1304 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1305 1 if (LOGGER_BYTE==0){ 1306 2 1307 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1308 2 1309 2 } 1310 1 1311 1 else{ 1312 2 1313 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1314 2 1315 2 } 1316 1 1317 1 } 1318 1319 void C_IRNT_MES (void){ 1320 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1321 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 1322 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 1323 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 1324 1 1325 1 /* calculate the IR-therm. Neutrons in 1/s */ 1326 1 /* MEA_VALUE = COUNTER2-(COUNTER0-COUNTER1); */ 1327 1 MEA_VALUE = COUNTER2-(COUNTER0-COUNTER1); 1328 1 *UNIT = 13+"1/s"+0; 1329 1 1330 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1331 1 if (LOGGER_BYTE==0){ 1332 2 1333 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1334 2 1335 2 } 1336 1 1337 1 else{ 1338 2 1339 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1340 2 1341 2 } 1342 1 1343 1 } 1344 1345 void C_IRNF_MES (void){ 1346 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1347 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 23 1348 1 COUNTER1 = MEA_FACTOR*COUNTER1/(1-DTC*COUNTER1)/CMAFAL; 1349 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2)/CMAFPB; 1350 1 1351 1 /* calculate the IR-fast Neutrons in 1/s */ 1352 1 /* MEA_VALUE = (COUNTER0-COUNTER1) */ 1353 1 MEA_VALUE = COUNTER0-COUNTER1; 1354 1 *UNIT = 13+"1/s"+0; 1355 1 1356 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1357 1 if (LOGGER_BYTE==0){ 1358 2 1359 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1360 2 1361 2 } 1362 1 1363 1 else{ 1364 2 1365 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1366 2 1367 2 } 1368 1 1369 1 } 1370 1371 void C_IR0A_MES (void){ 1372 1 /* calculate the correction for the dead-time of the tubes */ 1373 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 1374 1 1375 1 /* calculate the IR-Alpha in 1/s, if surly only Alpha-radiation */ 1376 1 /* MEA_VALUE = COUNTER0 */ 1377 1 MEA_VALUE = COUNTER0; 1378 1 *UNIT = 13+"1/s"+0; 1379 1 1380 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1381 1 if (LOGGER_BYTE==0){ 1382 2 1383 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1384 2 1385 2 } 1386 1 1387 1 else{ 1388 2 1389 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1390 2 1391 2 } 1392 1 1393 1 } 1394 1395 void C_IR0B_MES (void){ 1396 1 /* calculate the correction for the dead-time of the tubes */ 1397 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 1398 1 1399 1 /* calculate the IR-Beta + Gamma in 1/s, if surly only Beta and Gamma-radiation */ 1400 1 /* MEA_VALUE = COUNTER0 */ 1401 1 MEA_VALUE = COUNTER0; 1402 1 *UNIT = 13+"1/s"+0; 1403 1 1404 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1405 1 if (LOGGER_BYTE==0){ 1406 2 1407 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1408 2 1409 2 } C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 24 1410 1 1411 1 else{ 1412 2 1413 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1414 2 1415 2 } 1416 1 1417 1 } 1418 1419 void C_IR0N_MES (void){ 1420 1 /* calculate the correction for the dead-time of the tubes */ 1421 1 COUNTER2 = MEA_FACTOR*COUNTER2/(1-DTC*COUNTER2); 1422 1 1423 1 /* calculate the IR-Neutrons in 1/s, if surly only Neutron-radiation */ 1424 1 /* MEA_VALUE = COUNTER2 / II0ALPB */ 1425 1 MEA_VALUE = COUNTER2 / II0ALPB; 1426 1 *UNIT = 13+"1/s"+0; 1427 1 1428 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1429 1 if (LOGGER_BYTE==0){ 1430 2 1431 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1432 2 1433 2 } 1434 1 1435 1 else{ 1436 2 1437 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1438 2 1439 2 } 1440 1 1441 1 } 1442 1443 void C_IP_MES (void){ 1444 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1445 1 HELP00 = COUNTER0*65536+HELP0; 1446 1 HELP10 = COUNTER1*65536+HELP1; 1447 1 HELP20 = COUNTER2*65536+HELP2; 1448 1 1449 1 COUNTER0 = HELP00/(1-DTC*HELP00); 1450 1 COUNTER1 = HELP10/(1-DTC*HELP10)/CMAFAL; 1451 1 COUNTER2 = HELP20/(1-DTC*HELP20)/CMAFPB; 1452 1 1453 1 /* calculate the impulses in pieces */ 1454 1 /* MEA_VALUE =((COUNTER0-COUNTER1)+(COUNTER1-COUNTER2)+COUNTER2); */ 1455 1 MEA_VALUE = ((COUNTER0-COUNTER1)+(COUNTER1-COUNTER2)+COUNTER2); 1456 1 *UNIT = 13+"N"+0; 1457 1 1458 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1459 1 if (LOGGER_BYTE==0){ 1460 2 1461 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1462 2 1463 2 } 1464 1 1465 1 else{ 1466 2 1467 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1468 2 1469 2 } 1470 1 1471 1 } C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 25 1472 1473 void C_IPA_MES (void){ 1474 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1475 1 HELP00 = COUNTER0*65536+HELP0; 1476 1 HELP10 = COUNTER1*65536+HELP1; 1477 1 1478 1 COUNTER0 = HELP00/(1-DTC*HELP00); 1479 1 COUNTER1 = HELP10/(1-DTC*HELP10)/CMAFAL; 1480 1 1481 1 /* calculate the IP-Alpha in pieces */ 1482 1 /* MEA_VALUE = (COUNTER1-COUNTER0); */ 1483 1 MEA_VALUE = (COUNTER1-COUNTER0); 1484 1 *UNIT = 13+"N"+0; 1485 1 1486 1 1487 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1488 1 if (LOGGER_BYTE==0){ 1489 2 1490 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1491 2 1492 2 } 1493 1 1494 1 else{ 1495 2 1496 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1497 2 1498 2 } 1499 1 1500 1 } 1501 1502 void C_IPB_MES (void){ 1503 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1504 1 HELP10 = COUNTER1*65536+HELP1; 1505 1 HELP20 = COUNTER2*65536+HELP2; 1506 1 1507 1 COUNTER1 = HELP10/(1-DTC*HELP10)/CMAFAL; 1508 1 COUNTER2 = HELP20/(1-DTC*HELP20)/CMAFPB; 1509 1 1510 1 /* calculate the IP-Beta + Gamma in 1/s */ 1511 1 /* MEA_VALUE = (COUNTER1-COUNTER2); */ 1512 1 MEA_VALUE = (COUNTER1-COUNTER2); 1513 1 *UNIT = 13+"N"+0; 1514 1 1515 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1516 1 if (LOGGER_BYTE==0){ 1517 2 1518 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1519 2 1520 2 } 1521 1 1522 1 else{ 1523 2 1524 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1525 2 1526 2 } 1527 1 1528 1 } 1529 1530 void C_IPTN_MES (void){ 1531 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ - 1532 1 HELP20 = COUNTER2*65536+HELP2; C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 26 1533 1 1534 1 COUNTER2 = HELP20/(1-DTC*HELP20)/CMAFPB; 1535 1 1536 1 /* calculate the IP-therm. Neutrons in pieces */ 1537 1 /* MEA_VALUE = COUNTER2; */ 1538 1 MEA_VALUE = COUNTER2; 1539 1 *UNIT = 13+"N"+0; 1540 1 1541 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1542 1 if (LOGGER_BYTE==0){ 1543 2 1544 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1545 2 1546 2 } 1547 1 1548 1 else{ 1549 2 1550 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1551 2 1552 2 } 1553 1 1554 1 } 1555 void C_IPTF_MES (void){ 1556 1 /* calculate the correction for the dead-time of the tubes and the transmission-influence of the filter*/ 1557 1 HELP00 = COUNTER0*65536+HELP0; 1558 1 HELP10 = COUNTER1*65536+HELP1; 1559 1 HELP20 = COUNTER2*65536+HELP2; 1560 1 1561 1 COUNTER0 = HELP00/(1-DTC*HELP00); 1562 1 COUNTER1 = HELP10/(1-DTC*HELP10)/CMAFAL; 1563 1 COUNTER2 = HELP20/(1-DTC*HELP20)/CMAFPB; 1564 1 1565 1 /* calculate the IP-fast Neutrons in pieces */ 1566 1 /* MEA_VALUE = (COUNTER2-(COUNTER0-COUNTER1)*(1/2+1/100))) */ 1567 1 MEA_VALUE = (COUNTER2-(COUNTER0-COUNTER1)*51/100); 1568 1 *UNIT = 13+"N"+0; 1569 1 1570 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1571 1 if (LOGGER_BYTE==0){ 1572 2 1573 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1574 2 1575 2 } 1576 1 1577 1 else{ 1578 2 1579 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1580 2 1581 2 } 1582 1 1583 1 } 1584 1585 void C_IP0A_MES (void){ 1586 1 /* calculate the correction for the dead-time of the tubes */ 1587 1 HELP00 = COUNTER0*65536+HELP0; 1588 1 1589 1 COUNTER0 = HELP00/(1-DTC*HELP00); 1590 1 1591 1 /* calculate the IP-Alpha, single in pieces, if surly only Alpha-radiation */ 1592 1 /* MEA_VALUE = COUNTER0 */ 1593 1 MEA_VALUE = COUNTER0; 1594 1 *UNIT = 13,"N"+0; C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 27 1595 1 1596 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1597 1 if (LOGGER_BYTE==0){ 1598 2 1599 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1600 2 1601 2 } 1602 1 1603 1 else{ 1604 2 1605 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1606 2 1607 2 } 1608 1 1609 1 } 1610 1611 void C_IP0B_MES (void){ 1612 1 /* calculate the correction for the dead-time of the tubes */ 1613 1 HELP00 = COUNTER0*65536+HELP0; 1614 1 1615 1 COUNTER0 = HELP00/(1-DTC*HELP00); 1616 1 1617 1 /* calculate the IP-Beta + Gamma in pieces, if surly only Beta and Gamma-radiation */ 1618 1 /* MEA_VALUE = COUNTER0 */ 1619 1 MEA_VALUE = COUNTER0; 1620 1 *UNIT = 13+"N"+0; 1621 1 1622 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1623 1 if (LOGGER_BYTE==0){ 1624 2 1625 2 sprintf(*DSP_BUF0,"%f %s",VAL,*UNIT); 1626 2 1627 2 } 1628 1 1629 1 else{ 1630 2 1631 2 sprintf(*DSP_BUF0," %u %c %c %f %s",LOGGER_BYTE,". ",VAL,*UNIT); 1632 2 1633 2 } 1634 1 1635 1 } 1636 1637 void C_IP0N_MES (void){ 1638 1 /* calculate the correction for the dead-time of the tubes */ 1639 1 HELP20 = COUNTER2*65536+HELP2; 1640 1 1641 1 COUNTER2 = HELP20/(1-DTC*HELP20); 1642 1 1643 1 /* calculate the IP-Neutrons in pieces, if surly only Neutron-radiation */ 1644 1 /* MEA_VALUE = COUNTER2 / II0ALPB */ 1645 1 MEA_VALUE = COUNTER2/II0ALPB; 1646 1 *UNIT = 13+"N"+0; 1647 1 1648 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1649 1 if (LOGGER_BYTE==0){ 1650 2 1651 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1652 2 1653 2 } 1654 1 1655 1 else{ 1656 2 C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 28 1657 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1658 2 1659 2 } 1660 1 1661 1 } 1662 void C_ACTI_MES (void){ 1663 1 /* calculate the correction for the dead-time of the tubes */ 1664 1 COUNTER0 = MEA_FACTOR*COUNTER0/(1-DTC*COUNTER0); 1665 1 1666 1 /* calculate the over all activity in pieces -dN/dt*/ 1667 1 /* MEA_VALUE = COUNTER0 */ 1668 1 MEA_VALUE = COUNTER0; 1669 1 *UNIT = 13+"Becquerel"+0; 1670 1 1671 1 /* write to asm-buffer, without actually LOGGER-BYTE index or with */ 1672 1 if (LOGGER_BYTE==0){ 1673 2 1674 2 sprintf(*DSP_BUF0,"%u %s",ceil(MEA_VALUE),*UNIT); 1675 2 1676 2 } 1677 1 1678 1 else{ 1679 2 1680 2 sprintf(*DSP_BUF0," %u %c %c %u %s",LOGGER_BYTE,". ",ceil(MEA_VALUE),*UNIT); 1681 2 1682 2 } 1683 1 1684 1 } 1685 void C_ALARM (void){ 1686 1 if ((MEA_VALUE>0.125) && !ALARM_QUIT){ 1687 2 /* 0.125 Sv is the value, the user must return and leave the area the same way back, switch on alarm unt -il quitted */ 1688 2 #pragma asm 1689 2 1690 2 extrn bit (ALARM) 1691 2 extrn code (HOME,PUTSTRING,INPUTKEY,ALARM_MSG,R_S_KEY) 1692 2 extrn data (KEY) 1693 2 1694 2 CPL ALARM /* switch on alarm*/ 1695 2 CALL HOME 1696 2 MOV DPTR,#ALARM_MSG 1697 2 CALL PUTSTRING /* message to return now */ 1698 2 MOV A,KEY /* get last key pressed during measuring */ 1699 2 CJNE A,#R_S_KEY,C_ALARM_EX /* alarm not quitted (R_S_KEY equ 1) */ 1700 2 MOV A,#11111111B /* clear last key */ 1701 2 MOV KEY,A 1702 2 CPL ALARM /* alarm quitted, switch off */ 1703 2 MOV DPTR,#ALARM_QUIT 1704 2 MOV A,#1 1705 2 MOVX @DPTR,A /* set ALARM_QUIT, deleted by new measuring */ 1706 2 C_ALARM_EX: NOP /* quit in next round */ 1707 2 1708 2 #pragma endasm 1709 2 1710 2 } 1711 1 } MODULE INFORMATION: STATIC OVERLAYABLE CODE SIZE = 21621 ---- CONSTANT SIZE = 162 ---- XDATA SIZE = 51 ---- C51 COMPILER V8.16 MAIN_C 11/16/2008 01:28:12 PAGE 29 PDATA SIZE = ---- ---- DATA SIZE = ---- ---- IDATA SIZE = ---- ---- BIT SIZE = ---- ---- END OF MODULE INFORMATION. C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)