From: hadaq Date: Wed, 27 Mar 2019 12:23:34 +0000 (+0100) Subject: EventRate is transmitted to EPICS X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=e2dd3c36be674797ebe9d359baf9ac7d44ed9acb;p=hadesdaq.git EventRate is transmitted to EPICS --- diff --git a/hmon/1 b/hmon/1 deleted file mode 100644 index 14ddd84..0000000 Binary files a/hmon/1 and /dev/null differ diff --git a/hmon/hmon_spill.pl b/hmon/hmon_spill.pl index cf6acb9..c25f882 100755 --- a/hmon/hmon_spill.pl +++ b/hmon/hmon_spill.pl @@ -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 index 9ae4030..0000000 --- a/hmon/permanent/1 +++ /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 - - - -