]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
latest changes to hmon windows
authorhadaq@countinghouse <hadaq@CountingHouse>
Fri, 15 Aug 2014 09:07:47 +0000 (11:07 +0200)
committerhadaq@countinghouse <hadaq@CountingHouse>
Fri, 15 Aug 2014 09:07:47 +0000 (11:07 +0200)
16 files changed:
hmon/HPlot.pm
hmon/Hmon.pm
hmon/QA.pm
hmon/doc/mdc-blocked.htt
hmon/hmon_eventrate.pl
hmon/hmon_hadplotnew.sh
hmon/hmon_hodo_hist.pl
hmon/hmon_mdc_invaliddatamode.pl [changed mode: 0755->0644]
hmon/hmon_mdc_temp.pl
hmon/hmon_pionpileup.pl
hmon/hmon_pionts.pl
hmon/permanent/hmon_archiver.pl [changed mode: 0755->0644]
hmon/permanent/hmon_logfile.pl
hmon/permanent/hmon_magnet.pl
hmon/permanent/hmon_mdchv.pl
hmon/permanent/hmon_mdcpressure.pl

index 4859b47fa3d60cbb097d5e14ae57c71fc499183e..26093da9fde83db5c4c220702b83cb40644a41f6 100755 (executable)
@@ -206,7 +206,7 @@ sub PlotDraw {
           plot_write($p->{$name}->{fh},($i/$p->{$name}->{xscale})." ".$p->{$name}->{value}->[$j]->[$i]);
           }
         else {
-          plot_write($p->{$name}->{fh},(($i-$p->{$name}->{entries})/$p->{$name}->{xscale})." ".$p->{$name}->{value}->[$j]->[$i]);
+          plot_write($p->{$name}->{fh},(($i-$p->{$name}->{entries})/($p->{$name}->{xscale}||1))." ".($p->{$name}->{value}->[$j]->[$i]||0));
           }
         }
       plot_write($p->{$name}->{fh},"e");
index b5e69364b531fb770f0baee349ecf6d3d948af4b..e7a0b213826b6af8933eedc5ff8d7b5684b88725 100644 (file)
@@ -3,7 +3,7 @@ use POSIX qw/floor ceil strftime/;
 use Data::Dumper;
 use warnings;
 use strict;
-
+use Mail::Sendmail;
 use constant HMONDIR => "/home/hadaq/trbsoft/hadesdaq/hmon/";
 
 our %hublist;
@@ -111,6 +111,26 @@ sub Speak {
     }
   }
 
+
+sub SendEmail {
+    my ($to,$title,$msg) = @_;
+    my %mail = (
+        'To'      => $to,
+        'From'    => 'hmon@gsi.de',
+        'Subject' => "$title",
+        'Message' => $msg,
+        'smtp'    => "smtp.gsi.de"
+        );
+
+    sendmail(%mail) ;
+    system("logger -p local1.info -t DAQ 'Sent mail to ".$to." with content ".$msg."'");
+    print "OK. Log says:\n" .  $Mail::Sendmail::log . "\n";
+
+
+  }
+
+
+
 ###############################################################################
 #  Calculate Colors
 ###############################################################################
index 957ca2f8245c73ecff12a81d121754a182f8ae07..d05ee3bb377628c898d2890a0a7132d9b0460631 100644 (file)
@@ -68,7 +68,7 @@ our @FeeErrLimits     = (0, 5, 10);
 our @MdcOepLimits     = (372, 372-1, 372-3);
 our @MdcVoltageLimits = (50, 60, 100);
 our @MdcLockLimits    = (0, 3, 5);
-our @MdcTempLimits    = (78, 85, 90);
+our @MdcTempLimits    = (75, 80, 85);
 our @TrgErrLimits     = (100, 1000, 10000);
 our @CPULimits        = (95, 100, 100);
 our @TimeoutLimits    = (0, 0, 1);
