]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
EventRate is transmitted to EPICS
authorhadaq <jan@lxhadeb07>
Wed, 27 Mar 2019 12:23:34 +0000 (13:23 +0100)
committerhadaq <jan@lxhadeb07>
Wed, 27 Mar 2019 12:23:34 +0000 (13:23 +0100)
hmon/1 [deleted file]
hmon/hmon_spill.pl
hmon/permanent/1 [deleted file]

diff --git a/hmon/1 b/hmon/1
deleted file mode 100644 (file)
index 14ddd84..0000000
Binary files a/hmon/1 and /dev/null differ
index cf6acb98385d414a1cad7f775a74431d31745d6d..c25f8829f023767cd9f7b3c9acb35515005a8815 100755 (executable)
@@ -9,7 +9,7 @@ use Hmon;
 use QA;
 use HADES::TrbNet;
 use HPlot;
-#use Perl2Epics;
+use Perl2Epics;
 use LWP::Simple;
 
 my $opt_debug = 0;
@@ -57,6 +57,8 @@ trb_init_ports() or die trb_strerror();
 my $masterurl = 'http://lxhadeb07:8099/';
 my $url_prefix =    $masterurl . 'Master/BNET/RunPrefix/get.json?field="value"';
 
+Perl2Epics::Connect("Rate", "HAD:DAQ:EventRate");
+
 
 my $spillcount = 0;
 while (1) {
@@ -122,17 +124,17 @@ while (1) {
                              QA::SciNotation($spillavgshort),
                              QA::SciNotation($spillavglong),
                              $spilllength);
-           QA::WriteQALog($fqa,"trg", "spill", 50, $qastate, "Spill Sum",
+           QA::WriteQALog($fqa,"trg", "spill", 30, $qastate, "Spill Sum",
                           $qashort, $qalong) unless $opt_debug>0;
             HPlot::PlotAdd("EvtsPerSpill",$events/1E3) unless $opt_debug>0;
             HPlot::PlotDraw("EvtsPerSpill")  unless $opt_debug>0;
            $events = 0;
            $spilllength = 0;
-       } elsif ($spilllength > 30) {
-              QA::WriteQALog($fqa, "trg", "spill", 50, QA::NOTE, "Spill Sum",
+       } elsif ($spilllength > 20) {
+              QA::WriteQALog($fqa, "trg", "spill", 30, QA::NOTE, "Spill Sum",
                           "No Spills", "No Spills detected at the moment") unless $opt_debug>0;;  
             #print $spilllength."\n" unless $spilllength%10;
-            if($spilllength >= 30 && ($spilllength%30 == 0)) {
+            if($spilllength >= 25 && ($spilllength%25 == 0)) {
              # my $data = Perl2Epics::GetAll();
              # print STDERR $data->{'prefix'}->{val}."\n";
 #               if(($data->{'prefix'}->{val} eq '-1') || ($data->{'prefix'}->{val} eq 'be')) {
@@ -166,6 +168,7 @@ while (1) {
        $qastate = QA::WARN if $evtrate == 1;
        $qastate = QA::WARN_2 if $stopped;
        
+       Hmon::Speak('rate', "Data Acquisition does not work") if $qastate == QA::FATAL;
        $qalong = sprintf("current: %i Events/second", $evtrate);
        QA::WriteQALog($fqa, "main", "rate", 5, $qastate, "Current Rate",
                       $qashort, $qalong) unless $opt_debug>0;
@@ -183,6 +186,10 @@ while (1) {
        $lastspillcount = $spillcount;         
        $lastres = $res;
        print "debug: short:$qashort long:$qalong, spillcount:$spillcount\n" unless $opt_debug==0;
+
+        Perl2Epics::Put("Rate",$evtrate);
+        my $dataRate = Perl2Epics::GetAll();
+
        usleep(500000);
        
     } else {
diff --git a/hmon/permanent/1 b/hmon/permanent/1
deleted file mode 100644 (file)
index 9ae4030..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-gnuplot> set out "files/RichIsobO2tmp.png"
-                                          ^
-         line 0:          cannot open file; output not changed
-system error: No such file or directory
-
-
-y
-
-
-
-