]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
update many hmon scripts
authorhadaq <jan@lxhadeb07>
Wed, 10 Jan 2024 14:00:29 +0000 (15:00 +0100)
committerhadaq <jan@lxhadeb07>
Wed, 10 Jan 2024 14:00:29 +0000 (15:00 +0100)
40 files changed:
hmon/QA.pm
hmon/doc/endp-mdc.htt
hmon/doc/misc-valve.htt
hmon/hmon_adcvolt.pl
hmon/hmon_ecal_recover_dead_slow_channels.pl [changed mode: 0755->0644]
hmon/hmon_ecalresetthresholds.pl
hmon/hmon_endpoints.pl
hmon/hmon_fwrate.pl
hmon/hmon_hodo_beamMonitoring.pl [changed mode: 0755->0644]
hmon/hmon_onlineqa.pl
hmon/hmon_padiwatemp_ecal.pl
hmon/hmon_readoutstuck.pl
hmon/hmon_rich_temp_backplane.pl
hmon/hmon_startratesimple.pl
hmon/hmon_timeout.pl
hmon/hmon_triggerratio.pl
hmon/index.cgi
hmon/monitor.cgi
hmon/permanent/hmon_beamabort.pl
hmon/permanent/hmon_caveTemp.pl
hmon/permanent/hmon_cpu.pl
hmon/permanent/hmon_eb_run.pl
hmon/permanent/hmon_ebdiskfill.pl
hmon/permanent/hmon_ecalhv.pl
hmon/permanent/hmon_fwhv.pl
hmon/permanent/hmon_mdcpressure.pl
hmon/permanent/hmon_open_ssh_master_channels.pl
hmon/permanent/hmon_qaplots.pl
hmon/permanent/hmon_richhv.pl
hmon/permanent/hmon_sequencer.pl
hmon/permanent/hmon_spillmon.pl
hmon/permanent/hmon_tdcchanerrors_testmonitor.pl [changed mode: 0755->0644]
hmon/speakdaemon.pl
hmon/speakdaemon_mdc.pl
hmon/start.sh
hmon/stop.sh
hmon/stopall.sh
hmon/styles.css
nettools/Perl2Epics.pm
nettools/Perl2Epics2.pm [new file with mode: 0644]

index c17b7437982b8ac83bfadd07346a4b6c44af909f..9409b0687afc9014ed85279f4355d480d8a0895e 100644 (file)
@@ -114,7 +114,7 @@ our @MdcTokenMissLimits = (10,50,100);
 # Modification of 8.Feb2022 P2S3 supplied by different HV channels, so taken out here:
 our $MdcNominalHV = [[1750,1750,1750,1750,1750,1750],[1770,1790,0,1770,1770,1770],[1900,1900,1900,1900,1900,1900],[2150,2150,2150,2150,2150,2150]];
 our $MdcHVOffsetLimits = [[5,10,255],[5,30,255],[5,10,255],[10,110,325]];
-our @EcalHvLimits = (493,325,320);
+our @EcalHvLimits = (1000,990,950);
 our @RpcHvLimits = (12,12,12);
 our @TofHvLimits = (764,760,759);
 our @FwHvLimits = (280,250,200);
@@ -128,7 +128,7 @@ our @PionLvCurrLimits = (4,5,6);
 
 
 our $PadiwaEcalNumber = 126;
-our @PadiwaEcalLimits    = (3, 5, 8);
+our @PadiwaEcalLimits    = (0, 5, 8);
 
 our $PadiwaItofNumber = 18;
 our @PadiwaItofLimits    = (0, 0, 0);
index d9cd0ef0d1459bc39f2caaa5806dd7ad4d25d2fa..fe1ff2616a5d4b16a34e3b776b3ffdf3e95f7176 100644 (file)
@@ -7,7 +7,7 @@ missing or two boards in the same chamber are missing or few boards are missing
 <h4>Error Handling</h4>
 <ul>
 <li>Do a DAQ restart. 