@@ -82,6 +82,8 @@ our @EBDeltaRateLimits = (10, 15, 25);
 our $TrgCheckPolarity = 1;
 our @Eventsbroken     = (.5,5,10);
 our @MdcTokenMissLimits = (10,50,100);
+our @MdcNominalHV = (1750,1770,1500,1700);
+our @MdcHVOffsetLimits = (5,10,20);
 
 our @PionLvCurrLimits = (4,5,6);
 
index 6dd31b08a483d8d0812a227bb7247c412eb770b2..8e53125df7b37f2add9a6aa37fb1ed0a6cc596fe 100644 (file)
@@ -5,7 +5,8 @@ more than 1000 Hz).
 
 </p>
 <h4>Error Handling</h4>
-Check with the MDC operator if high voltage is on on all chambers. 
+Check with the MDC operator if high voltage is on on all chambers (without HV there is no data...). 
+Ignore, if no real data is taken and a pulser is running.
 <br>Do a DAQ restart.
 <br>Do a power-cycle of the corresponding MDC chamber.
 
index bf457923c273ec6745e861f3e10ebd62e8a9a00c..c9d10267bdeede006c34bf8232fd3ace51daa689 100755 (executable)
@@ -27,15 +27,15 @@ Hmon::WriteFile("eventrateshort",$str);
 
 my $f = fork();
 if($f) {
-  qx(./hmon_hadplotnew.sh -d 50 -o 20 -n 1200 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehist.700.365" eventrate);
+  qx(./hmon_hadplotnew.sh -d 50 -o 20 -n 1200 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehist.700.365" eventrate 1>/dev/null 2>/dev/null);
   }
 else {
   my $g = fork();
   if($g) {
-    qx(./hmon_hadplotnew.sh -d 400 -o 5 -n 1500 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehistlong.700.315" eventrate);
+    qx(./hmon_hadplotnew.sh -d 400 -o 5 -n 1500 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehistlong.700.315" eventrate 1>/dev/null 2>/dev/null);
     }
   else{
-    qx(./hmon_hadplotnew.sh -d 10 -o 50 -n 1000 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehistshort.700.365" eventrate);
+    qx(./hmon_hadplotnew.sh -d 10 -o 50 -n 1000 -yscale 1000 -yoverflow 65.536 -ytitle "Event Rate [kHz]" -xtitle "" -output "PNG.files/eventratehistshort.700.365" eventrate 1>/dev/null 2>/dev/null);
     }
   }
 
index 19b36002d325e9aa22c42b5a6ec7bbf96060d622..37da618b7db36537ca0915881dd92ac965a98810 100755 (executable)
@@ -72,7 +72,7 @@ my $plotoption= ""; #string with additional gnuplot commands
 my $curveoption= []; #options for plot command
 my $xgrid     = 1;
 my $ygrid     = 1;
-my $ymax;
+my $ymax      = '.01<*';
 my $ymin;
 my $xmin;
 my $xmax;
@@ -105,10 +105,10 @@ GetOptions('d=f' => \$delay,
            'yticks!'      => \$yticks,
            'xgrid!'       => \$xgrid,
            'ygrid!'       => \$ygrid,
-           'ymax=i'       => \$ymax,
-           'ymin=i'       => \$ymin,
-           'xmax=i'       => \$xmax,
-           'xmin=i'       => \$xmin,           
+           'ymax=s'       => \$ymax,
+           'ymin=s'       => \$ymin,
+           'xmax=s'       => \$xmax,
+           'xmin=s'       => \$xmin,           
            'curvestyle=s' => \$curvestyle,
            'curveoption=s'=> $curveoption,
            'plotoption=s' => \$plotoption
index c6a802062e0f4d91f0aae5f7964d93cae00e9679..e6fead94eec8c753e781ca3e8aa5293db3583a16 100755 (executable)
@@ -289,14 +289,14 @@ while (1) {
     my $total = 0;
     for my $bar (0..3) {
       for my $x (0..1) {
-        $sum[$bar/2]   += $diff->{0x5013}->[$bar*4+1+$x*16];
-        $total         += $diff->{0x5013}->[$bar*4+1+$x*16];
-        $sum[$bar/2+2] += $diff->{0x5012}->[$bar*4+1+$x*16];
-        $total         += $diff->{0x5012}->[$bar*4+1+$x*16];
-        $sum[$bar/2+4] += $diff->{0x5011}->[$bar*4+1+$x*16];
-        $total         += $diff->{0x5011}->[$bar*4+1+$x*16];
-        $sum[$bar/2+6] += $diff->{0x5010}->[$bar*4+1+$x*16];
-        $total         += $diff->{0x5010}->[$bar*4+1+$x*16];
+        $sum[$bar/2]   += ($diff->{0x5013}->[$bar*4+1+$x*16]||0);
+        $total         += ($diff->{0x5013}->[$bar*4+1+$x*16]||0);
+        $sum[$bar/2+2] += ($diff->{0x5012}->[$bar*4+1+$x*16]||0);
+        $total         += ($diff->{0x5012}->[$bar*4+1+$x*16]||0);
+        $sum[$bar/2+4] += ($diff->{0x5011}->[$bar*4+1+$x*16]||0);
+        $total         += ($diff->{0x5011}->[$bar*4+1+$x*16]||0);
+        $sum[$bar/2+6] += ($diff->{0x5010}->[$bar*4+1+$x*16]||0);
+        $total         += ($diff->{0x5010}->[$bar*4+1+$x*16]||0);
         }
       }
     for my $i (0..7) {  
@@ -309,7 +309,7 @@ while (1) {
     for my $f (0..3) {
       next if ($f == 1);
       for my $s (0..15) {
-        $totalstart += $diff->{0x5000+$f}->[$s*2+1];
+        $totalstart += ($diff->{0x5000+$f}->[$s*2+1]||0);
         }
       }
 #     print $totalstart;
old mode 100755 (executable)
new mode 100644 (file)
index 87e9f1aa88935164c29ce6d6638f2369286d1c6d..c00d5530107645d0feada4841b83bf575a359197 100755 (executable)
@@ -27,6 +27,7 @@ my ($max,$min,$avg,$mean);
 
 trb_init_ports() or die trb_strerror();
 
+Perl2Epics::Connect("TempP2S","HAD:MDC:P2:S1:M1:temp");
 
 while (1) {
   my $rh_mdc_temp;
index 66dbc2f2885bd040448af25ade8edfda12b85be3..385584bc42b4599e1af83889c7096b646a02c07f 100755 (executable)
@@ -116,10 +116,10 @@ if($plots) {
        sleep(5);
     }
 } else { 
-    qx(./hmon_hadplotnew.sh -d 1000 -a 0x3800 -r 0x8900 -m 128 -w 32 -p 0  -t "Y Channels" -key -xtitle "DOWN (-5cm)                                                                      UP (5cm)" -output "PNG.files/Pion1XPileup.700.265" regdiff >/dev/null &
-     ./hmon_hadplotnew.sh -d 1000 -a 0x3801 -r 0x8900 -m 128 -w 32 -p 0  -t "X Channels" -key -xtitle "RIGHT (-5cm)                                                                  LEFT (5cm)" -output "PNG.files/Pion1YPileup.700.265" regdiff >/dev/null &
-     ./hmon_hadplotnew.sh -d 1000 -a 0x3810 -r 0x8900 -m 128 -w 32 -p 0  -t "Y Channels" -key -xtitle "DOWN (-5cm)                                                                      UP (5cm)" -output "PNG.files/Pion2XPileup.700.265" regdiff >/dev/null &
-     ./hmon_hadplotnew.sh -d 1000 -a 0x3811 -r 0x8900 -m 128 -w 32 -p 0  -t "X Channels" -key -xtitle "RIGHT (-5cm)                                                                  LEFT (5cm)" -output "PNG.files/Pion2YPileup.700.265" regdiff >/dev/null &);
+    qx(./hmon_hadplotnew.sh -d 1000 -a 0x3800 -r 0x8900 -m 128 -w 32 -p 0  -t "Y Channels" -key -xtitle "DOWN (-5cm)                                                                      UP (5cm)" -output "PNG.files/Pion1XPileup.700.265" regdiff >/dev/null 2>/dev/null &
+     ./hmon_hadplotnew.sh -d 1000 -a 0x3801 -r 0x8900 -m 128 -w 32 -p 0  -t "X Channels" -key -xtitle "RIGHT (-5cm)                                                                  LEFT (5cm)" -output "PNG.files/Pion1YPileup.700.265" regdiff >/dev/null 2>/dev/null &
+     ./hmon_hadplotnew.sh -d 1000 -a 0x3810 -r 0x8900 -m 128 -w 32 -p 0  -t "Y Channels" -key -xtitle "DOWN (-5cm)                                                                      UP (5cm)" -output "PNG.files/Pion2XPileup.700.265" regdiff >/dev/null 2>/dev/null &
+     ./hmon_hadplotnew.sh -d 1000 -a 0x3811 -r 0x8900 -m 128 -w 32 -p 0  -t "X Channels" -key -xtitle "RIGHT (-5cm)                                                                  LEFT (5cm)" -output "PNG.files/Pion2YPileup.700.265" regdiff >/dev/null  2>/dev/null &);
 }
 
 
index 042b29d58823ff1e838bc0e17b984d66a4cf679d..a85e275c049582ff1cd2fe0638cf23388e18ca21 100755 (executable)
@@ -117,10 +117,10 @@ if($plots) {
        sleep(5);
     }
 } else { 
-    qx(./hmon_hadplotnew.sh -d 1000 -a 0x3800 -r 0x8c00 -m 512 -w 32 -p 0  -t "Y Timestamps" -key -output "PNG.files/Pion1YTS.700.265" regdiff >/dev/null &
-     ./hmon_hadplotnew.sh -d 1000 -a 0x3801 -r 0x8c00 -m 512 -w 32 -p 0  -t "X Timestamps" -key -output "PNG.files/Pion1XTS.700.265" regdiff >/dev/null &
-     ./hmon_hadplotnew.sh -d 1000 -a 0x3810 -r 0x8c00 -m 512 -w 32 -p 0  -t "Y Timestamps" -key -output "PNG.files/Pion2YTS.700.265" regdiff >/dev/null &
-     ./hmon_hadplotnew.sh -d 1000 -a 0x3811 -r 0x8c00 -m 512 -w 32 -p 0  -t "X Timestamps" -key -output "PNG.files/Pion2XTS.700.265" regdiff >/dev/null &);
+    qx(./hmon_hadplotnew.sh -d 1000 -a 0x3800 -r 0x8c00 -m 512 -w 32 -p 0 -ymin "0" -ymax "2<*" -t "Y Timestamps" -key -output "PNG.files/Pion1YTS.700.265" regdiff 2>/dev/null >/dev/null &
+     ./hmon_hadplotnew.sh -d 1000 -a 0x3801 -r 0x8c00 -m 512 -w 32 -p 0  -ymin "0" -ymax "2<*"  -t "X Timestamps" -key -output "PNG.files/Pion1XTS.700.265" regdiff 2>/dev/null >/dev/null &
+     ./hmon_hadplotnew.sh -d 1000 -a 0x3810 -r 0x8c00 -m 512 -w 32 -p 0   -ymin "0" -ymax "2<*" -t "Y Timestamps" -key -output "PNG.files/Pion2YTS.700.265" regdiff 2>/dev/null >/dev/null &
+     ./hmon_hadplotnew.sh -d 1000 -a 0x3811 -r 0x8c00 -m 512 -w 32 -p 0  -ymin "0" -ymax "2<*"  -t "X Timestamps" -key -output "PNG.files/Pion2XTS.700.265" regdiff 2>/dev/null >/dev/null &);
 }
 
 
old mode 100755 (executable)
new mode 100644 (file)
index a3e3601baa66208439c8786b54f8c7e92e05ca52..f2e70267b9492de9582a76f22c6b876e4d166765 100755 (executable)
@@ -28,13 +28,30 @@ while(my $a = <FTRB>) {
     next if ($a =~ /discarded events: (\w+)/);# && $1 < 30);
     next if ($a =~ /opened connection to Data Mover/);
     }
-  next if ($a =~ /30 boards complain: Event not found: 3000/);
+  if ($a =~ m/(DABC)/) {
+    next if ($a =~ /Start/);
+    next if ($a =~ /Application/);
+    next if ($a =~ /Set/);
+    next if ($a =~ /CTRL/);
+    next if ($a =~ /Ctrl/);
+    next if ($a =~ /flushing/);
+    next if ($a =~ /open/);
+    next if ($a =~ /base/);
+    next if ($a =~ /plugins/);
+    next if ($a =~ /Worker/); 
+    next if ($a =~ /Create/); 
+    next if ($a =~ /datamover/); 
+    next if ($a =~ /Transmitter/);
+    next if ($a =~ /HADAQ/);
+    next if ($a =~ /DropAllInputBuffers/);
+    } 
+ next if ($a =~ /30 boards complain: Event not found: 3000/);
         next if ($a =~ /30 boards complain: frontend not configured: 3000/);
         next if ($a =~ /30 boards complain: error: 3000/);
         next if ($a =~ /30 boards complain: serious error: 3000/);
         $a =~ s/3000 3001 3002 3003 3004 3010 3011 3012 3013 3014 3020 3021 3022 3023 3024 3030 3031 3032 3033 3034 3040 3041 3042 3043 3044 3050 3051 3052 3053 3054/RICH, /;
         $a =~ s/0x2000 0x2001 0x2002 0x2003 0x2004 0x2005 0x2006 0x2007 0x2008 0x2009 0x200a 0x200b 0x200c 0x200d 0x2010 0x2011 0x2012 0x2013 0x2014 0x2015 0x2016 0x2017 0x2018 0x2019 0x201a 0x201b 0x201c 0x201d 0x2020 0x2021 0x2022 0x2023 0x2024 0x2025 0x2026 0x2027 0x2028 0x2029 0x202a 0x202b 0x202c 0x202d 0x2030 0x2031 0x2032 0x2033 0x2034 0x2035 0x2036 0x2037 0x2038 0x2039 0x203a 0x203b 0x203c 0x203d 0x2040 0x2041 0x2042 0x2043 0x2044 0x2045 0x2046 0x2047 0x2048 0x2049 0x204a 0x204b 0x204c 0x204d 0x2050 0x2051 0x2052 0x2053 0x2054 0x2055 0x2056 0x2057 0x2058 0x2059 0x205a 0x205b 0x205c 0x205d 0x2100 0x2101 0x2102 0x2103 0x2104 0x2105 0x2106 0x2107 0x2108 0x2109 0x210a 0x210b 0x210c 0x210d 0x210e 0x210f 0x2110 0x2111 0x2112 0x2113 0x2114 0x2115 0x2116 0x2117 0x2118 0x2119 0x211a 0x211b 0x211c 0x211d 0x211e 0x211f 0x2120 0x2121 0x2122 0x2123 0x2124 0x2125 0x2126 0x2127 0x2128 0x2129 0x212a 0x212b 0x212c 0x212d 0x212e 0x212f 0x2130 0x2131 0x2132 0x2133 0x2134 0x2135 0x2136 0x2137 0x2138 0x2139 0x213a 0x213b/MDC missing/;
-  if (($month,$day,$time,$PC,$who,$level,$message) = $a =~ m/(\w+)\s+(\d+)\s+(\d\d:\d\d:\d\d)\s+(\w+)\s+\w+.?\w?.?:\s+(\w+-?\d?\d?)\s+.(\w).\s+(.*)/) {
+  if (($month,$day,$time,$PC,$who,$level,$message) = $a =~ m/(\w+)\s+(\d+)\s+(\d\d:\d\d:\d\d)\s+(\w+)\s+\w+.?\w?.?:\s+(\w+-?\w?\w?-?\d?\d?)\s+.(\w).\s+(.*)/) {
 
     $msg = "";
     $msg .= sprintf("\n<tr><td>%s.%s.&nbsp;&nbsp;%s<td>%s<td ",$day,$month,$time,$who);
index 052b767cd4322bfeac1acdcc4580b53f5db67509..da501fdd7a97f289b44d84cfa1ed92851f630f30 100755 (executable)
@@ -9,7 +9,7 @@ use QA;
 use Getopt::Long;
 use Data::Dumper;
 
-my $magnet_on = 1;
+my $magnet_on = 0;
 
 my %range_list = (
                  'Time'             => {},
index f6384e689485d05c0d5198c9fa505a9c8e4a54c3..aa859ae93803d533e149ef036b2e7c2ddf2c2285 100755 (executable)
@@ -6,6 +6,7 @@ use POSIX qw(strftime);
 use FileHandle;
 use Data::Dumper;
 use POSIX qw/floor ceil/;
+use List::Util qw(min max);
 use Hmon;
 use QA;
 use Perl2Epics;
@@ -21,11 +22,12 @@ if(!$connect_status) {
   die("could not connect to trbnetd");
 }
 
+
 ###########
 #Change 3 for-loops to include all four planes again!
 ############
 
-# my $fqa = QA::OpenQAFile();
+my $flog = QA::OpenQAFile();
 my @plot;
 foreach my $s (0..1) {
   foreach my $p (0..3) {
@@ -128,6 +130,35 @@ while(1) {
         }
       }
     }
+    
+  my @mdcHvMin;
+  my @mdcHvMax;
+  my $qastate = QA::OK;
+  for my $p (1..4) {
+    for my $s (1..6) {
+      for my $i (0..1) {
+        my $volt = $data->{"$p-$s-$i-V"}->{val};
+        if(! defined $mdcHvMin[$p] || $mdcHvMin[$p] > $volt) {
+          $mdcHvMin[$p] = $volt;
+          }
+        if(! defined $mdcHvMax[$p] || $mdcHvMax[$p] < $volt) {
+          $mdcHvMax[$p] = $volt;
+          }
+        }
+      }
+    if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits[0]) {$qastate = max($qastate,QA::WARN);}
+    if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits[1]) {$qastate = max($qastate,QA::WARN_2);}
+    if($mdcHvMax[$p] > $QA::MdcNominalHV[$p-1] + $QA::MdcHVOffsetLimits[2]) {$qastate = max($qastate,QA::ERROR);}
+    if($mdcHvMin[$p] < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits[0]) {$qastate = max($qastate,QA::WARN);}
+    if($mdcHvMin[$p] < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits[1]) {$qastate = max($qastate,QA::WARN_2);}
+    if($mdcHvMin[$p] < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits[2]) {$qastate = max($qastate,QA::ERROR);}
+    }
+    
+  my $value    = sprintf("%.1f/%.1f/%.1f/%.1f",$mdcHvMin[1]/1000.,$mdcHvMin[2]/1000.,$mdcHvMin[3]/1000.,$mdcHvMin[4]/1000.);
+  my $longtext = "MDC high voltage in all four planes".
+                 "<br>Minimum [V]: ".$mdcHvMin[1]." / ".$mdcHvMin[2]." / ".$mdcHvMin[3]." / ".$mdcHvMin[4].
+                 "<br>Maximum [V]: ".$mdcHvMax[1]." / ".$mdcHvMax[2]." / ".$mdcHvMax[3]." / ".$mdcHvMax[4];
+  QA::WriteQALog($flog,"other","mdcinvalid",10,$qastate,"MDC HV",$value,$longtext);  
   $timer++;
   sleep(1);
   }
index 29456b31d1c9ca532f742d6f75398766c5388fe9..1203bedc3e977cbc8b14f2fcb15fbf0bd02c7743 100755 (executable)
@@ -12,12 +12,18 @@ use Perl2Epics;
 use HPlot;
 
 
-my @names = qw( reflowPressureAthm:average reflowPressureCompr reflowInO2 reflowRatioIsob opensysFreshARGON opensysFreshCO2 reflowFreshArgon reflowFreshIsob pipePressureIsoB );
-my @namesLABEL = qw( AtmosphericPressure reflowPressureCompressor reflow_O2_concentration reflow_Isobutane_fraction planeI_argon planeI_CO2 reflowFreshArgon reflowFreshIsobutane pipePressureIsobutane );
+my @names = qw( reflowPressureAthm:average reflowPressureCompr reflowInO2 reflowRatioIsob opensysFreshARGON 
+opensysFreshCO2 reflowFreshArgon reflowFreshIsob pipePressureIsoB CO2:concentration CO2:concentration2 reflowPressureLP);
+my @namesLABEL = qw( AtmosphericPressure reflowPressureCompressor reflow_O2_concentration 
+reflow_Isobutane_fraction planeI_argon_fresh planeI_CO2_frsh reflowFreshArgon reflowFreshIsobutane pipePressureIsobutane  CO2-P1 CO2-P2 LP-pressure);
 my @names2 = qw(waage_1_net waage_2_net);
 my @names2LABEL = qw(Scale_1 Scale_2);
 my @names3 = qw(targetVakPressure);
 
+my $presserr = 0;
+my $presserrtimer = 0;
+
+
 my $plot = ();
 $plot->{name}    = "AtmosPress";
 $plot->{file}    = "files/AtmosPress";
@@ -165,7 +171,7 @@ my $timer = 0;
 for(my $i = 1; $i<=3; $i++) {
   for(my $j = 1; $j<=6; $j++) {
     my $s = sprintf("HAD:MDC:P%i:S%i:p_delta",$i,$j);
-    Perl2Epics::Connect("p$i$j",$s);
+    Perl2Epics::Connect("p$i$j",$s);x
     }
   }
 foreach my $n (@names) {
@@ -178,7 +184,8 @@ foreach my $n (@names2) {
   Perl2Epics::Connect($n,"HAD:".$n);
   }
 Perl2Epics::Connect("reflowPressureAthmaverage","HAD:MDC:GAS:reflowPressureAthm:average");
-  
+Perl2Epics::Connect("p1CO2","HAD:MDC:GAS:CO2:concentration:average");
+Perl2Epics::Connect("p2CO2","HAD:MDC:GAS:CO2:concentration2:average");
 print "Connected.\n";
 
 while(1) {
@@ -249,7 +256,42 @@ while(1) {
         }
       }
     }
-      
+
+
+#      if($data->{"p1CO2"}->{val} < 20 || $data->{"p1CO2"}->{val} > 40   ) {
+#      $presserr++;
+#      }
+    
+  for my $i (1..3) {
+   for my $j (1..6) { 
+    if($data->{"p$i$j"}->{val} > 50 ) {
+       $presserr++;
+       }
+    }
+   }
+  if($presserr >= 3) {
+    if($presserrtimer == 0) { 
+      $presserr = 0;
+      my $valstr = "";
+        $valstr.="CO2 concentration Plane1: ".$data->{"p1CO2"}->{val}." %  \n";
+        $valstr.="CO2 concentration Plane2: ".$data->{"p2CO2"}->{val}." %  \n";
+      for my $i (1..3) {
+       for my $j (1..6) {
+        $valstr.="P$i S$j: ".$data->{"p$i$j"}->{val}."\n";
+        }
+       }
+      $presserrtimer = 90;
+      Hmon::SendEmail('c.wendisch@gsi.de',"Warning: MDC Over-Pressure","Pressures in MDC are too high:  \n$valstr");
+      }
+    else {
+      $presserrtimer--;
+      }
+    }
+
+    
   $timer++;
   sleep(10);
   }
+
+
+