-<li>If the same board shows an error after DAQ restart several times, do a power-cycle of the corresponding sector
+<li>If the same board shows an error directly after DAQ restart several times, do a power-cycle of the corresponding sector
 <li>If this doesn't help, use "Reboot MdcHub" plus 2 DAQ restarts.
 <li>If the missing boards include a hub (0x1___) and a restart doesn't help, a power cycle of MDC Hubs might be needed.
 <li>If 14/16 boards show an error after a power-cycle, click "MDC LV Turn On ALL Relais". You can 
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..257cf865b2ca1748e333856c1819941dbbf4b691 100644 (file)
@@ -0,0 +1,3 @@
+Monitor for the vacuum in the beam pipe and the status of the valve separating HADES from the accelerator.
+If the valve fails (closes) it will be a very good target for the beam - beam abort should might trigger.
+<p>Problems with the vacuum and the valve need to be solved manually inside the cave.
index db0d70663ce8659871977be5d0b4fa4a37bc74fd..59a041ca872bcb0f6a0e39dd095adc876c41c834 100755 (executable)
@@ -196,8 +196,8 @@ sub measure {
 while(1) {
 
   my $ret;
-#  my $EPICS_data = Perl2Epics::GetAll();
-  my $EPICS_data;
+  my $EPICS_data = Perl2Epics::GetAll(5);
+#  my $EPICS_data;
 
 #   foreach my $a (@{$config{AdcTrb3sc}}) {
 #     $ret->[0] = measure($a,0);
@@ -385,6 +385,6 @@ while(1) {
   close $fh;
               
               
-  sleep 10;
+  sleep 5;
 }
   
old mode 100755 (executable)
new mode 100644 (file)
index 8f50c504472c69ffc8830cb71861b813374efdde..824cda13bc8e9f4cb8a8b6aed2f03e18102c8bf2 100644 (file)
@@ -9,7 +9,7 @@ use HADES::TrbNet;
 use POSIX qw(strftime);
 my $fh;
 
-  
+#set thresholds after every other spill  
 trb_init_ports() or die trb_strerror();
 my $inspill;
 while (1) {
@@ -22,7 +22,7 @@ while (1) {
 
   system ("/home/hadaq/trbsoft/daq/ecal/ecal_set_thresholds.pl");
 
-#  system ("/home/hadaq/trbsoft/daq/ecal/ecal_set_thresholds_sec2_sec4.pl");
+  system ("/home/hadaq/trbsoft/daq/ecal/ecal_set_thresholds_sec2_sec4.pl");
 
 
   sleep(15);
index 833778171d419cc2e90c991ea92d7c1927e987d0..8035f331bb3b10fb639e8dde2d89398b51a063bd 100755 (executable)
@@ -188,7 +188,7 @@ while(1) {
 0x8700,0x8701,0x8702,
 0x6700,0x6701,0x6702,0x6703,
 0x6710,0x6711,0x6712,0x6713,
-0x6720,0x6721,0x6722,0x6723,
+0x6720,0x6722,0x6723,  #0x6721
 
 );
 
@@ -233,7 +233,7 @@ while(1) {
 #      0x8910,0x3810,0x3811,
        #Start TRB3sc
        0x8880,
-#      0x5000,0x5001,0x5002,0x5003,0x5004,0x5005,0x5006,0x5007,
+       0x5000,0x5001,0x5002,0x5003,0x5004, #0x5005,0x5006,0x5007,
        #Hodo TRB3
 #      0x8890,0x5010,0x5011, #0x5012,
        #Trigger
@@ -297,8 +297,8 @@ while(1) {
        
        $longtext .= "<br>Few boards missing, but for a long time. Better do a restart." if $mdcmissingtime > 360;
        
-    Hmon::Speak('mdcmissonce',"$num_mdc_missing MDC Frontends missing") if($qastate > 60 && $qastate < QA::ERROR );
-    Hmon::Speak('mdcmiss',"$num_mdc_missing MDC Frontends missing") if($qastate >= QA::ERROR );
+    Hmon::Speak('mdcmissonce',"$num_mdc_missing M-D-C Frontends missing") if($qastate > 60 && $qastate < QA::ERROR );
+    Hmon::Speak('mdcmiss',"$num_mdc_missing M-D-C Frontends missing") if($qastate >= QA::ERROR );
     QA::WriteQALog($flog,"endp","mdc",$waittime,$qastate,$title,$value,$longtext);
     if($qastate > 60) {
       $longtext =~ s/\<br\>//g;
@@ -424,7 +424,7 @@ while(1) {
     if ($num_tof_mistake > 0) {$tof_longtext .= " Endp @{$tof_results[4]} not known";} 
 
     $qastate = QA::GetQAState('below',$num_tof_missing,@QA::TofEndpMissingLimits);
-    Hmon::Speak('tofmiss',"$num_tof_missing Tof, Rpc Frontends missing") if($qastate > 60);
+    Hmon::Speak('tofmiss',"$num_tof_missing toff, R-P-C frontends missing") if($qastate > 60);
     QA::WriteQALog($flog,"endp","tof",$waittime,$qastate,
                   $tof_title,$tof_value,$tof_longtext);
     if($qastate > 60) {
index a390f76be6b8a0e3ef5ee9d169fbd95161db846f..c09b7ac3ca6e0d8c43f2c2779c7d2274ad8497ff 100755 (executable)
@@ -22,9 +22,9 @@ my @x = (0,16,17,18,19,20,21,22,23,24,25,26,27,16,17,18,19,20,21,22,23,24,25,26,
 my @y = (0,
 16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,12,12,12,12,12,12,12,12,12,12,14,14,14,14,14,14,14,14,14,14,16,16,16,16,18,18,18,18,20,20,20,20,22,22,22,22,24,24,24,24,26,26,26,26,28,28,28,28,28,28,28,28,28,28,30,30,30,30,30,30,30,30,30,30,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,8,8,8,12,12,12,12,12,12,16,16,16,16,16,16,20,20,20,20,20,20,24,24,24,24,24,24,28,28,28,28,28,28,32,32,32,32,32,32,32,32,32,32,32,36,36,36,36,36,36,36,36,36,36,36,40,40,40,40,40,40,40,40,40);
 
-my @bo = (0,0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6702, 0, 0, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0, 0, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6703, 0x6703, 0x6703, 0x6703, 0x6722, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6723, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6712, 0x6712, 0x6712, 0x6712, 0x6723, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0, 0, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0, 0, 0, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0, 0x6712, 0x6712, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0, 0, 0, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722);
+my @bo = (0,0x6700  ,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6723,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6720,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6702,0,0,0x6702,0x6720,0x6702,0x6720,0x6723,0x6723,0x6723,0x6702,0x6702,0x6702,0,0,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6703,0x6703,0x6703,0x6703,0x6722,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6723,0x6723,0x6723,0x6723,0x6703,0x6703,0x6703,0x6710,0x6710,0x6710,0x6710,0x6710,0x6723,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6712,0x6712,0x6712,0x6712,0x6723,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0,0,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0,0,0,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0,0x6712,0x6712,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0,0,0,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0,0);
 
-my @ch = (0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 15, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 0, 1, 2, 3, 4, 30, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 31, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 0, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 0, 30, 31, 0, 1, 2, 3, 4, 5, 7, 9, 10, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 31, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 9, 10, 11, 12, 13, 14, 31);
+my @ch = (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,30,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,24,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,0,0,2,31,4,30,13,14,15,9,10,11,0,0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,16, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,9,10,11,12,30,31,32,1,2,3,4,5,31,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,32,6,7,8,9,10,11,12,13,14,0,0,15,16,17,18,19,20,21,0,0,0,22,23,24,25,26,27,28,29,30,0,31,32,1,2,3,4,5,6,8,10,11,13,14,15,17,18,19,20,21,22,17,18,19,20,21,22,23,24,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,32,0,1,2,3,4,5,6,7,8,9,0,0,0,10,11,12,13,14,15,32,0,0);
 
 HPlot::PlotInit({
     name    => "FwRate",
@@ -61,7 +61,7 @@ HPlot::PlotInit ({
              file       => "files/FwRateSimple",
              title      => "FW Rate",
              entries    => 32,
-             curves     => 15,
+             curves     => 11,
              type       => HPlot::TYPE_HEATMAP,
              output     => HPlot::OUT_PNG,
              zlabel     => "Hitrate",
@@ -69,7 +69,7 @@ HPlot::PlotInit ({
              sizey      => 310,
              nokey      => 1,
              buffer     => 1,
-             ymin       => 14.5,
+             ymin       => 10.5,
              ymax       => -0.5,
              xmin       => -0.5,
              xmax       => 31.5,
@@ -130,7 +130,7 @@ while(1) {
         if ($vdiff < 0) { $vdiff += 2**28;}
         $diff->{$b}->[$v] = $vdiff/$tdiff;
 
-        HPlot::PlotFill('FwRateSimple',$diff->{$b}->[$v],$v,($b%4)+((($b>>4)%4)*5));
+        HPlot::PlotFill('FwRateSimple',$diff->{$b}->[$v],$v,($b%4)+((($b>>4)%4)*4-($b>=0x6722?1:0)));
 
 #         my $val = $diff->{$b}->[$v];
         
@@ -146,7 +146,7 @@ while(1) {
       next if ($i == 209 || $i == 210);
       next if ($i == 218 || $i == 219 || $i == 220 || $i == 230);
       next if ($i == 283 || $i == 293 || $i == 294 || $i == 295);  
-      my $val = $diff->{$bo[$i]}->[$ch[$i]];
+      my $val = $diff->{$bo[$i]}->[$ch[$i]-1];
       
   #     $val = $i; #TODO
         HPlot::PlotFill('FwRate',$val,$x[$i],  43-$y[$i]);
old mode 100755 (executable)
new mode 100644 (file)
index 528cadd52c4d87768c1795a3b3776e0b625c0986..6267f88e2295ec687d5549e9c606e17175ccb956 100755 (executable)
@@ -45,7 +45,7 @@ while (1) {
 
   if ($qastate > 60 && !($timecnt++ % 20)) {
 #     system("logger -p local1.info -t DAQ 'Hmon <E> Online QA Server not found'");
-    Hmon::Speak("qa","QA server crashed.");
+    Hmon::Speak("qa","Q-A server crashed.");
     $qastate = QA::WARN_2;
     $timecnt = -4;
     }
index a4c6c82df32be0d2d7d61b83e8db0f4578b15e15..226c4f42769f41077106adbeddb6202fa06b42d9 100755 (executable)
@@ -23,22 +23,31 @@ while(1) {
   $r[0] = Dmon::PadiwaSendCmd(0x14 << 24,0xfe71,0) or sleep 1 and next;
   $r[1] = Dmon::PadiwaSendCmd(0x14 << 24,0xfe71,1) or sleep 1 and next;
   $r[2] = Dmon::PadiwaSendCmd(0x14 << 24,0xfe71,2) or sleep 1 and next;
+  $r[3] = Dmon::PadiwaSendCmd(0x13 << 24,0xfe71,0) or sleep 1 and next;
+  $r[4] = Dmon::PadiwaSendCmd(0x13 << 24,0xfe71,1) or sleep 1 and next;
+  $r[5] = Dmon::PadiwaSendCmd(0x13 << 24,0xfe71,2) or sleep 1 and next;
   
   my $min = 1000;
   my $max = 0;
   my $count = 0;
+  my $count_notemp = 0;
   my @missing = ();
   my $c = -1;
   if (!defined $r[0] || $r[0] == -1 || scalar %{$r[0]} < 1) {sleep 10; next;}
-  foreach my $r (@r) {
+  for (my $i = 0; $i < 3; $i++)  {
     $c++;
-    foreach my $b (keys %{$r}) {
-      last if $r->{$b} =~ /SPI/;
-      my $t = ($r->{$b} & 0xfff)/16;
-      $count++ unless $t > 90;
-      push @missing, sprintf("%04x-%i ",$b,$c) if $t > 90;
+    foreach my $b (keys %{$r[$i]}) {
+      last if $r[$i]->{$b} =~ /SPI/;
+      my $t = ($r[$i]->{$b} & 0xfff)/16;
+      if ($t > 90 && ($r[$i+3]->{$b}&0xff) != 0x1c) {
+       push @missing, sprintf("%04x-%i ",$b,$c);
+       }
+      else {
+        $count++ 
+        }
       # $missing .= sprintf("%04x-%i ",$b,$c) if $t > 90;
       next if $t < 10 || $t > 90;
+      $count_notemp++;
       $min = $t if $t < $min;
       $max = $t if $t > $max;
     }
@@ -58,10 +67,10 @@ while(1) {
   my $tempStr = sprintf("%i-%i", $min, $max);
   my $tempStr2;
   if ($qastateTemp == QA::OK) {
-    $tempStr2 = sprintf("<b>Temperature OK</b><br>");
+    $tempStr2 = sprintf("<b>Temperature OK</b> :");
   }
   else {
-    $tempStr2 = sprintf("<b>Temperature Bad</b><br>");
+    $tempStr2 = sprintf("<b>Temperature Bad</b> :");
   }
 
   my $nofStr = sprintf("%i/%i",$count,$QA::PadiwaEcalNumber);
@@ -87,8 +96,8 @@ while(1) {
     $worstQaState = QA::OK;
     }
 
-  QA::WriteQALog($fqa,"misc2","ecal", 45, $worstQaState, "ECAL", $nofStr . " | " . $tempStr, 
-    $tempStr2. "Temperature in ECAL " . $tempStr . "°C.<br>" . $nofStr2 . $nofStr . " PADIWAs<br>" . " Missing are: " . $missing_str);
+  QA::WriteQALog($fqa,"misc2","ecal", 45, $worstQaState, "ECal Padiwa", $nofStr . " | " . $tempStr, 
+    $tempStr2 . $tempStr . "°C.<br>" . $nofStr2 . $nofStr . " PADIWAs<br>" . " Missing are: " . $missing_str."<br>No temperature from ".($count-$count_notemp)." boards");
 
   sleep(10);
 }
index 6ad1e5e304beed53e99d719588627e84ffb78b9d..af028025dc3750b02c660e67f74d636304e528e5 100755 (executable)
@@ -74,7 +74,8 @@ while (1) {
         if (isFeeHub($h)) {
           for (my $i=0; $i<12; $i++) {
             if ($rh_hubs->{$h} & (1<<$i)) {
-              $boardlist .= sprintf("%04x (%04x-%i), ",Hmon::TraceDBGet($h,$i-1),$h,($i-1));#        
+              my $failedboard = Hmon::TraceDBGet($h,$i-1);
+              $boardlist .= sprintf("%04x (%s %04x-%i), ",$failedboard,Hmon::getsystem($failedboard),$h,($i-1));#        
               }
             }
           }
index 79c1fc4c67b1ee87c43232ee9b5ba248b726257d..03e0ca2fbaf823656f39f88ab29d8d8650c5ca24 100755 (executable)
@@ -88,8 +88,12 @@ while (1) {
 
   if ($max > $interlockTemperature ) {
     my $s = sprintf("HAD:RICH:PS:17:SETONOFF");
+    my $s2 = sprintf("HAD:RICH:PS:poweroff.PROC");
     Perl2Epics::Connect("PS_RICH_3_3V",$s);
-    Perl2Epics::Put("PS_RICH_3_3V",0);
+    Perl2Epics::Put("PS_RICH_3_3V","OFF");
+    Perl2Epics::Connect("PS_RICH_LV",$s2);
+    Perl2Epics::Put("PS_RICH_LV",1);
+    Perl2Epics::Update(1);
     $InterlockActive = "Shutting down RICH ...";
   }
   
index bb35a11df05593d05de1cb61a1c5d94dd5172ba4..b3e2bf6a212939123743f06bb339bb1ef4b3b860 100755 (executable)
@@ -25,8 +25,8 @@ my $plot1 = {
              name       => "StartRateSimple",
              file       => "files/StartRateSimple",
              title      => "Start Rate",
-             entries    => 16,
-             curves     => 32,
+             entries    => 8,
+             curves     => 8,
              type       => HPlot::TYPE_HEATMAP,
              output     => HPlot::OUT_PNG,
              zlabel     => "Hitrate",
@@ -34,10 +34,10 @@ my $plot1 = {
              sizey      => 310,
              nokey      => 1,
              buffer     => 1,
-             ymin       => 31.5,
+             ymin       => 7.5,
              ymax       => -0.5,
              xmin       => -0.5,
-             xmax       => 15.5,
+             xmax       => 7.5,
              cbmax      => "100<*<1E8",
              cbmin      => 0,
              noinit     => 1,
@@ -94,7 +94,7 @@ while (1) {
   #my $max = 0 ;
   #my $min = 5E9;
 
-  my $current = trb_register_read_mem(0xfe76,0xdfc0,0,48) or die trb_strerror() or sleep 5 and next;
+  my $current = trb_register_read_mem(0xfe58,0xc001,0,8) or die trb_strerror() or sleep 5 and next;
 
   #print Dumper $o;
   if (defined $old) {
@@ -105,7 +105,7 @@ while (1) {
       next unless ($endpoint>=0x5000 && $endpoint<=0x5007);
       my $fpga =  ($endpoint&0xF);
 
-      for my $channel_nr (0..23) {
+      for my $channel_nr (0..7) {
         my $vdiff = ($current->{$endpoint}->[$channel_nr] & 0xfffffff) - ($old->{$endpoint}->[$channel_nr]&0xfffffff);
 
         if ($vdiff < 0) {
@@ -114,7 +114,7 @@ while (1) {
         $diff->{$endpoint}->[$channel_nr] = $vdiff/$tdiff;
         #$ratesum += $diff->{$endpoint}->[$channel_nr+1];
         #HPlot::PlotFill('StartRateSimple',$diff->{$endpoint}->[$channel_nr],$channel_nr,);
-        HPlot::PlotFill('StartRateSimple',$diff->{$endpoint}->[$channel_nr],$channel_nr%16,$fpga*4+$channel_nr/16);
+        HPlot::PlotFill('StartRateSimple',$diff->{$endpoint}->[$channel_nr],$channel_nr,$fpga);
 
 #         my $ypos = 0;
 #         my $side = 0;
index ed0c884ab903345dd29d3171edcaa7a1cf835721..15dcbca768d5a2c714a4ea74ccf7288fc40aa1ec 100755 (executable)
@@ -29,8 +29,9 @@ while (1) {
       $msg .= sprintf("%04x-%04x (",$board,$rh_hubs->{$board} & 0xffff);
       foreach my $i (1..12) {
         if ($rh_hubs->{$board} & (1<<$i)) {
-          $msg .= sprintf("0x%04x ",Hmon::TraceDBGet($board,$i));
-          $boardlist1 .= sprintf("%04X, ",Hmon::TraceDBGet($board,$i));
+          my $failedboard = Hmon::TraceDBGet($board,$i);
+          $msg .= sprintf("0x%04x ",$failedboard,Hmon::getsystem($failedboard));
+          $boardlist1 .= sprintf("%04X, ",$failedboard);
       $cnt++;
           }
         }
@@ -41,7 +42,8 @@ while (1) {
       $msg2 .= sprintf("%04x-%04x (",$board,$rh_hubs->{$board}>>16 & 0xffff);
       foreach my $i (1..12) {
         if ($rh_hubs->{$board} & (1<<($i+16))) {
-          $msg2 .= sprintf(" %04x",Hmon::TraceDBGet($board,$i));
+          my $failedboard = Hmon::TraceDBGet($board,$i);
+          $msg2 .= sprintf("%04x %s",$failedboard,Hmon::getsystem($failedboard));
          if (!( (((Hmon::TraceDBGet($board,$i)) >>12) == 2) || (((Hmon::TraceDBGet($board,$i)) >>12) == 7))) {
             # MDC or RICH board
          # } else {
@@ -49,7 +51,7 @@ while (1) {
            $MDCRICH_fail++;
          }
       $cnt2++;
-          $boardlist2 .= sprintf("%04X, ",Hmon::TraceDBGet($board,$i));
+          $boardlist2 .= sprintf("%04X, ",$failedboard);
           }
         }
       $msg2 .= " )";
@@ -71,11 +73,11 @@ while (1) {
   
   if($boardlist1 ne "") {
     Hmon::Speak('timeout'.(($qastate<QA::ERROR)?'once':''),"$cnt Frontend had a timeout: $boardlist1 ") if $cnt < 3;
-    Hmon::Speak('timeout',"$cnt Frontend had a timeout ") if $cnt >= 3;
+    Hmon::Speak('timeout',"$cnt Frontends had a timeout ") if $cnt >= 3;
     }
   if($boardlist2 ne "" && $boardlist1 eq "" ) {
     Hmon::Speak("timeout".(($qastate<QA::ERROR)?'once':''),"$cnt2 Frontend disabled after a timeout: $boardlist2") if $cnt2 < 3;
-    Hmon::Speak('timeout',"$cnt2 Frontend had a timeout ") if $cnt2 >= 3;
+    Hmon::Speak('timeout',"$cnt2 Frontends had a timeout ") if $cnt2 >= 3;
     }
 
   QA::WriteQALog($fqa, "daq", "timeouts", 20, $qastate, "Timeouts",
index 163674bd30ae443dc82ecb33ee6ed1750af2c34e..634fcc1ecbd4e9b3b4ccdb792f632b1c1026698e 100755 (executable)
@@ -130,7 +130,7 @@ my $lastspillsumstart = 0;
 
 while (1) {
   my $tb = trb_registertime_read_mem(0x10,0x9000,0,224);
-  my $st = trb_registertime_read_mem(0xfe76,0xdfc0,0,24);
+  my $st = trb_registertime_read_mem(0xfe58,0xc001,0,8);
   
   my $inspill = $tb->{0x10}{value}[0x5d] >> 31;
 
index 4464178f596c0019a439aef21f35206d9e04d641..b9ce9d6b65335d897ab57202959c43460e4e82c4 100755 (executable)
@@ -4,9 +4,10 @@ use CGI::Carp qw(fatalsToBrowser);
 
 print "Content-type: text/html\r\n\r\n";
 
+#<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 print qq$
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
 <title>Monitoring Main Control Interface</title>
@@ -40,8 +41,8 @@ function openwin(url) {
 <div class="linkbox" style="float:right"><h4>Documents</h4><ul>
 <li><a href="https://hessenbox-a10.rz.uni-frankfurt.de/getlink/fiFyuhGJXrwV1dPs5RebuW/HadesOperatorManual.pdf" style="color:#d33">Operator manual</a>
 <li><a href="https://hessenbox-a10.rz.uni-frankfurt.de/getlink/fiRhk3zAKorCqtPgXk7hpa/">Document Repository</a>
-<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/networkaddresses.pdf">DAQ FEE Addresses</a>
-<li><a href="phonenumbers.jpg">Phone Numbers</a>
+<li><a href="https://hessenbox-a10.rz.uni-frankfurt.de/getlink/fiHTFzB5jN8CgPNMjvzn83/networkaddresses.pdf">DAQ FEE Addresses</a>
+<li><a href="https://hessenbox-a10.rz.uni-frankfurt.de/getlink/fiGgg6c7AhGjD2rnVAxfD7/PhoneNumbers.jpg">Phone Numbers</a>
 <li><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.form_selection">Beamtime Logbook</a></li>
 <li><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hshiftcrews2.form_select">Shift Crew</a></li>
 <li class="outdated"><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/qadocu.pdf">QA manual</a>
@@ -53,15 +54,15 @@ function openwin(url) {
 <li style="width:600px;"><a href="monitor.cgi?1-window8x26-busy-DutyFactor-Pt3AcceptRatio-EvtsPerSpill-StartCountSpill">Main Screen 2</a> Spill Info
 <li style="width:600px;"><a href="monitor.cgi?1-window14x8-EBSummary-hldlast">Main Screen 3</a> EBs</li>
 <!--<li style="width:600px;"><a href="monitor.cgi?2-window19x16-EcalSimpleRate-RpcRate-StsRate-TofRate-ItofRate-StartRateSimple-FrpcRate">Main Screen 4</a> Tof Rpc STS Ecal iTOF fRPC Start rates</li>-->
-<li style="width:600px;"><a href="monitor.cgi?2-window13x16-EcalSimpleRate-RpcRate-TofRate-StartRateSimple-FwRateSimple">Main Screen 4</a> Tof Rpc FW Ecal Start rates</li>
-<li style="width:600px;"><a href="monitor.cgi?2-window13x23-StartFalls-ItofRateNumbers-TriggerRatesPerSector-CTSRates">Main Screen 5</a> Positional map for Start and iTOF, Trigger Rates</li>
+<li style="width:600px;"><a href="monitor.cgi?2-window12x16-EcalSimpleRate-RpcRate-TofRate-StartRateSimple-FwRateSimple">Main Screen 4</a> Tof Rpc FW Ecal Start rates</li>
+<li style="width:600px;"><a href="monitor.cgi?2-window12x21-StartFalls-ItofRateNumbers-TriggerRatesPerSector-CTSRates">Main Screen 5</a> Positional map for Start and iTOF, Trigger Rates</li>
 <li class="outdated" style="width:600px;"><a href="monitor.cgi?2-window12x21-RpcTofSectorRate_highres-StartRateX_histbar-StartRateY_histbar">Main Screen 6</a> Beam Intensities</li>
 </ul></div>
 
 <div class="linkbox" style="clear:both;width:730px;"><h4>Other Ressources</h4><ul>
-<li class="outdated"><a href="/qaweb">QA Plots (web-based)</a>
-<li class="outdated"><a href="files/qa.htm">QA Plots (updated every 5 minutes)</a></li>
-<li class="outdated"><a href="files/vertex.htm">Vertex Plots (updated after each file)</a></li>
+<li><a href="/qaweb/?layout=tabs&monitoring=2000" target="_blank">QA Plots (web-based)</a>
+<li><a href="files/qa.htm">QA Plots (updated every 5 minutes)</a></li>
+<li><a href="files/vertex.htm">Vertex Plots (updated after each file)</a></li>
 <!--<li class="outdated"><a href="../spillmon/?browser=no&monitoring=1000&layout=grid4x4&items=[%22EventBuilder/Run/HLD/HLD_HitsFast%22,%22EventBuilder/Run/HLD/HLD_HitsSlow%22,%22EventBuilder/Run/HLD/HLD_TrendX%22,%22EventBuilder/Run/HLD/HLD_TrendY%22,%22EventBuilder/Run/HLD/HLD_BeamX%22,%22EventBuilder/Run/HLD/HLD_BeamY%22,%22EventBuilder/Run/HLD/HLD_VETO_Patt%22,%22EventBuilder/Run/HLD/HLD_QSlow%22,%22EventBuilder/Run/HLD/HLD_HALO_Patt%22,%22EventBuilder/Run/HLD/HLD_XHALOSlow%22,%22EventBuilder/Run/HLD/HLD_YHALOSlow%22,%22EventBuilder/Run/HLD/HLD_LastSpill_Q_factor%22]">Beam Properties</a></li>-->
 <!-- <li class="outdated"><a href="http://lxhadeb06/icinga">Icinga Server Monitoring (local access only)</a> -->
 <!--<li class="outdated"><a href="http://hades63/icingaweb2/dashboard">Icinga Server Monitoring (local access only)</a>-->
@@ -71,25 +72,33 @@ function openwin(url) {
 
 
 <div class="linkbox" style="clear:both"><h4>DAQ Network</h4><ul>
+<li><a href="monitor.cgi?1-window-busy">Busy times (current)</a></li>
+<li><a href="monitor.cgi?2-window-busyhist">Busy times (last 25 seconds)</a></li>
+<li><a href="monitor.cgi?1-window-eventrateshort">Eventrate (10 seconds)</a></li>
+<li><a href="monitor.cgi?1-window-eventrate">Eventrate (1 minute)</a></li>
+<li><a href="monitor.cgi?5-window-eventratelong">Eventrate (10 minutes)</a></li>
+<li><a href="monitor.cgi?2-window-GbeRate">Data rate (current)</a></li>
+<li><a href="monitor.cgi?2-window-datarate">Data rate (last minutes)</a></li>
 <li><a href="monitor.cgi?1-window-hubmon">Hub Monitor</a></li>
-<li><a href="monitor.cgi?1-window-busy">Busy times of subsystems</a></li>
-<li><a href="monitor.cgi?2-window-busyhist">Histogram of busy times</a></li>
-<li><a href="monitor.cgi?2-window-GbeRate">Data amount on GbE</a></li>
-<li><a href="monitor.cgi?2-window-datarate">Data rate histogram</a></li>
 </ul></div>
 
 <div class="linkbox" style="float:right"><h4>Trigger</h4><ul>
 <li><a href="monitor.cgi?1-window-CTSRates">Rates on CTS Trigger I/O</a></li>
-<li><a href="monitor.cgi?1-window-Triggerbox">Trigger rates by sector and detector</a></li>
-<li><a href="monitor.cgi?1-window-eventrateshort">Eventrate histogram (10s)</a></li>
-<li><a href="monitor.cgi?1-window-eventrate">Eventrate histogram (60s)</a></li>
-<li><a href="monitor.cgi?5-window-eventratelong">Eventrate histogram (10m)</a></li>
-<li class="outdated"><a href="monitor.cgi?10-window-StartCountSpill">Start counts per spill</a></li>
+<li class="outdated"><a href="monitor.cgi?1-window-Triggerbox">Trigger rates by sector and detector</a></li>
 <li><a href="monitor.cgi?10-window-Pt3AcceptRatio">Ratio of accepted PT3 per spill</a></li>
 <li><a href="monitor.cgi?10-window-EvtsPerSpill">Recorded events per spill</a></li>
 <!--<li><a href="monitor.cgi?5-window-Vetohist">Veto hit count histograms</a></li>-->
 <li><a href="monitor.cgi?5-window-Muxhist">CTS mux output histograms</a></li>
 <li><a href="monitor.cgi?5-window-CtsMuxRatio">CTS mux output ratio histo.</a></li>
+<li><a href="/daqtools/network/triggerbox.pl">Triggerbox</a></li>
+</ul></div>
+
+<div class="linkbox" style="float:right"><h4>Beam</h4><ul>
+<li class="outdated"><a href="monitor.cgi?10-window-StartCountSpill">Start counts per spill</a></li>
+<li><a href="monitor.cgi?2-window13x21-QFactor-MicroSpillStructure">QFactor & Micro Structure</a></li>
+<li><a href="monitor.cgi?1-StartRateNumbers-StartPosition-ItofRateNumbers-StartPositionRMS-HodoRate-QFactor-CTSRates-MicroSpillStructure-StartSpillShapeAnalysisY_0">Beam plots collection similar to HKR</a></li>
+<li><a href="/daqtools/tools/beamabort.pl">Beam Abort</a></li>
+<li><a href="/spillmonitor/tools/spillmonitor.pl">Spill Monitor Control</a></li>
 </ul></div>
 
 <!-- <div class="linkbox" style="float:right"><h4>Pion</h4><ul> 
@@ -121,14 +130,16 @@ function openwin(url) {
 <!-- <li class="outdated"><a href="monitor.cgi?1-StartRateBars-StartBars-StartPosition-VetoHalo-ForwardQuartz">Beam Summary</a></li> -->
 </ul></div>
 
-<div class="linkbox" style="float:right"><h4>ECal</h4><ul>
-<li><a href="monitor.cgi?1-window-ECalRate">Rate Summary for ECal</a></li>
-<li><a href="ecal_drawing.htm#ecalrate_slow">Rate for ECal</a></li>
-<li><a href="monitor.cgi?2-window-EcalHVVMap">ECAL HV Voltage Map</a></li>
-<li><a href="monitor.cgi?2-window-EcalHVCMap">ECAL HV Current Map</a></li>
+<div class="linkbox" style="float:left"><h4>ECal</h4><ul>
+<li><a href="monitor.cgi?1-window-ECalRate">Rate Summary</a></li>
+<li><a href="ecal_drawing.htm#ecalrate_slow">Rates / Threshold Map</a></li>
+<li><a href="monitor.cgi?2-window-EcalHVVMap">HV Voltage Map</a></li>
+<li><a href="monitor.cgi?2-window-EcalHVCMap">HV Current Map</a></li>
 </ul></div>
 
-<div class="linkbox" style="float:left"><h4>RICH</h4><ul>
+<div class="linkbox" style="float:right"><h4>RICH</h4><ul>
+<li><a target="_blank" href="monitor.cgi?2-RichRatev2">Rates</a></li>
+<li><a target="_blank" href="rich_drawing_2.htm#custom-0xfe51-0xc001-0-30-0.03125-ratesum32">Mean rate per DiRICH</a></li>
 <li><a target="_blank" href="rich_drawing_2.htm#richTemperature">Temperature</a></li>
 <li><a target="_blank" href="rich_drawing_bkpl.htm#richTemperatureBackplane">Temperature Backplane</a></li>
 <li><a target="_blank" href="monitor.cgi?10-window-RichTempHistoDiRICH">Temperature Backplane Histo</a></li>
@@ -136,18 +147,16 @@ function openwin(url) {
 <li><a target="_blank" href="rich_drawing_2.htm#rich2V5">DiRich 2.5V</a></li>
 <li><a target="_blank" href="monitor.cgi?10-richvolt">Voltage & Current</a></li>
 <li><a target="_blank" href="monitor.cgi?2-window-RichHV">High Voltage</a></li>
-<li><a target="_blank" href="monitor.cgi?2-RichRatev2">Rates on all channels</a></li>
-<li><a target="_blank" href="rich_drawing_2.htm#custom-0xfe51-0xc001-0-30-0.03125-ratesum32">Mean rate per DiRICH</a></li>
 <li><a target="_blank" href="monitor.cgi?10-window-RichMagnet">Rich Inner Magnet fields</a></li>
 <li><a target="_blank" href="monitor.cgi?10-window-RichInnerTemp">Rich Inner Temperatures</a></li>
 <li><a target="_blank" href="monitor.cgi?10-window-RichGas">Rich Gas Information</a></li>
 </ul></div>
 
-<div class="linkbox" style="float:right"><h4>MDC</h4><ul>
+<div class="linkbox" style="float:left"><h4>MDC</h4><ul>
 <li><a href="monitor.cgi?10-MDCRates-MDCBusy-MDCTemperature-MDCRetransmission-MDCTriggerError-MDCTokenMiss">MDC Overview</a></li>
 <li><a href="monitor.cgi?1-window-MDCHV">HV settings</a></li>
-<li><a href="monitor.cgi?15-window-mdchvV0-mdchvV1-mdchvV2-mdchvV3">HV voltage trend plots</a></li>
-<li><a href="monitor.cgi?15-window-mdchvC0-mdchvC1-mdchvC2-mdchvC3">HV current trend plots</a></li>
+<li><a href="monitor.cgi?15-window18x21-mdchvV0-mdchvV1-mdchvV2-mdchvV3">HV voltage trend plots</a></li>
+<li><a href="monitor.cgi?15-window18x21-mdchvC0-mdchvC1-mdchvC2-mdchvC3">HV current trend plots</a></li>
 <li><a href="monitor.cgi?2-window-MDCBusy">Busy Times</a></li>
 <li><a href="monitor.cgi?2-window-MDCRates">Data Rates</a></li>
 <li><a href="monitor.cgi?2-window-MDCTokenMiss">Missing Tokens</a></li>
@@ -162,43 +171,34 @@ function openwin(url) {
 
 
 
-<div class="linkbox" style="float:left"><h4>Eventbuilder</h4><ul>
-<li><a href="monitor.cgi?30-window-EBDisks">Fill-level of disks</a></li>
-<li><a href="monitor.cgi?10-window-EBCPU">Server CPU load</a></li>
-<li><a href="monitor.cgi?10-window-hldlast">Last hld files written</a></li>
-<li><a href="/calib">Calibration Monitor </a>
-<li><a href="monitor.cgi?60-window-TdcCalMon">Calibration Test Plots</a></li>
-</ul></div>
-
-
-<div class="linkbox" style="float:right"><h4>Trigger</h4><ul>
-<li><a href="/daqtools/network/triggerbox.pl">Triggerbox</a></li>
-<li><a href="/daqtools/tools/beamabort.pl">Beam Abort</a></li>
-</ul></div>
 
-<div class="linkbox" style="float:left"><h4>Wall</h4><ul>
-<li><a href="monitor.cgi?2-window-FwRates">Forward Wall Rates</a></li>
-<li><a href="monitor.cgi?10-window-FwHV">Forward Wall HV</a></li>
-<li><a href="monitor.cgi?10-window-FwHVCurrent">Forward Wall HV Currents</a></li>
+<div class="linkbox" style="float:right"><h4>Wall</h4><ul>
+<li><a href="monitor.cgi?2-window-FwRates">FW Rates</a></li>
+<li><a href="monitor.cgi?10-window-FwHV">FW HV Voltage</a></li>
+<li><a href="monitor.cgi?10-window-FwHVCurrent">FW HV Current</a></li>
 </ul></div>
 
-<div class="linkbox" style="float:right"><h4>Beam</h4><ul>
-<li><a href="monitor.cgi?2-window13x21-QFactor-MicroSpillStructure">QFactor & Micro Structure</a></li>
-<li><a href="monitor.cgi?2-window-StarX_spill">Spill Macro Structure</a></li>
-<li><a href="monitor.cgi?1-StartRateNumbers-StartPosition-ItofRateNumbers-StartPositionRMS-HodoRate-QFactor-CTSRates-MicroSpillStructure-StartSpillShapeAnalysisY_0">Beam plots collection similar to HKR</a></li>
-</ul></div>
 
-<div class="linkbox" style="float:left"><h4>Environment</h4><ul>
+<div class="linkbox" style="float:right"><h4>Environment</h4><ul>
 <li><a href="monitor.cgi?2-window-CaveTemp">Cave and Cooling Temperature</a></li>
 <li><a href="monitor.cgi?2-window-Environment">Temperature, Humidity and Pressure</a></li>
 </ul></div>
 
 
+<div class="linkbox" style="float:left"><h4>Eventbuilder</h4><ul>
+<li><a href="monitor.cgi?30-window-EBDisks">Fill-level of disks</a></li>
+<li><a href="monitor.cgi?10-window-EBCPU">Server CPU load</a></li>
+<!--<li><a href="monitor.cgi?10-window-hldlast">Last hld files written</a></li>-->
+<li><a href="/calib">Calibration Monitor </a>
+<li><a href="monitor.cgi?60-window-TdcCalMon">Calibration Test Plots</a></li>
+</ul></div>
+
 
 $;
 
 
 print "<h3 style=\"clear:both;padding-top:30px;\">All available options</h3><ul class=\"optionlist\">\n";
+print "<p>Please prefer the links above, use this only if there is no proper link in the lists above.";
 my @o = qx(ls -1 files/*.htt);
 foreach my $a (@o) {
   if ($a =~ m%files/(\w+).htt%) {
index 7cef534f0ad3aadc58ff82021686efb1a42ab62d..10ac4e4cd170c7a738cacc41c616e8e242321677 100755 (executable)
@@ -23,7 +23,7 @@ my @args = split('-',$ENV{'QUERY_STRING'});
                $newurl =~ /(-|^|\?)(\w+)$/;
                
                my $width; my $height;
-               print $geom;
+               #print $geom;
                if($geom && $geom ne '' && $geom =~ /(\d+)x(\d+)/) {
       $width = 80*$1-8;
       $height = 50*$2-8;
@@ -33,23 +33,25 @@ my @args = split('-',$ENV{'QUERY_STRING'});
       my $str = <$MYF>;
       close($MYF);
       $str =~ /width(\d+)\sheight(\d+)/;
-      $width = 80*$1-6;
+      $width = 80*$1-4;
       $height = 50*$2+2;
       }
 
   
-               $out = qq$<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+#              $out = qq$<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+$out = qq$<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-<title>Hmon</title>
 <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
+<title>Hmon</title>
 <link href="files/styles.css" rel="stylesheet" type="text/css"/>
 <link rel="alternate stylesheet"  href="files/styles-lcars.css" type="text/css" title="LCARS"/>
 </head>
-<body >
+<body>
 <script type="text/javascript">
   document.write("Opening Window...<br>");
-       win = window.open("$.$newurl.qq$","Hmon$.$newurl.qq$","name=Hmon,innerwidth=$.$width.qq$,innerheight=$.$height.qq$,scrollbars=no,status=no,location=no,menubar=no,resizable=no,titlebar=no,dialog=no");
+       win = window.open("$.$newurl.qq$","Hmon$.$newurl.qq$","name=Hmon,innerWidth=$.$width.qq$,innerHeight=$.$height.qq$,scrollbars=no,status=no,location=no,menubar=no,resizable=no,titlebar=no,dialog=no");
        if(win) {
     win.focus();
     win.document.title="Hmon $.$newurl.qq#";
@@ -64,8 +66,9 @@ my @args = split('-',$ENV{'QUERY_STRING'});
 
              } else {
 
-               $out = qq$<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+#              $out = qq$<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+$out = qq$<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class="monitor">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <!--<meta http-equiv="refresh" content="$.$delay.qq$"/> -->
@@ -93,7 +96,7 @@ $out .= qq$<script  language='javascript'>
   blinking = setInterval("blink()",490);
   currentzoom = 1;
 
-function zoom() {
+/*function zoom() {
        var zoomstep = 1.5;
        if (currentzoom == 1) {
                currentzoom = 1.5;
@@ -111,7 +114,7 @@ function zoom() {
                window.innerHeight/= zoomstep;
                document.getElementById("big").innerHTML = "bigger";
                }
-       }
+       }*/
 
 function reload() {
   xmlhttp=new XMLHttpRequest();
@@ -120,6 +123,7 @@ function reload() {
       if(!document.getElementById("footer") && !document.getElementById('logbox')) {
         document.getElementById("content").style.opacity="0";
         document.getElementById("content").innerHTML=xmlhttp.responseText;
+        //document.getElementById('content').style.transform="scale("+myscale+","+myscale+")";
         setTimeout('document.getElementById("content").style.opacity="1"',100);
         setTimeout('document.getElementById("contentback").innerHTML=document.getElementById("content").innerHTML',200);
         }
@@ -194,6 +198,26 @@ function blink() {
   blinkcnt++;
   }
 
+/*var myscale =1 ;  
+function resize() {
+  if (document.getElementById('content').scrollWidth*myscale > window.innerWidth ||
+      document.getElementById('content').scrollHeight*myscale > window.innerHeight) {
+    myscale = myscale*0.9;
+    document.getElementById('content').style.transform="scale("+myscale+","+myscale+")";
+    //document.getElementById('contentback').style.transform="scale("+myscale+","+myscale+")";
+    }
+  if (document.getElementById('content').scrollWidth*myscale < window.innerWidth*0.9 ||
+      document.getElementById('content').scrollHeight*myscale < window.innerHeight*0.9) {
+          myscale = myscale/0.9;
+    document.getElementById('content').style.transform="scale("+myscale+","+myscale+")";
+    //document.getElementById('contentback').style.transform="scale("+myscale+","+myscale+")";
+    }
+  console.log(myscale);  
+  console.log(document.getElementById('content').scrollWidth, document.getElementById('content').scrollHeight );
+  }
+  
+setInterval("resize()",1000);*/
+
 </script>$;
              }
 $out .= qq$
index a022d3f69c19581060a06e730e7e84470b1c76eb..d23f724936185d8a20694d06b73f35d71502942d 100755 (executable)
@@ -8,23 +8,26 @@ use Data::Dumper;
 use POSIX qw/floor ceil/;
 use Hmon;
 use QA;
-use Perl2Epics;
+use Perl2Epics2;
+#JAM 22-nov-23- use local perl2epics installation on hades33 instead of lxhadesdaq installation
 
 my $fqa = QA::OpenQAFile();
 
 my @res;
 my @oldres= ("R22222222 #20", "R22222222 #21", "R22222222 #30", "R22222222 #22");
-my $cmd = 'ssh hadaq@hadeswrp02 "~/bin/readreg.sh"';
+#my $cmd = 'ssh hadaq@hadeswrp02 "~/bin/readreg.sh"';
+# JAM 22-11-23: enable above line if spare machine is used
+my $cmd = 'ssh hadaq@hadeswrp01 "~/bin/readreg.sh"';
 my $longtext;
 my $value = "";
 my $qastate;
 my $laststate = QA::ERROR;
 my $iterator = 0;
-Perl2Epics::Connect("fpga", "HAD:BEAM:beamAbort:status:FPGA");
-Perl2Epics::Connect("soft", "HAD:BEAM:beamAbort:status:soft");
-Perl2Epics::Connect("hard", "HAD:BEAM:beamAbort:status:hard");
-Perl2Epics::Connect("latch", "HAD:BEAM:beamAbort:status:latch");
-Perl2Epics::Connect("iterator", "HAD:BEAM:beamAbort:status:filler");
+Perl2Epics2::Connect("fpga", "HAD:BEAM:beamAbort:status:FPGA");
+Perl2Epics2::Connect("soft", "HAD:BEAM:beamAbort:status:soft");
+Perl2Epics2::Connect("hard", "HAD:BEAM:beamAbort:status:hard");
+Perl2Epics2::Connect("latch", "HAD:BEAM:beamAbort:status:latch");
+Perl2Epics2::Connect("iterator", "HAD:BEAM:beamAbort:status:filler");
 
 while (1) {
 
@@ -63,13 +66,13 @@ while (1) {
     $longtext .= "none"     if (substr($res[3],3,1) ne "1");
     $longtext .= "ABORTED"  if (substr($res[3],3,1) eq "1");
 
-    $value = "inactive"  if $longtext =~ /inactive/;
     $value = "ABORT"     if $longtext =~ /ABORT/;
     $value = "ABORTED"   if $longtext =~ /ABORTED/;
+    $value = "inactive"  if $longtext =~ /inactive/;
     $qastate = QA::WARN  if $longtext =~ /inactive/;
-    $qastate = QA::WARN_2 if $longtext =~ /Soft\sOverride:\sinactive/;
     $qastate = QA::FATAL if $longtext =~ /ABORT/;
     $qastate = QA::ERROR if $longtext =~ /ABORTED/;
+    $qastate = QA::WARN_2 if $longtext =~ /Soft\sOverride:\sinactive/;
     
     
     # EPICS part
@@ -79,27 +82,27 @@ while (1) {
 #      || substr($res[3],3,1) ne substr($oldres[3],3,1)
 #    ) {
       # print substr($res[0],5,2)." ".substr($res[2],7,2)." ".substr($res[0],7,2)." ".substr($res[3],3,1);
-      Perl2Epics::Put("fpga",0) if substr($res[0],5,2) eq "11";
-      Perl2Epics::Put("fpga",1) if substr($res[0],5,2) eq "01" || substr($res[0],5,2) eq "10";
-      Perl2Epics::Put("fpga",2) if substr($res[0],5,2) eq "00";
+      Perl2Epics2::Put("fpga",0) if substr($res[0],5,2) eq "11";
+      Perl2Epics2::Put("fpga",1) if substr($res[0],5,2) eq "01" || substr($res[0],5,2) eq "10";
+      Perl2Epics2::Put("fpga",2) if substr($res[0],5,2) eq "00";
 
-      Perl2Epics::Put("soft",0) if substr($res[2],7,2) eq "10";
-      Perl2Epics::Put("soft",1) if substr($res[2],7,2) eq "00";
-      Perl2Epics::Put("soft",2) if substr($res[2],8,1) eq "1";
+      Perl2Epics2::Put("soft",0) if substr($res[2],7,2) eq "10";
+      Perl2Epics2::Put("soft",1) if substr($res[2],7,2) eq "00";
+      Perl2Epics2::Put("soft",2) if substr($res[2],8,1) eq "1";
 
-      Perl2Epics::Put("hard",0) if substr($res[0],7,2) eq "10";
-      Perl2Epics::Put("hard",1) if substr($res[0],7,2) eq "00";
-      Perl2Epics::Put("hard",2) if substr($res[0],8,1) eq "1";
+      Perl2Epics2::Put("hard",0) if substr($res[0],7,2) eq "10";
+      Perl2Epics2::Put("hard",1) if substr($res[0],7,2) eq "00";
+      Perl2Epics2::Put("hard",2) if substr($res[0],8,1) eq "1";
 
-      Perl2Epics::Put("latch",1) if substr($res[3],3,1) ne "1";
-      Perl2Epics::Put("latch",2) if substr($res[3],3,1) eq "1";
-      Perl2Epics::Update(0.2);
+      Perl2Epics2::Put("latch",1) if substr($res[3],3,1) ne "1";
+      Perl2Epics2::Put("latch",2) if substr($res[3],3,1) eq "1";
+      Perl2Epics2::Update(0.2);
 #    }
   }
 
   if($iterator == 1) {
-    my $curr_it = Perl2Epics::Get("iterator");
-    Perl2Epics::Put("iterator",$curr_it+1);
+    my $curr_it = Perl2Epics2::Get("iterator");
+    Perl2Epics2::Put("iterator",$curr_it+1);
     $iterator = 0;
   }
 
index 46e2e7178708827d122ba9a4369e23f3f4f5c845..e63ed973425e0ca15614a891683ee8b742c5c3a4 100755 (executable)
@@ -28,9 +28,9 @@ my $plotShort = {
     xlabel  => "Minutes",
     ylabel  => "Temperature / Â°C",
     sizex   => 950,
-    sizey   => 360,
-    ymin    => "15",
-    ymax    => "25<*",
+    sizey   => 340,
+    ymin    => "15",
+    ymax    => "25<*<35",
     curves  => 3,
     xscale  => 60/10,
     storable=> 1,
@@ -50,9 +50,9 @@ my $plotLong = {
     xlabel  => "Hours",
     ylabel  => "Temperature / Â°C",
     sizex   => 950,
-    sizey   => 360,
-    ymin    => "15",
-    ymax    => "25<*",
+    sizey   => 340,
+    ymin    => "15",
+    ymax    => "25<*<35",
     curves  => 3,
     xscale  => 60,
     storable=> 1,
index c907580d236fbf527bfac51eef9986f7f75e604d..8fdff7ce1b25ab421726198f00c8712989a04273 100755 (executable)
@@ -32,7 +32,7 @@ my $fqa = QA::OpenQAFile();
 
 # JAM 6.1.2020 - for the moment exlude hosts depcp418 and lxhaddcs03 not available
 # MT 2022.02.09 - all to internal HADES-VLAN CPU-names
-my @srv = qw( lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb14p lxhadeb15p lxhadeb16p lxhadeb17p lxhadeb18p lxhadesdaqp  lxhadeb13p lxhaddcs10p lxhaddcs11p lxhaddcs12p lxhaddcs13p hadesdaqp03 hadesdaqp04 hadesp30 hadesp57 hadesp31 hadesp33 hadesp63 hadesp66 hadesp70);
+my @srv = qw( lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb14p lxhadeb15p lxhadeb16p lxhadeb17p lxhadeb18p lxhadesdaqp  lxhadeb13p lxhaddcs10p lxhaddcs11p lxhaddcs12p lxhaddcs13p hadesdaqp03 hadesdaqp04 hadesp57 hadesp31 hadesp33 hadesp63 hadesp66 hadesp67 hadesp69 hadesp70);
 
 my $template .= "\n<table class=\"colorfields cpu\">\n<tr><th>";
 for(my $d=1;$d<=32;$d++) {
@@ -44,8 +44,14 @@ while(1) {
   $laststore = clone($store);
   $store = {};
   for(my $n=0;$n< scalar @srv;$n++) {
-    print "$srv[$n]\n";
-    my @out = Hmon::qxtimeout("ssh $srv[$n] \"cat /proc/stat \" </dev/null",10);
+    #print "$srv[$n]\n";
+    my @out;
+    if($srv[$n] eq 'lxhadeb13p') {
+      @out = Hmon::qxtimeout("ssh hades-qa\@$srv[$n] \"cat /proc/stat \" </dev/null",10);
+      }
+    else {
+      @out = Hmon::qxtimeout("ssh hadaq\@$srv[$n] \"cat /proc/stat \" </dev/null",10);
+      }
     foreach my $a (@out)  {
       if($a =~ /cpu(\d+)/) {
         my @s = split(/\s/,$a);
@@ -70,7 +76,7 @@ while(1) {
   my $maxstr = "";
   my $busystr = "";
   if (defined $laststore->{0}->{0}->{'idle'}) {
-    $str = Hmon::MakeTitle(9,14,"Server CPU Usage");
+    $str = Hmon::MakeTitle(9,15,"Server CPU Usage");
     $str .= $template;
     for(my $s = 0; $s < scalar @srv; $s++) {
       $str .= "\n<tr><th class=\"title\">$srv[$s]";
index 9a5be6bbd0398ff45a58506f5d2b23e76d4c34f2..c97533d821d0057c5e924453902a711b5f9b015e 100755 (executable)
@@ -366,7 +366,7 @@ while (1) {
 
   if ($opt_debug<1) {
 
-    Hmon::Speak('ebrun',"Eventbuilder Error") if $qastate > 60;
+    Hmon::Speak('ebrun',"Event builder Error") if $qastate > 60;
     QA::WriteQALog($fqa, "eb", "run", 10, $qastate, $qatitle,
                    "i:$num_act_ins, b:$num_act_build ($prefix)", $qamsg);
   } else {
@@ -434,7 +434,7 @@ while (1) {
     if($speak_counter>20)
     {
      $speak_counter=-20;
-     Hmon::Speak('ebfiles', "event builders do not write files to disk.") unless $opt_debug>0 ||($masterstate =~ /NoNodes/);
+     Hmon::Speak('ebfiles', "Event building not writing files to disk.") unless $opt_debug>0 ||($masterstate =~ /NoNodes/);
      print "No files are written by eventbuilders.\n" unless $opt_debug<1;
     }
   }
index 69f6d612ee8ea8bc6150c309204db9ca153b7c59..7ff4de1c897a1eeaa3d8e367e347208c2b5f87ea 100755 (executable)
@@ -27,9 +27,9 @@ $max = 0;
 my $str;
 while (1) {
   $maxqa = 0;
-  $str  = Hmon::MakeTitle(8,6,"Eventbuilder Disk Fill Level"); 
+  $str  = Hmon::MakeTitle(2,6,"Eventbuilder Disk Fill Level"); 
   $str .= "<table class=\"colorfields\">\n<tr><th>";
-  for (my $d=1;$d<=15;$d++) {
+  for (my $d=1;$d<=1;$d++) {
     $str .= "<th>$d";
   }
   for (my $n=8;$n<=18;$n++) {
@@ -49,7 +49,7 @@ while (1) {
       }
     }
     $str .= "\n<tr><th> $hostn";
-    for (my $d=1;$d<=15;$d++) {
+    for (my $d=1;$d<=1;$d++) {
       my $id = $d;
       $id = '0'.$d if $d<10;
       $store->{$n}->{$id} = 0 unless exists $store->{$n}->{$id};
index c196295c7ad5e050a654ad1bc119f277510c551a..298caf101571b815baab799128c03035fc1d7fec 100755 (executable)
@@ -16,7 +16,7 @@ use HPlot;
 my $flog = QA::OpenQAFile();
 my @colors = ("#333333","#00ff00","#ff0000","#0000ff","#dddd00","#dd00dd");
 
-my $TOTALCHANS = 815;
+my $TOTALCHANS = 1008;
 
 for my $i (0..5) {
   HPlot::PlotInit( {
@@ -171,7 +171,7 @@ while(1) {
   my $min_i = -1E5;
   my $max_i =  1E5;
   my $ChnlsOn = 0;
-  my $data = Perl2Epics::GetAll();
+  my $data = Perl2Epics::GetAll(3);
 
   for(my $i = 0; $i <=5; $i++) {
         for(my $j = 0; $j<=167; $j++) {
@@ -411,5 +411,5 @@ while(1) {
             }
     }
 
-  usleep(2500000);
+  usleep(2500000);
   }
index 7fe13369a38c9f93dd9ee7e7a3775c4707334936..19078689ac1e1dca569cd9837bcf07ba541fde8f 100755 (executable)
@@ -184,8 +184,8 @@ while(1) {
      $longtext .= "<br>".$str;
 
   $qastate = QA::GetQAState('above', $ChnlsOn, @QA::FwHvLimits);   
-  if ($ChnlsOn == 0){ $qastate = QA::WARN_2;  $value = "OFF";}
   if ($ChnlsOld >= 0) { $qastate = QA::WARN_2;}
+  if ($ChnlsOn <= 2){ $qastate = QA::ERROR;  $value = "OFF";}
   if ($QA::FwHvOff == 1) { $qastate = QA::OK;}
 
   
index fb19d7e0d6d4f27b4a6868771efe173d0da4c3b8..6e809dd80679c39e5fd237cd8cdff85c43ffcd20 100755 (executable)
@@ -12,6 +12,7 @@ use Perl2Epics;
 use HPlot;
 my $fqa = QA::OpenQAFile();
 
+$ENV{EPICS_CA_AUTO_ADDR_LIST} = 'YES';
 
 my @names = qw( reflowPressureAthm:average reflowPressureCompr reflowInO2  opensysFreshARGON opensysFreshCO2 reflowFreshArgon reflowFreshIsob  CO2:concentration CO2:concentration2 reflowPressureLP );
 my @namesLABEL = qw( AtmosphericPressure reflowPressureCompressor reflow_O2_concentration  planeI_argon_fresh planeI_CO2_frsh reflowFreshArgon reflowFreshCO2   CO2-P1 CO2-P2 LP-pressure );
@@ -269,7 +270,7 @@ Perl2Epics::Connect("Gate" ,"HAD:VAC:beamlineGate");
 print "Connected.\n";
 
 while(1) {
-  my $data = Perl2Epics::GetAll();
+  my $data = Perl2Epics::GetAll(10);
   $str = Hmon::MakeTitle(8, 22, "MDC Gas Pressure", 1, "");
   $str .= "<h4>Chamber differential pressure  [Pa]</h4>\n";
   $str .= "<table class=\"rates \">\n"; #<div id=\"logbox\" class=\"textbox\" >
@@ -377,7 +378,7 @@ while(1) {
   HPlot::PlotDraw("VacuumLow");  
   HPlot::PlotDraw("VacuumHigh");  
 
-  $str = Hmon::MakeTitle(8,12,"Vacuum",0);
+  $str = Hmon::MakeTitle(8,12,"Vacuum",1);
   $str .= qq@<img src="%ADDPNG files/VacuumHigh.png%" type="image/png">\n@;
   $str .= qq@<img src="%ADDPNG files/VacuumLow.png%" type="image/png"><br>@;
   $str .= sprintf("Low Vacuum %.2fE-7 mbar</br>",$data->{"Vaclow"}->{val}*1E7);
@@ -402,7 +403,7 @@ while(1) {
   if ($data->{"Gate"}->{tme}==-1) {
     $msg="ERROR";
     $longmsg.="<br>No Data";
-    $qastat = QA::WARN_2;
+    $qastat = QA::ERROR;
     }      
   elsif ($data->{"Gate"}->{val}!=1) {
     $msg="ERROR";
@@ -410,10 +411,9 @@ while(1) {
     $qastat = QA::ERROR;
     }      
 
-  QA::WriteQALog($fqa, "hv2", "valve", 60, $qastat, "Vacuum", $msg, $longmsg);  
+  QA::WriteQALog($fqa, "misc", "valve", 60, $qastat, "Vacuum", $msg, $longmsg);  
   
   $timer++;
-  sleep(10);
   }
 
 
index 9b5f169372f6e6b08b2806ab0fc8793e60017fa9..fac078970c3feed9a767a29738fd7cee4a6fb8bc 100755 (executable)
@@ -6,17 +6,20 @@ use v5.10.0;
 
 
 my @cpus = qw |
-hades30 hades33 hadesdaqp02 hadesdaqp03 hadesdaqp04 hadesp28 hadesp30 hadesp31 hadesp33 hadesp57 hadesp63 hadesp66 hadesp70 lxhaddcs05p lxhaddcs06p lxhaddcs10p lxhaddcs11p lxhaddcs12p lxhaddcs13p lxhadeb07p lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb13p lxhadeb14p lxhadeb15p lxhadeb16p lxhadesdaqp
+hades30 hades33 hadesdaqp02 hadesdaqp03 hadesdaqp04 hadesp28 hadesp30 hadesp31 hadesp33 hadesp57 hadesp63 hadesp66 hadesp70 lxhaddcs10p lxhaddcs11p lxhaddcs12p lxhaddcs13p lxhadeb07p lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb13p lxhadeb14p lxhadeb15p lxhadeb16p lxhadesdaqp lxhadeb18p lxhadeb17p
 |;
 
 #lxhadeb07 lxhadeb08 lxhadeb09 lxhadeb10 lxhadeb11 lxhadeb12 lxhadeb13 lxhadeb14 lxhadeb15 lxhadeb16  lxhaddcs05 lxhaddcs06 lxhaddcs11 lxhadesdaq hadesdaq01 hades30 ha#desp31 hades33 lxhadeb07p lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb13p lxhadeb14p lxhadeb15p lxhadeb16p lxhaddcs05p lxhaddcs06p lxhaddcs11p lxhad#esdaqp hadesdaqp02 hadesdaqp03 hadesdaqp04 hadesp30 hadesp33 hadesp57 hadesp70
 
 for my $cpu (@cpus) {
-  my $c = "~/trbsoft/hadesdaq/hmon/hmon_ssh hadaq\@$cpu -N -f </dev/null >/dev/null&";
+  my $c = "~/trbsoft/hadesdaq/hmon/hmon_ssh $cpu -N -f </dev/null >/dev/null&";
 
   if ($cpu =~ /hadesp28/) {
     $c=~s/hadaq\@/magnet\@/;
   }
+  if ($cpu =~ /hades13p/) {
+    $c=~s/hadaq\@/hades-qa\@/;
+  }
   #my $c = "~/trbsoft/hadesdaq/hmon/hmon_ssh hadaq\@$cpu -N -f";
   print "command: $c\n";
   system($c);
index 9834b3c931417b1dd7109a1c90ee9e1ee7f2c1c1..fe576f13582e17ef20682c3b696e1bd70dda0740 100755 (executable)
@@ -77,12 +77,12 @@ $files-> { "Main" } = [  "MainTrigger" ,  "MainTriggerTrend" ,  "MainPTScaler" ,
 # $files-> { "PionTrackerRaw" } = [  "Mult" ,  "TS" ,  "Strip" ,  "Pileup" ,  "Overflow" ,  "ADCStrip" ,  "TSStrip" ,  "XY" ,  "RawPTHodoDt"  ];
 # $files-> { "PionTrackerCal" } = [  "CalTS" ,  "CalADCStrip" ,  "CalTSStrip" ,  "CalPTHodoDt"  ];
 $files-> { "Start" } = [  "StartMain",  "StartTestEfficiency", "StartTestRawStripToT",  "StartTestTDIFFvsTOTmod0", "StartTestTDIFFvsTOTmod1" ];
-$files-> { "InnerTOF" } = [  "InnerTofMultiplicity", "InnerTofRawHitPattern",  "InnerTofRawHitPatternWithSum"];
+#$files-> { "InnerTOF" } = [  "InnerTofMultiplicity", "InnerTofRawHitPattern",  "InnerTofRawHitPatternWithSum"];
 
-$files-> { "Hodo" } = [  "HODOMain"  ];
-$files-> { "ForwardDet" } = [  "StrawCounts", "StrawToT",  "StrawLeadTime", "ToT", "DriftTime", "Multiplicity"];
+#$files-> { "Hodo" } = [  "HODOMain"  ];
+#$files-> { "ForwardDet" } = [  "StrawCounts", "StrawToT",  "StrawLeadTime", "ToT", "DriftTime", "Multiplicity"];
 
-$files-> { "RICH" } = [  "RICHMult" ,  "RICHCharge" ,  "RICHColRow" ,  "RICHHitMult" ,  "RICHDirClus"  ];
+$files-> { "RICH" } = [  "RICHMult" ,  "RICHCharge" ,  "RICHColRow" ,  "RICHHitMult" ,  "RICHDirClus", "Cals", "CalsXY", "EdgeInfo", "LaserMult" , "NofPerEvent", "RawHits", "RawMult", "SecLaserTrend","SecMultCals","SecMultRings","SingleEvent" ];
 $files-> { "MDCMon" } = [  "MDCMain" ,  "Errors"  ];
 $files-> { "MDCTimes" } = [  "potato"  ];
 $files-> { "MDCExpert" } = [  "Hits" ,  "MDCL0" ,  "MDCL1" ,  "MDCL2" ,  "MDCL3" ,  "MDCMboNoise" ,  "MDCT0" ,  "MDCT1" ,  "MDCT2" ,  "MDCT3" ,  "MDCMb" ,  "MDCMboTrend" ,  "MDCMbTCal0" ,  "MDCMbTCal1" ,  "MDCMbTCal2" ,  "MDCMbTCal3" ,  "MDCCalStat" ,  "MDCErrStat"  ];
@@ -91,9 +91,9 @@ $files-> { "MDCTimesRaw" } = [  "MDCTimesRaw0" ,  "MDCTimesRaw1" ,  "MDCTimes2Ra
 $files-> { "TOFMon" } = [  "TOFMain" ,  "TOFADC" ,  "TOFTDC" ,  "TOFHIT"  ];
 $files-> { "RPC" } = [  "RPCMain" ,  "RPCRawRPCMult" ,  "RPCRawSecMult" ,  "RPCRawColCellMult" ,  "RPCRawColCellMult2" ,  "RPCRawHitsTrend" ,  "RPCRawChargeDiff" ,  "RPCFeeTrbMbo" ,  "RPCFeeMboDbo" ,  "RPCFeeTrbChannel" ,  "RPCRpcHit" ,  "RPCRpcShower"  ];
 $files-> { "WALLMon" } = [  "WALLMain" ,  "WALLHit" ,  "WALLControl" ,  "WALLControlLATCH"  ];
-# $files-> { "SHOWERMon" } = [  "SHOWERMain" ,  "SHOWERMults" ,  "SHOWERSUMS" ,  "SHOWERCAL" ,  "SHOWERSUMTREND"  ];
 $files-> { "Physics" } = [  "PhysMultCand" ,  "PhysMatch" ,  "PhysMultDist" ,  "PhysBetaMomSys0" ,  "PhysBetaMomSys1" ,  "PhysVertex" ,  "PhysToTmips"  ];
 $files-> { "EcalMon"} = ["RawMult", "SlowTot"];
+$files->{"Trigger"} = qw(MainPTScaler MainTrigger MainTriggerTrend );
 
 # while(1) {
  
index f7a7b3ef97d25d847179083907af193fb67852a8..a6dc3b0e75209d3d92fe3a51b5b2c88b6ccb9045 100755 (executable)
@@ -235,7 +235,7 @@ while(1) {
     }
     
 $qastate = QA::WARN_2 if ($ChnlsOn < 74);
-$qastate = QA::ERROR_2 if ($ChnlsOn == 0);
+$qastate = QA::ERROR if ($ChnlsOn == 0);
 $qastate = QA::NOTE if ($QA::RichHvOff == 1);
 
   if( $timer % (4*$OVERCURRENT_period) == 0) {
index d405dce19cc0c6ad9f6fe39e58d30ca60e0a98ca..a20048364c0f3942aa6ebabcecf2bebda604b856 100755 (executable)
@@ -134,7 +134,7 @@ while(1) {
   
   $longtxt = "All sequencers running" if $longtxt eq "";
   my $value = ((scalar @names)-$count)."/".(scalar @names);  
-  QA::WriteQALog($flog,"misc","sequencer",50,$qastate,"HV Sequencer",$value,$longtxt); 
+  QA::WriteQALog($flog,"hv2","sequencer",50,$qastate,"HV Sequencer",$value,$longtxt); 
   if($qastate == QA::FATAL) {
     if(!($errorcounter%15)){
       Hmon::Speak('nobeam', "High Voltage Control is not working");
index bc74caacb47af78c6e41e5dc13af08e238ec483b..78e5c8be947a5e6a70bfeaeb496079d004680481 100755 (executable)
@@ -84,6 +84,29 @@ HPlot::PlotInit({
     });
 
 
+HPlot::PlotInit({
+    name    => "StartMap",
+    file    => "files/StartMap",
+    title   => "Start Coincidence Rate",
+    entries => 16,
+    curves  => 16,
+    type    => HPlot::TYPE_HEATMAP,
+    output  => HPlot::OUT_PNG,
+    zlabel  => "Hitrate",
+    sizex   => 310,
+    sizey   => 310,
+    nokey   => 1,
+    buffer  => 1,
+    ymin    => 15.5,
+    ymax    => -0.5,
+    xmin    => -0.5,
+    xmax    => 15.5,
+    cbmax   => "100<*<1E5",
+    cbmin   => 1,
+    noinit  => 1,
+    additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"",
+    showvalues => 0, 
+    });
 
 
 my $str  = Hmon::MakeTitle(12, 6, "Beam QFactor",0);
@@ -97,15 +120,24 @@ $str .= qq@<img src="%ADDPNG files/MicroRate10ms.png%" type="image/png"><br>\n@;
 $str .= Hmon::MakeFooter();
 Hmon::WriteFile("MicroSpillStructure",$str);
 
+$str  = Hmon::MakeTitle(4, 7, "StartMap",0);
+$str .= qq@<img src="%ADDPNG files/StartMap.png%" type="image/png"><br>\n@;
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("StartMap",$str);
+
 
-trb_init_ports() or die trb_strerror();
 
+trb_init_ports() or die trb_strerror();
 
+my $old;
+my $oldtime = time();
+my $time = time();
+my $diff;
 my $round = 0;
 while(1) {
 
   
-  my $o = trb_register_read_mem(0xf3c0,0xb810,1,500) or print trb_strerror() or sleep 5 and next;
+  my $o = trb_register_read_mem(0xffff,0xb810,1,500) or print trb_strerror() or sleep 5 and next;
 
   foreach my $b (keys %$o) {
     my $time = 0;
@@ -142,12 +174,12 @@ while(1) {
 #   if($round == 8) {
 #     trb_register_write(0xf3c0,0xb801,0x80000000);
 #     }
-  $o = trb_register_read(0xf3c0,0xb806);
-  if($o->{0xf3c0} == 3) {
-    $o = trb_register_read_mem(0xf3c0,0xb811,1,6000) or print trb_strerror() or sleep 5 and next;
+  $o = trb_register_read(0xffff,0xb806);
+  if($o->{0xffff} == 3) {
+    $o = trb_register_read_mem(0xffff,0xb811,1,6000) or print trb_strerror() or sleep 5 and next;
   
-    trb_register_write(0xffff,0xb805,200000); #50000 = 1s offset to spill start
-    trb_register_write(0xffff,0xb804,0x00003559); #Only  5000/5001 as source
+#    trb_register_write(0xffff,0xb805,200000); #50000 = 1s offset to spill start
+#    trb_register_write(0xffff,0xb804,0x00003559); #Only  5000/5001 as source
 
     
     foreach my $b (keys %$o) {
@@ -159,7 +191,34 @@ while(1) {
     HPlot::PlotDraw('MicroRate');
     HPlot::PlotDraw('MicroRate10ms');
     }
-  
+
+  $o = trb_register_read_mem(0xffff,0xba00,0,256) or print trb_strerror() or sleep 5 and next;
+
+  if (defined $old) {
+    my $tdiff = (time() - $oldtime)|1;
+    foreach my $b (keys %$o) {
+
+      for my $v (0..255) {
+        my $vdiff = ($o->{$b}->[$v]&0xfffff) - ($old->{$b}->[$v]&0xfffff);
+        
+        if ($vdiff < 0) { $vdiff += 2**20;}
+        $diff->{$b}->[$v] = $vdiff/$tdiff;
+        #$ratesum += $diff->{$b}->[$v+1];
+#         print "$v $diff->{$b}->[$v]\n";
+        HPlot::PlotFill('StartMap',$diff->{$b}->[$v],$v%16,$v/16);
+        }
+
+      }
+    HPlot::PlotDrawFork('StartMap');    
+    
+    
+
+   }
+    
+  $old = $o;
+  $oldtime = time();  
+    
   $round++;
   sleep 1;
   }
old mode 100755 (executable)
new mode 100644 (file)
index b4e9bfc..8cb093d
@@ -21,7 +21,7 @@ use Try::Tiny;
 trb_init_ports() or die trb_strerror();
 
 my $data;
-my $NUMPLOTS = 9;
+my $NUMPLOTS = 10;
 my $SERVER = 'calib';   #calib or calibtest
   
 
@@ -39,7 +39,7 @@ my $SERVER = 'calib';   #calib or calibtest
   my $numboards = $entry;
   $labels .= ') rotate by 90 offset 0,-1.4 font ",6";';
   
-  my @names = qw(LeadingAverage[ns] LeadingSigma[ps] IgnoredOutliers IgnoredHits ToTAverage[ns] ToTSigma[ps] IgnoredToTOutliers IgnoredToT CorrectedHits);
+  my @names = qw(LeadingAverage[ns] LeadingSigma[ps] IgnoredOutliers IgnoredHits ToTAverage[ns] ToTSigma[ps] IgnoredToTOutliers IgnoredToT CorrectedHits ToTShifts[ns]);
   
 HPlot::PlotInit({
   name    => "TdcCalMon0",
@@ -242,7 +242,30 @@ HPlot::PlotInit({
   additional => $labels,#."set logscale cb;",
   showvalues => 0,  });    
 
-while(1){  
+HPlot::PlotInit({
+  name    => "TdcCalMon9",
+  file    => "files/TdcCalMon9",
+  cblabel   => "TdcCalMon ".$names[9],
+  entries => $numboards,
+  curves  => 49,
+  type    => HPlot::TYPE_HEATMAP,
+  output  => HPlot::OUT_PNG,
+  sizex   => 10000,
+  sizey   => 500,
+  nokey   => 1,
+  buffer  => 0,
+  xmin    => -0.5,
+  xmax    => $numboards-0.5,
+  ymin    => -0.5,
+  ymax    => 48.5,
+  noinit  => 1,
+  cbmin   => 0,
+  cbmax   => 50,
+  palette => 'defined (0 "#33ff00", 0.000001 "#ff0000", 21 "#ff0000", 21.6 "#ff5500", 22 "#00ff00", 43 "yellow", 44 "red", 50 "red")',
+  additional => $labels,#."set logscale cb;",
+  showvalues => 0,  });    
+
+# while(1){  
 ###################################################################################################  
   #loop until run is finished
   print "Wait for end of analysis run\n";
@@ -254,11 +277,12 @@ while(1){
     $evnum =  $eventhist->{bins}[13];
     print "run".$evnum."\n";
     sleep 10;
-    }while($evnum == 0 || $evnum != $oldevnum);
+    }while(($oldevnum == 0 || $evnum == 0 || $evnum != $oldevnum));
 
 ###################################################################################################  
   print "End detected. Start to work\n";
-
+  Hmon::Speak('caltest',"Calibration Test: Root analysis finished.");
+  
   my $str  = Hmon::MakeTitle(200, 110, "TDC Cal Mon",1);
   $str .= '<p>'.QA::getTimeString().'</p>';
   $str .= '<p> Working</p>';
@@ -284,13 +308,20 @@ while(1){
        $p = $datahistlist->{'_allnames'}{$p};
     my $corr = getroothist($SERVER,$p)    if($p)   ;
     next unless $corr;
-    
+
+       $p = sprintf("TDC_%04X_TotShifts",$b);
+       $p = $datahistlist->{'_allnames'}{$p};
+    my $shifts = getroothist($SERVER,$p)    if($p)   ;
+    next unless $shifts;
+        
     for(my $i=1;$i<=48;$i++) {
       next unless $activechannels & (1<<($i-1));
-      next if($b >= 0x5000 && $b < 0x5008 && !($i&1)); 
+#      next if($b >= 0x5000 && $b < 0x5008 && !($i&1)); 
       
       my $avg = ($corr->{bins}[$i]//0) / ($hits->{bins}[$i*2]||1);
       HPlot::PlotFill("TdcCalMon8",$avg,$entry,$i);
+      HPlot::PlotFill("TdcCalMon9",$shifts->{bins}[$i]//0,$entry,$i);
+
       }
     }
   
@@ -307,7 +338,7 @@ while(1){
       
       for(my $i=1;$i<=48;$i++) {
         next unless $activechannels & (1<<($i-1));
-        next if($b < 0x5008 && $b >= 0x5000 && !($i&1)); 
+#        next if($b < 0x5008 && $b >= 0x5000 && !($i&1)); 
         
         my ($sum,$avg,$sigma,$outlier,$ignored) = stats($d->{bins}[$i]);
         
@@ -329,10 +360,11 @@ while(1){
       
       for(my $i=1;$i<=48;$i++) {
         next unless $activechannels & (1<<($i-1));
-        next if($b >= 0x5000 && $b < 0x5008 && !($i&1)); 
+#        next if($b >= 0x5000 && $b < 0x5008 && !($i&1)); 
         
-        my ($sum,$avg,$sigma,$outlier,$ignored) = stats($d->{bins}[$i],1460,1540) if ($b < 0x7000);
+        my ($sum,$avg,$sigma,$outlier,$ignored) = stats($d->{bins}[$i],1460,1540) if ($b < 0x7000 && $b >= 0x5100);
            ($sum,$avg,$sigma,$outlier,$ignored) = stats($d->{bins}[$i],960,1040) if ($b >= 0x7000);
+           ($sum,$avg,$sigma,$outlier,$ignored) = stats($d->{bins}[$i],960,1040) if ($b >= 0x5000 && $b <= 0x50ff);
         
         $avg = ($avg/50);
         $sigma = ($sigma*20);
@@ -359,16 +391,17 @@ while(1){
     }
   $str .= Hmon::MakeFooter();
   Hmon::WriteFile("TdcCalMon",$str);  
+  Hmon::Speak('caltest2',"Calibration Test: H-mon analysis finished.");
 
 
-  do{
-    $oldevnum = $evnum;
-    $eventhist = getroothist($SERVER,"/HADES/Run/HLD/HLD_EvType");
-    $evnum =  $eventhist->{bins}[13];
-    print "wait".$evnum."\n";
-    sleep 5;
-    }while($evnum == $oldevnum);
-}
+  do{
+    $oldevnum = $evnum;
+    $eventhist = getroothist($SERVER,"/HADES/Run/HLD/HLD_EvType");
+    $evnum =  $eventhist->{bins}[13];
+    print "wait".$evnum."\n";
+    sleep 5;
+    }while($evnum == $oldevnum);
+}
 
 
     
index 746513c84317bb7f3490bf3d57f01671fb876329..29dead615eab5271497d1efd697bbe13c54f0211 100755 (executable)
@@ -7,43 +7,50 @@ use Hmon;
 use QA;
 
 my $inhibit = 0;
-$SIG{USR1}  = sub { $inhibit = 1; };
-$SIG{USR2}  = sub { $inhibit = 0; system("killall espeak");}; #system("espeak -ven-male2 -s 130 -g 1 \"Speech daemon is online\" 2>/dev/null");
+$SIG{USR1}  = sub { $inhibit = 1; }; #system("killall larynx");};
+$SIG{USR2}  = sub { $inhibit = 0; }; #system("espeak -ven-male2 -s 130 -g 1 \"Speech daemon is online\" 2>/dev/null");
 
 # my $fq = QA::OpenQAFile();
-my $cmd = "ssh hades33 /home/hadaq/trbsoft/daq/hmon/hmon_tail -n 0 -F /home/hadaq/trbsoft/hadesdaq/hmon/files/speaklog";
+my $cmd = "LANG=en_US.UTF-8 ssh hadesp33 /home/hadaq/trbsoft/daq/hmon/hmon_tail -n 0 -F /home/hadaq/trbsoft/hadesdaq/hmon/files/speaklog";
 
 # my $fq = "remote";
 # my $cmd = "./hmon_ssh -T $QA::QAServer \"tail -n 0 -F /home/hadaq/trbsoft/daq/tools/hmon/files/speaklog\" </dev/null";
 
-my $f = fork();
+my $f = fork();
 
+#         system("espeak -vus-mbrola-1 -s125  \"$a\" 2>/dev/null #-ven+m2 -s 130 -g 1 ");  -ven-us+f2 -p50 -s120
+#        system("espeak -ven-us+f2 -p60 -s150 -g 1 \"oh-oh -- $a\" 2>/dev/null");
+#        system("espeak-ng -ven-german -s140 -p 90 \"$a\" 2>/dev/null");
+#        system("espeak  -s120 -p 90 \"$a\" 2>/dev/null");
 
-if($f) {
+
+#while(1) {
+  my $fn = "LANG=en_US.UTF-8 larynx -v southern_english_male --length-scale 1 --interactive 2>&1";
+  open my $fh, "|$fn" or  die "error: no larynx";
+  $fh->autoflush(1);
+  
   while(1) {
-    open(FTRB, "$cmd|");
+    open(FTRB, "$cmd|");    
     while(my $a = <FTRB>) {
       if ($inhibit == 0) {
-#         system("espeak -vus-mbrola-1 -s125  \"$a\" 2>/dev/null #-ven+m2 -s 130 -g 1 ");  -ven-us+f2 -p50 -s120
-#        system("espeak -ven-us+f2 -p60 -s150 -g 1 \"oh-oh -- $a\" 2>/dev/null");
-        system("espeak-ng -ven-german -s140 -p 90 \"$a\" 2>/dev/null");
-#        system("espeak  -s120 -p 90 \"$a\" 2>/dev/null");
+        print $fh ": ".$a ;
+        sleep 3;
         }
       }
     }
-  }
-else {
-  while(1) {
-    if($inhibit == 0) {
-#       QA::WriteQALog($fq, "main", "speech", 120, QA::OK,
-#                     "Speech Output", "running", "The speech daemon is running.");
-      }
-    else {
-#       QA::WriteQALog($fq, "main", "speech", 120, QA::WARN,
-#                     "Speech Output", "muted", "The speech daemon is muted.");
-      }
-    sleep 60;
-    }
-  }
+  }
+else {
+  while(1) {
+    if($inhibit == 0) {
+#       QA::WriteQALog($fq, "main", "speech", 120, QA::OK,
+#                     "Speech Output", "running", "The speech daemon is running.");
+      }
+    else {
+#       QA::WriteQALog($fq, "main", "speech", 120, QA::WARN,
+#                     "Speech Output", "muted", "The speech daemon is muted.");
+      }
+    sleep 60;
+    }
+  }
  
 
index 3baf55100f79e21d11cbebaf77a7b3c2be83a0c4..9a7028495eb3747b414add6013aafedf90fd2018 100755 (executable)
@@ -8,7 +8,7 @@ use QA;
 
 my $inhibit = 0;
 $SIG{USR1}  = sub { $inhibit = 1; };
-$SIG{USR2}  = sub { $inhibit = 0; system("killall espeak");}; #system("espeak -ven-male2 -s 130 -g 1 \"Speech daemon is online\" 2>/dev/null");
+$SIG{USR2}  = sub { $inhibit = 0; system("killall larynx");}; #system("espeak -ven-male2 -s 130 -g 1 \"Speech daemon is online\" 2>/dev/null");
 
 # my $fq = QA::OpenQAFile();
 my $cmd = "ssh hades33 /home/hadaq/trbsoft/daq/hmon/hmon_tail -n 0 -F /home/hadaq/trbsoft/hadesdaq/hmon/files/speaklog_mdc";
@@ -16,34 +16,40 @@ my $cmd = "ssh hades33 /home/hadaq/trbsoft/daq/hmon/hmon_tail -n 0 -F /home/hada
 # my $fq = "remote";
 # my $cmd = "./hmon_ssh -T $QA::QAServer \"tail -n 0 -F /home/hadaq/trbsoft/daq/tools/hmon/files/speaklog\" </dev/null";
 
-my $f = fork();
+# my $f = fork();
+
+#         system("espeak -vus-mbrola-1 -s125  \"$a\" 2>/dev/null #-ven+m2 -s 130 -g 1 ");  -ven-us+f2 -p50 -s120
+#        system("espeak -ven-us+f2 -p60 -s150 -g 1 \"oh-oh -- $a\" 2>/dev/null");
+#        system("espeak-ng -ven-german -s140 -p 90 \"$a\" 2>/dev/null");
+#        system("espeak  -s120 -p 90 \"$a\" 2>/dev/null");
 
 
-if($f) {
+# if($f) {
+  my $fn = "larynx -v southern_english_male  --length-scale 1.2 --interactive 2>&1";
+  open my $fh, "|$fn" or  die "error: no larynx";
+  $fh->autoflush(1);
+  
   while(1) {
-    open(FTRB, "$cmd|");
+    open(FTRB, "$cmd|");    
     while(my $a = <FTRB>) {
       if ($inhibit == 0) {
-#         system("espeak -vus-mbrola-1 -s125  \"$a\" 2>/dev/null #-ven+m2 -s 130 -g 1 ");  -ven-us+f2 -p50 -s120
-#        system("espeak -ven-us+f2 -p60 -s150 -g 1 \"$a\" 2>/dev/null");
-        system("espeak-ng -ven-german -s140 -p 90 \"$a\" 2>/dev/null");
-#        system("espeak  -s120 -p 90 \"$a\" 2>/dev/null");
+        print $fh $a ;
         }
       }
     }
-  }
-else {
-  while(1) {
-    if($inhibit == 0) {
-#       QA::WriteQALog($fq, "main", "speech", 120, QA::OK,
-#                     "Speech Output", "running", "The speech daemon is running.");
-      }
-    else {
-#       QA::WriteQALog($fq, "main", "speech", 120, QA::WARN,
-#                     "Speech Output", "muted", "The speech daemon is muted.");
-      }
-    sleep 60;
-    }
-  }
+  }
+else {
+  while(1) {
+    if($inhibit == 0) {
+#       QA::WriteQALog($fq, "main", "speech", 120, QA::OK,
+#                     "Speech Output", "running", "The speech daemon is running.");
+      }
+    else {
+#       QA::WriteQALog($fq, "main", "speech", 120, QA::WARN,
+#                     "Speech Output", "muted", "The speech daemon is muted.");
+      }
+    sleep 60;
+    }
+  }
  
 
index 1188c834e062091136b3f189b52e5a060c9ffd8d..f43806c477ae71ceab43234352a9b49ea56ba83d 100755 (executable)
@@ -3,7 +3,9 @@
 #Mount RAM file system
 #mount -t tmpfs none /var/spool/ramdisk  -o size=256m
 
-export PERL5LIB="./"
+source ~/.bashrc
+
+#export PERL5LIB="./:/home/hadaq/soft/EPICS/EPICS-7.0.7/base/lib/perl/"
 
 mkdir /dev/shm/hmon
 #Kill old tunnel, make new one. Better: Check if tunnel still exists, if not restart.
@@ -45,9 +47,9 @@ mkdir -p `pwd`/pion
 
 #pkill -f "sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/pics"
 fusermount -u qa
-timeout 2 bash -c "sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/pics `pwd`/qa"
+timeout 2 bash -c "sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/feb24/pics `pwd`/qa"
 fusermount -u vertex
-timeout 2 bash -c "sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/feb22/vertex/pics `pwd`/vertex"
+timeout 2 bash -c "sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/feb24/vertex/pics `pwd`/vertex"
 
 #pkill -f "sshfs -o allow_other hadaq@hadesp63:/home/hadaq/local/tdcmon/dabc/cal"
 fusermount -u calibration
@@ -74,6 +76,7 @@ ln -fs `pwd`/mdc.png /srv/www/htdocs/mon/
 ln -fs `pwd`/background.png /srv/www/htdocs/mon/files/
 ln -fs `pwd`/QA.pm /srv/www/htdocs/mon/
 ln -fs `pwd`/styles.css files/
+ln -fs `pwd`/stylesmonitor.css files/
 #ln -fs `pwd`/indexstyles.css files/
 ln -fs `pwd`/ecal_drawing.htm /srv/www/htdocs/mon/
 ln -fs `pwd`/rich_drawing.htm /srv/www/htdocs/mon/
@@ -124,6 +127,7 @@ rm ~/trbsoft/hadesdaq/hmon/files/note.htt
 
 #ssh hadesp57 'cd /home/hadaq/trbsoft/daq/hmon/; PERL5LIB=. ./speakdaemon.pl 1>/dev/null 2>>/home/hadaq/trbsoft/hadesdaq/hmon/logs/perlerror_speakdaemon' &
 ssh hadesp33 'cd /home/hadaq/trbsoft/daq/hmon/; PERL5LIB=. ./speakdaemon.pl 1>/dev/null 2>>/home/hadaq/trbsoft/hadesdaq/hmon/logs/perlerror_speakdaemon' &
+ssh hadesp33 'cd /home/hadaq/trbsoft/daq/hmon/; PULSE_SINK=Virtual1 PERL5LIB=. ./speakdaemon_mdc.pl 1>/dev/null 2>>/home/hadaq/trbsoft/hadesdaq/hmon/logs/perlerror_speakdaemon_mdc' &
 
 sleep 1;
 # echo "  <Hmon>     Done."
index ba2289f5711ed1998252885a8c55a7109625a0f2..a5611f5a064f463db382ce8c8e2b9c2fd19133a5 100755 (executable)
@@ -5,6 +5,7 @@ echo "  <Hmon>    Killing all sub-processes..."
 pkill -f "\./hmon_.+\.pl" 2>/dev/null 1>/dev/null
 pkill -f "sh -c \./hmon_.*\.sh"
 pkill -f "/usr/bin/perl -w \./speakdaemon.pl"
+pkill -f "/usr/bin/perl -w \./speakdaemon_mdc.pl"
 pkill -f "/usr/bin/perl -w \./hmon_.*\.sh"
 pkill -f "hmon_tail -n"
 #pkill -f "hmon_ssh"  # don't do that for a normal daq-restart
index b73ea5ab247137e0a35ea3b227ba34cc60b0dc49..a423f9f97e99fa317a1d9067c6fce451ba965153 100755 (executable)
@@ -1,9 +1,11 @@
 #!/bin/bash
-
+source ~/.bashrc
 
 killall hmon_permanent_tail
 cd permanent
 killall hmon*.pl 2>/dev/null 1>/dev/null
+pkill -f "/usr/bin/perl -w \./speakdaemon.pl"
+pkill -f "/usr/bin/perl -w \./speakdaemon_mdc.pl"
 cd ../
 
 pkill -f "sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/pics"
index 2f30c7383cb1ef4775d2f20701a8602868e20fbc..c32303b98cf514f2283c0fb11cc6e13d511f2a11 100644 (file)
@@ -1,3 +1,7 @@
+.monitor{  
+  scrollbar-width:none;
+  }
+
 body {
   font-family:sans-serif;
   background:#346;/*#def;*/
@@ -8,7 +12,7 @@ body {
   }
 
 body>div>div {
-  float:left;
+/*   float:left; */
   margin: 0px 2px 0px 0;
   padding: 0 0 10px 0 ;
   border: 1px solid #777;
@@ -75,16 +79,31 @@ div.errorstamp {
 
 
 div#content {
-    -moz-transform-origin:0 0;
-    -moz-transform:scale(1);  
+    //-moz-transform-origin:0 0;
+   //-moz-transform:scale(1);  
 }
 
 div#contentback {
   z-index : -1;
+}
+
+
+div#content, div#contentback {
+  justify-content: space-evenly;
+  display:flex;
+  flex-wrap:wrap;
+/*   width:100%; */
   position:absolute;
+
 }
 
-  
+div#contentinner {
+  justify-content: space-evenly;
+  display:flex;
+  flex-wrap:wrap;
+}
+
+
 /*
   //plus 24 in width, plus 29 in height for each size step. 
   //base is 70x40, 80x50 with border
index 9ecbfd4fd493e3140c2e139a4a5ee6a881f390b4..7e37b3a903894c6eb2f2a4989f119db2d62041f3 100644 (file)
@@ -9,16 +9,34 @@ use Data::Dumper;
 # use lib '/home/hadaq/soft/EPICS/EPICS-3.16.1/base/' . '/lib/perl';
 # use lib '/home/epics/EPICS/EPICS-3.16.1/base/' . '/lib/perl';
 # use lib '/home/hadaq/soft/EPICS/EPICS-7.0.1.1/base/' . '/lib/perl';
-use lib '/home/hadaq/soft/EPICS/EPICS-7.0.7/base/lib/perl/';
-use CA;
+# use lib '/home/hadaq/soft/EPICS/EPICS-7.0.7/base/lib/perl/';
+
+
+#my $find_epics_command =q|bash -c '. /home/hadaq/local/bin/epics'|;
+my $find_epics_command =q|bash -c '. epics'|;
+my @find_epics_result = qx($find_epics_command);
+#print Dumper @find_epics_result;
+my ($EPICS_BASE)= grep(/^EPICS_BASE /, @find_epics_result);
+#print Dumper $EPICS_BASE;
+my @temp_split=split /\s+/, $EPICS_BASE;
+$EPICS_BASE = $temp_split[3];
+
+#print "found EPICS_BASE: $EPICS_BASE\n";
+my $ca_lib_path = $EPICS_BASE . '/lib/perl/';
+#print "ca_lib_path: $ca_lib_path\n";
+#use lib $ca_lib_path;
+#use lib '/home/hadaq/EPICS/EPICS-3.15.6/base/lib/perl/';
+#use CA;
+require "$ca_lib_path/CA.pm";
+CA->import;
 
 #JAM 2020: back to default after EBs are done with epics
 # $ENV{EPICS_CA_AUTO_ADDR_LIST} = 'YES';
 $ENV{EPICS_CA_AUTO_ADDR_LIST} = 'NO';
 
 #JoF2022: updated during beamtime
-$ENV{EPICS_CA_ADDR_LIST} = "cryo1.hades.gsi.de lxhadeb07p frpcpid1 lxhaddcs05p lxhaddcs06p lxhaddcs10p lxhaddcs11p lxhaddcs12p lxhaddcs13p gas.hades.gsi.de richhvcrate";
-# $ENV{EPICS_CA_ADDR_LIST} = "192.168.111.255";
+$ENV{EPICS_CA_ADDR_LIST} = "cryo1.hades.gsi.de frpcpid1 lxhaddcs10p lxhaddcs11 lxhaddcs12p lxhaddcs13p gas.hades.gsi.de richhvcrate";
+# $ENV{EPICS_CA_ADDR_LIST} = "192.168.111.255"; lxhadeb07p lxhaddcs05p lxhaddcs06p
 #$ENV{EPICS_CA_ADDR_LIST} = "192.168.103.182 192.168.100.235 192.168.100.236 192.168.97.10 192.168.97.11 192.168.97.14 192.168.97.15 192.168.100.17 192.168.97.4 192.168.100.216";
 
 #JAM2018: updated after network mask redefinition:
@@ -44,7 +62,7 @@ my $errcnt = {};
 
 sub callback {
     my ($chan, $status, $data) = @_;
-#    print Dumper $data;
+#     print Dumper $data;
     if ($status) {
        printf "%-30s %s\n", $chan->name, $status;
     } 
@@ -67,7 +85,7 @@ sub Connect {
     my ($title, $varname, $type, $wait) =  @_;
     #   push(@EpicsChans,CA->new($name));
     #   $EpicsChans[-1]->create_subscription('v', \&callback, 'DBR_TIME_DOUBLE');
-    ## print $varname."\n";
+#     print $varname."\n";
     $type = 'DBR_TIME_DOUBLE' unless defined $type;
     $EpicsStore->{$varname}->{tme} = [];
     $EpicsStore->{$varname}->{val} = [];
@@ -92,12 +110,14 @@ sub Update {
 
 
 sub GetAll {
+    my ($delay) =  @_;
     my $store = {};
     my $time;
     my $val;
+    my $diffflag = -1;#undefined difference
     
     #Update(0.001);
-    Update(0.2);
+    Update($delay || 0.2);
     
     foreach my $el (keys %{$EpicsNames}) {
        my $varname = $EpicsNames->{$el};
@@ -112,15 +132,21 @@ sub GetAll {
        if(!$success) {
            $time = -1;
            $val  = 0;
-       } elsif (scalar @{$EpicsStore->{$varname}->{tme}} > 0) {
+       } elsif (scalar @{$EpicsStore->{$varname}->{tme}} == 1) {
            $time = (@{$EpicsStore->{$varname}->{tme}})[-1];
            $val  = (@{$EpicsStore->{$varname}->{val}})[-1];
+    } elsif (scalar @{$EpicsStore->{$varname}->{tme}} > 1) {
+        $time = (@{$EpicsStore->{$varname}->{tme}})[-1];
+        $val  = (@{$EpicsStore->{$varname}->{val}})[-1];
+        my $oldval = (@{$EpicsStore->{$varname}->{val}})[-2];
+        $diffflag = ( ($val - $oldval) == 0 ) ? 0 : 1;
        } else {
            $time = $EpicsStore->{$varname}->{lasttime};
            $val  = $EpicsStore->{$varname}->{lastval};
        }
-       $store->{$el}->{tme} = $time;
-       $store->{$el}->{val}  = $val;
+       $store->{$el}->{tme}      = $time;
+    $store->{$el}->{val}      = $val;
+       $store->{$el}->{diffflag} = $diffflag;
        $EpicsStore->{$varname}->{lasttime} = $time;
        $EpicsStore->{$varname}->{lastval}  = $val;
     }
diff --git a/nettools/Perl2Epics2.pm b/nettools/Perl2Epics2.pm
new file mode 100644 (file)
index 0000000..b11448a
--- /dev/null
@@ -0,0 +1,302 @@
+package Perl2Epics2;
+use warnings;
+use strict;
+use Data::Dumper;
+# use Hmon;
+
+# use lib '/home/scs/EPICS/EPICS-3.14.12.4/base/' . '/lib/perl';
+# use lib '/home/hadaq/EPICS/EPICS-3.15.6/base' . '/lib/perl';
+# use lib '/home/hadaq/soft/EPICS/EPICS-3.16.1/base/' . '/lib/perl';
+# use lib '/home/epics/EPICS/EPICS-3.16.1/base/' . '/lib/perl';
+# use lib '/home/hadaq/soft/EPICS/EPICS-7.0.1.1/base/' . '/lib/perl';
+use lib '/home/hadaq/soft/EPICS/EPICS-7.0.7/base/lib/perl/';
+use CA;
+
+#JAM 2020: back to default after EBs are done with epics
+# $ENV{EPICS_CA_AUTO_ADDR_LIST} = 'YES';
+$ENV{EPICS_CA_AUTO_ADDR_LIST} = 'NO';
+
+#JoF2022: updated during beamtime
+$ENV{EPICS_CA_ADDR_LIST} = "cryo1.hades.gsi.de lxhadeb07p frpcpid1 lxhaddcs05p lxhaddcs06p lxhaddcs10p lxhaddcs11p lxhaddcs12p lxhaddcs13p gas.hades.gsi.de richhvcrate";
+# $ENV{EPICS_CA_ADDR_LIST} = "192.168.111.255";
+#$ENV{EPICS_CA_ADDR_LIST} = "192.168.103.182 192.168.100.235 192.168.100.236 192.168.97.10 192.168.97.11 192.168.97.14 192.168.97.15 192.168.100.17 192.168.97.4 192.168.100.216";
+
+#JAM2018: updated after network mask redefinition:
+#$ENV{EPICS_CA_ADDR_LIST} = "192.168.111.255 192.168.111.255:10012 192.168.111.255:10008 192.168.111.255:10003 192.168.111.255:10002 192.168.111.255:10001 192.168.111.255:10014 192.168.111.255:10007 192.168.111.255:10004 192.168.111.255:10010 192.168.111.255:10013 192.168.111.255:10015 192.168.111.255:10016 192.168.111.255:10009 192.168.111.255:10005 192.168.103.83:10011 192.168.111.255:10006 localhost";
+#$ENV{EPICS_CA_ADDR_LIST} = "192.168.111.255:10006 192.168.111.255:10010 192.168.111.255:10011 192.168.111.255:10012 192.168.111.255:10013 192.168.111.255:10014 192.168.111.255:10015 192.168.111.255:10016 192.168.111.255:10017 192.168.111.255:10018 192.168.111.255:10019";
+#$ENV{EPICS_CA_ADDR_LIST} = "192.168.103.83:10000 192.168.103.83:10008 192.168.103.83:10003 192.168.103.83:10002 192.168.111.255:10001";
+#$ENV{EPICS_CA_ADDR_LIST} = "192.168.103.83 192.168.103.83:10012 192.168.103.83:10008 192.168.103.83:10003 192.168.103.83:10002 192.168.103.83:10001 192.168.103.83:10014 192.168.103.83:10007 192.168.103.83:10004 192.168.103.83:10010 192.168.103.83:10013 192.168.103.83:10015 192.168.103.83:10016 192.168.103.83:10009 192.168.103.83:10005 192.168.103.83:10011 192.168.103.83:10006 localhost";
+
+#hotfix PZ 2022-02-14
+#$ENV{EPICS_CA_ADDR_LIST} = "192.168.111.255";
+#$ENV{EPICS_CA_AUTO_ADDR_LIST} = 'NO';
+
+#
+# JAM added fixed port numbers of EB epics
+#$ENV{EPICS_CA_ADDR_LIST} = "192.168.103.255 192.168.103.255:10012 192.168.103.255:10008 192.168.103.255:10003 192.168.103.255:10002 192.168.103.255:10001 192.168.103.255:10014 192.168.103.255:10007 192.168.103.255:10004 192.168.103.255:10010 192.168.103.255:10013 192.168.103.255:10015 192.168.103.255:10016 192.168.103.255:10009 192.168.103.255:10005 192.168.103.255:10011 192.168.103.255:10006 localhost";
+#$ENV{EPICS_CA_ADDR_LIST} = "192.168.100.11 192.168.100.12 192.168.100.13 192.168.100.14 192.168.100.15 localhost";
+
+my $EpicsStore = {};
+my $EpicsNames = {};
+my $errcnt = {};
+
+sub callback {
+    my ($chan, $status, $data) = @_;
+    # print("callback\n");
+    # print $chan->name."\n";
+    # print Dumper $data;
+    if ($status) {
+       printf "%-30s %s\n", $chan->name, $status;
+    } 
+    else {
+#       print $chan->name . ": $data->{value}\n";
+#       print scalar @{$EpicsStore->{$chan->name}->{tme}}."\n";
+       if(scalar @{$EpicsStore->{$chan->name}->{tme}} > 10) {
+           shift @{$EpicsStore->{$chan->name}->{tme}};
+           shift @{$EpicsStore->{$chan->name}->{val}};
+        }
+       push(@{$EpicsStore->{$chan->name}->{tme}}, $data->{stamp});
+       push(@{$EpicsStore->{$chan->name}->{val}},  $data->{value});
+    $EpicsStore->{$chan->name}->{status} = $data->{status};
+    }
+}
+
+sub callbackStatusUpdate {
+    my ($chan, $status, $data) = @_;
+    # print("callbackStatusUpdate\n");
+    # print($chan." ") if $chan;
+    # print($status." ") if $status;
+    # print($data." ") if $data;
+    if ($status) {
+        printf "%-30s %s\n", $chan->name, $status;
+    } 
+    else {
+        $EpicsStore->{$chan->name}->{status} = $data->{status};
+    }
+}
+
+sub Connect {
+    my ($title, $varname, $type, $delay) =  @_;
+    $type = 'DBR_TIME_DOUBLE' unless defined $type;
+    $EpicsStore->{$varname}->{tme} = [];
+    $EpicsStore->{$varname}->{val} = [];
+    $EpicsStore->{$varname}->{delay} = $delay || 0.05;
+    $EpicsNames->{$title} = $varname;
+    $errcnt->{$varname} = 0;
+    my $success;
+    eval {
+       my $c = CA->new($varname);
+    # print("0 ".$title." ".$varname." ".$c->is_connected()." ".$c->state."\n");
+       CA->pend_io($EpicsStore->{$varname}->{delay});
+    # print("1 ".$title." ".$varname." ".$c->is_connected()." ".$c->state."\n");
+       $c->create_subscription('v', \&callback, $type);
+    # print("2 ".$title." ".$varname." ".$c->is_connected()." ".$c->state."\n");
+    $c->get_callback(\&callbackStatusUpdate, $type, 1);
+    # print("3 ".$title." ".$varname." ".$c->is_connected()." ".$c->state."\n");
+       $EpicsStore->{$varname}->{ca} = $c;
+       $success = $c->is_connected();
+    };
+    return ($success);
+}
+
+sub Update {
+    CA->pend_event($_[0]);
+}
+
+
+sub GetAll {
+    my ($delay) =  @_;
+    my $store = {};
+    my $time;
+    my $val;
+    my $status;
+    
+    #Update(0.001);
+    Update($delay || 0.2);
+    
+    foreach my $el (keys %{$EpicsNames}) {
+       my $varname = $EpicsNames->{$el};
+       my $ca = $EpicsStore->{$varname}->{ca};
+       my $r = $ca->is_connected() if(defined $ca);
+       my $success = 1;
+       if(!$r && (!defined $errcnt->{$el} || $errcnt->{$el} < 2000)) {
+           $success = Connect($el, $varname);
+           $errcnt->{$el}++;
+       }
+    $status = $EpicsStore->{$varname}->{status};
+
+       if(!$success) {
+           $time = -1;
+           $val  = 0;
+        $status = "NOCONN";
+        # print($el." ".$errcnt->{$el}."\n");
+    } elsif (scalar @{$EpicsStore->{$varname}->{tme}} >= 1) {
+        $time = (@{$EpicsStore->{$varname}->{tme}})[-1];
+        $val  = (@{$EpicsStore->{$varname}->{val}})[-1];
+       } else {
+           $time = $EpicsStore->{$varname}->{lasttime};
+           $val  = $EpicsStore->{$varname}->{lastval};
+       }
+    # print($time."\n");
+    # print("curr:".time."\n");
+       $store->{$el}->{tme}        = $time;
+    $store->{$el}->{val}        = $val;
+    $store->{$el}->{status}     = $status;
+       $EpicsStore->{$varname}->{lasttime} = $time;
+       $EpicsStore->{$varname}->{lastval}  = $val;
+    }
+
+
+    return $store;
+}
+
+sub Get {
+    my ($title,$latest) = @_;
+    my $varname = $EpicsNames->{$title};
+    my $time;
+    my $val;
+#   print $varname;
+
+    my $c = $EpicsStore->{$varname}->{ca};
+    my $r = $c->is_connected() if(defined $c);
+
+    my $success = 1;
+    if(!$r) {
+       $success = Connect($title, $varname);
+    }
+
+    if(!$success) {
+       return (-1, 0);
+    }
+
+    #Update(0.00001);
+    Update(0.2);
+    
+    if (scalar @{$EpicsStore->{$varname}->{tme}} > 0) {
+       if(defined $latest && $latest == 1) {
+           $time = (@{$EpicsStore->{$varname}->{tme}})[-1];
+           $val  = (@{$EpicsStore->{$varname}->{val}})[-1];
+       }
+       else {  #if (scalar @{$EpicsStore->{$varname}->{tme}} > 1)
+           $time = shift  (@{$EpicsStore->{$varname}->{tme}});
+           $val  = shift  (@{$EpicsStore->{$varname}->{val}});
+       }
+    }
+    else {
+       $time = $EpicsStore->{$varname}->{lasttime};
+       $val  = $EpicsStore->{$varname}->{lastval};
+    }
+    $EpicsStore->{$varname}->{lasttime} = $time;
+    $EpicsStore->{$varname}->{lastval}  = $val;
+    $time = $time || -1;
+    $val  = $val || 0;
+    return ($time,$val);
+}
+
+sub Put {
+    my ($title, $value) =  @_;
+    my $varname = $EpicsNames->{$title};
+    if (!defined $varname) {
+       return -1;
+    }
+    
+    my $c = $EpicsStore->{$varname}->{ca};
+    my $r = $c->is_connected() if(defined $c);
+    
+    my $success = 1;
+    if(!$r) {
+       $success = Connect($title, $varname);
+    }
+    
+    if(!$success) {
+       return -2;
+    }
+            
+    if (!$c || ($c->element_count()) != 1) {
+       print "5\n";
+       return -3;
+    }
+    
+    my $type = $c->field_type;
+    my @values;
+    if ($type !~ m/ ^DBR_STRING$ | ^DBR_ENUM$ /x) {
+       # Make @ARGV strings numeric
+       push (@values, (map { +$_; } $value));
+    } else {
+       # Use strings
+       push (@values, $value);
+    }
+    $c->put(@values);
+    
+    return 0;
+}
+
+sub TimeSinceLastDataChange {
+    my ($name, $print) = @_;
+    die if !$name or !$EpicsNames->{$name};
+    my @this_vals = @{$EpicsStore->{$EpicsNames->{$name}}->{val}};
+    my @this_times = @{$EpicsStore->{$EpicsNames->{$name}}->{tme}};
+    my $lastval = $this_vals[-1];
+    for (my $i = 2; $i <= scalar @this_vals; $i++) {
+        print("checking -".$i." where ".$this_vals[-$i]." compsto ".$lastval."\n") if defined $print;
+        return (time-$this_times[-$i]) if($this_vals[-$i] != $lastval);
+    }
+    return time-$this_times[-(scalar @this_vals)];
+}
+
+sub IsDataStatusGood {
+    my ($data, $ignoreLOHI) =  @_;
+    if( $data->{status} ) {
+        if($ignoreLOHI) {
+            return 1 if $data->{status} eq "LO";
+            return 1 if $data->{status} eq "LOLO";
+            return 1 if $data->{status} eq "HI";
+            return 1 if $data->{status} eq "HIHI";
+        }
+        return 0 if $data->{status}; #NOCONN and LINK are definite errors but there also exists e.g. LO or LOLO
+    }
+    
+    return 1;
+}
+
+sub ForceCheckIsDataStatusGood {
+    my ($name, $ignoreLOHI) =  @_;
+    my $this_epics = $EpicsStore->{$EpicsNames->{$name}};
+    if(    $this_epics 
+        && $this_epics->{ca} 
+        && $this_epics->{ca}->is_connected()
+    ) {
+        eval{
+            my $this_epics = $EpicsStore->{$EpicsNames->{$name}};
+            $this_epics->{ca}->get();
+            CA->pend_io($this_epics->{delay});
+            return IsDataStatusGood($this_epics->{status}, $ignoreLOHI);
+        };
+        if ($@){
+            $this_epics->{status} = "NOCONN";
+            return 0;
+        }
+    }
+    else {
+        print("EPICS variable $name does not exist");
+        return 0;
+    }
+    
+    return 1;
+}
+
+sub GetDataStatus {
+    my ($name) =  @_; #if name is provided, an update of the data status is pulled (caget)
+    my $this_epics = $EpicsStore->{$EpicsNames->{$name}};
+    if(    $name 
+        && $this_epics
+    ) {
+        return $this_epics->{status};
+    } 
+    else {
+        return "EPICS variable $name does not exist";
+    }
+}
+
+1;
+__END__