]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Update to CBM RICH configuration
authorMichael Traxler <M.Traxler@gsi.de>
Thu, 13 Nov 2014 20:51:48 +0000 (21:51 +0100)
committerMichael Traxler <M.Traxler@gsi.de>
Thu, 13 Nov 2014 20:51:48 +0000 (21:51 +0100)
dmon/scripts/dmon_billboard.pl
dmon/scripts/dmon_padiwatemp.pl
thresholds/thresholds_automatic.pl
thresholds/write_thresholds.pl
users/cern_cbmrich/dmon_config.pl
users/cern_cbmrich/register_config_tdc.db
users/cern_cbmrich/register_configgbe_ip.db
users/cern_cbmrich/startup.sh
users/cern_cbmrich/thresh/thresholds_padiwa_amps.thr [new file with mode: 0644]

index b9d9e1f8fe25a762965fc6912fe9a27e336f7db1..c480cdbd1874fa1d1df3842195905737c8a7db31 100755 (executable)
@@ -10,18 +10,44 @@ use Time::HiRes qw(usleep gettimeofday tv_interval);
 use Dmon;
 use HPlot;
 use Data::Dumper;
+use Perl2Epics;
 
 my %config = Dmon::StartUp();
 my $t0;
 
+for(my $i = 1; $i<=20; $i++) {
+  my $name = sprintf('CBM:PWRSWITCH:GetCurrent%02x',$i);
+  Perl2Epics::Connect("C".$i,$name);
+}
+
 while(1) {
+# update billboard
+  my @billboardValues = ();
+  my $reg;
+
+  my $epicsData = Perl2Epics::GetAll();
+
+  # temp & pressure
+  $billboardValues[0] = 0xdeadc0de;
+
+  # currents
+  for(my $i = 1; $i<=20; $i++) {
+    my $milAmp = $epicsData->{"C".$i}->{"val"} * 1000;
+    $reg = 0 unless $i & 1;
+    $reg |= ($milAmp & 0xffff) << (16 * ($i&1));
+    $billboardValues[$i / 2 + 1] = $reg;
+  }
+
+  trb_register_write_mem($config{BillboardAddress}, 0xb100, 0, \@billboardValues, scalar @billboardValues); # copy data
+  trb_register_write($config{BillboardAddress}, 0xb000, scalar @billboardValues); # commit
+
+# build statistics
   my $title = "Billboard";
   my $longtext='';
   my $value='';
   my $status = Dmon::OK;
 
   my $regs = trb_registertime_read_mem($config{BillboardAddress},0xb000, 0, 5);
-  
   if(defined $regs->{$config{BillboardAddress}}) {
     my $rates = Dmon::MakeRate(0,32,0,$regs);
     if (defined($rates->{$config{BillboardAddress}}{rate}) && $t0) {
@@ -46,6 +72,6 @@ while(1) {
   
   $t0 = [gettimeofday];
   Dmon::WriteQALog($config{flog},"billboard",6,$status,$title,$value,$longtext) if ($longtext);
-  usleep(5e6);
+  usleep(5e5);
 }
 
index 041bfd556d1b19aea5558d4822a69fdc75a95afa..cd61e5d9cf025215659f0c7a64778e137f5c3395 100755 (executable)
@@ -55,7 +55,7 @@ while(1) {
         $max = $temp;
         $maxboard = $b;
         }
-      elsif ($min > $temp) { 
+      if ($min > $temp) { 
         $min = $temp;
         $minboard = $b;
         }
index ff3c8fe51d390aaa245df1ed324fbdd8aee46d97..f753491544c7c7fb2adaa03e586f4ff1b3d9212e 100755 (executable)
@@ -4,6 +4,8 @@ use strict;
 use warnings;
 use Data::Dumper;
 
+use lib "/home/hadaq/trbsoft/daqtools/dmon/code";
+use Dmon;
 
 use Getopt::Long;
 use Log::Log4perl qw(get_logger);
@@ -234,7 +236,7 @@ write_thresholds($mode, $chain, \@best_thresh);
 my $uid;
 foreach my $i (reverse (0..3)) {
   #print "send command: $endpoint , i: $i\n";
-  $rh_res = send_command($endpoint, $chain, 0x10000000 | $i * 0x10000);
+  $rh_res = Dmon::PadiwaSendCmd($endpoint, $chain, 0x10000000 | $i * 0x10000);
   $uid .= sprintf("%04x", $rh_res->{$endpoint} &0xffff);
   #print $uid;
 }
@@ -262,7 +264,7 @@ sub read_thresholds {
       die "could not lock shared element";
   }
 
-  my $rh_res = trb_register_write($endpoint,0xd410, 1 << $chain);
+  my $rh_res = trb_register_write($endpoint,0xd410, 1 << $chain);
 
   foreach my $current_channel (0..15) {
 
@@ -281,7 +283,7 @@ sub read_thresholds {
     }
 
     $command = $fixed_bits | ($current_channel << 16) ;
-    my $rh_res = send_command($endpoint, $chain, $command);
+    my $rh_res = Dmon::PadiwaSendCmd($endpoint, $chain, $command);
     push (@thresh , $rh_res->{$endpoint});
   }
 
@@ -323,7 +325,7 @@ sub write_thresholds {
     }
 
     $command = $fixed_bits | ($current_channel << 16) | ($ra_thresh->[$current_channel] << $shift_bits);
-    send_command($endpoint, $chain, $command);
+    Dmon::PadiwaSendCmd($endpoint, $chain, $command);
 
 
   }
index 08d83231b7631a72c3c44109468f235afc56ae1c..734e0a6c255ad96ce61fb709c6deffe5c6694c83 100755 (executable)
@@ -4,6 +4,9 @@ use strict;
 use warnings;
 use Data::Dumper;
 
+use lib "/home/hadaq/trbsoft/daqtools/dmon/code";
+use Dmon;
+
 use Getopt::Long;
 
 use HADES::TrbNet;
@@ -91,9 +94,9 @@ sub write_threshold {
       $shift_bits = 4;
   }
 
-  my $command= $fixed_bits | ($current_channel<<16) | ($thresh << $shift_bits);
+  my $command= $fixed_bits | ($current_channel << 16) | ($thresh << $shift_bits);
 
-  send_command($endpoint, $chain, $command);
+  Dmon::PadiwaSendCmd($endpoint, $chain, $command);
 }
 
 
index e55a97caf4534049b833035446d19b3fe23d55d2..456f3f4ee7713b345ec9ff32d08424790a373813 100755 (executable)
@@ -33,7 +33,8 @@ PadiwaTrbAdresses => [0x0010,0x0011,0x0012,0x0013,
                       0x00d0,0x00d1,0x00d2,0x00d3,
                       0x00e0,0x00e1,0x00e2,0x00e3,
                       0x00f0,0x00f1,0x00f2,0x00f3,
-                      0x0100,0x0101,0x0102,0x0103],
+                      0x0100,0x0101,0x0102,0x0103,
+                      0x0111],
 
 HubTrbAdresses =>  [0x7005,0x7000,0x7001,0x7002,0x7003,
                     0x0015,
index 887d2b94160a28c4cf4e3a70d59876e4d3a9a2d3..905b6f67dd9224e98d1a5f69ac11e5f84a780a35 100644 (file)
@@ -89,9 +89,7 @@
  0x0102   0         0xffffffff           0x00000000
  0x0103   0         0x00000000           0x00000000
 
-#for now: disable TDC for beam counter
-
- 0x0110   0         0x0000ffff           0x00000000
- 0x0111   0         0x00000000           0x00000000
- 0x0112   0         0x00000000           0x00000000
- 0x0113   0         0x00000000           0x00000000
+ 0x0110   0         0x0000ffff           0x00000000  #gpin
+ 0x0111   0         0xffffffff           0x00000000  #padiwa amps
+ #0x0112   0         0x00000000           0x00000000 #billboard
+ #0x0113   0         0x00000000           0x00000000
index 7b455fdf1dd2dba51ec3a6738630b9b993466626..455bcf988a02c6c2b0daaad0f7bf07c53aaf447a 100644 (file)
 # Hub    #  Type  #     C0     #     C1     #     C2     #     C3     #     C4     #     C5     #     C6     #     C7     #     C8     #
 ########################################################################################################################################
 
- 0x7005                0   0x7e344bb9    0x4016      0xc0a80003      0xc350     0xdead8000     0x001b   0xc0a80000      0xc350     0x0578
- 0x8015                0   0x7e344bb9    0x4016      0xc0a80003      0xc351     0xdead8001     0x001b   0xc0a80001      0xc351     0x0578
- 0x8025                0   0x7e344bb9    0x4016      0xc0a80003      0xc352     0xdead8002     0x001b   0xc0a80002      0xc352     0x0578
- 0x8035                0   0x7e344bb9    0x4016      0xc0a80003      0xc353     0xdead8003     0x001b   0xc0a80003      0xc353     0x0578
- 0x8045                0   0x7e344bb9    0x4016      0xc0a80003      0xc354     0xdead8004     0x001b   0xc0a80004      0xc354     0x0578
- 0x8055                0   0x7e344bb9    0x4016      0xc0a80003      0xc355     0xdead8005     0x001b   0xc0a80005      0xc355     0x0578
- 0x8065                0   0x7e344bb9    0x4016      0xc0a80003      0xc356     0xdead8006     0x001b   0xc0a80006      0xc356     0x0578
- 0x8075                0   0x7e344bb9    0x4016      0xc0a80003      0xc357     0xdead8007     0x001b   0xc0a80007      0xc357     0x0578
- 0x8085                0   0x7e344bb9    0x4016      0xc0a80003      0xc358     0xdead8008     0x001b   0xc0a80008      0xc358     0x0578
- 0x8095                0   0x7e344bb9    0x4016      0xc0a80003      0xc359     0xdead8009     0x001b   0xc0a80009      0xc359     0x0578
- 0x80a5                0   0x7e344bb9    0x4016      0xc0a80003      0xc35a     0xdead8010     0x001b   0xc0a80010      0xc35a     0x0578
- 0x80b5                0   0x7e344bb9    0x4016      0xc0a80003      0xc35b     0xdead8011     0x001b   0xc0a80011      0xc35b     0x0578
- 0x80c5                0   0x7e344bb9    0x4016      0xc0a80003      0xc35c     0xdead8012     0x001b   0xc0a80012      0xc35c     0x0578
- 0x80d5                0   0x7e344bb9    0x4016      0xc0a80003      0xc35d     0xdead8013     0x001b   0xc0a80013      0xc35d     0x0578
- 0x80e5                0   0x7e344bb9    0x4016      0xc0a80003      0xc35e     0xdead8014     0x001b   0xc0a80014      0xc35e     0x0578
- 0x80f5                0   0x7e344bb9    0x4016      0xc0a80003      0xc35f     0xdead8015     0x001b   0xc0a80015      0xc35f     0x0578
- 0x8105                0   0x7e344bb9    0x4016      0xc0a80003      0xc360     0xdead8016     0x001b   0xc0a80016      0xc360     0x0578
- 0x8115                0   0x7e344bb9    0x4016      0xc0a80003      0xc361     0xdead8017     0x001b   0xc0a80017      0xc361     0x0578
+ 0x7005                0   0x7e344bb9    0x4016      0x0aa0004d      0xc350     0xdead8000     0x001b   0xc0a80000      0xc350     0x0578
+ 0x8015                0   0x7e344bb9    0x4016      0x0aa0004d      0xc351     0xdead8001     0x001b   0xc0a80001      0xc351     0x0578
+ 0x8025                0   0x7e344bb9    0x4016      0x0aa0004d      0xc352     0xdead8002     0x001b   0xc0a80002      0xc352     0x0578
+ 0x8035                0   0x7e344bb9    0x4016      0x0aa0004d      0xc353     0xdead8003     0x001b   0xc0a80003      0xc353     0x0578
+ 0x8045                0   0x7e344bb9    0x4016      0x0aa0004d      0xc354     0xdead8004     0x001b   0xc0a80004      0xc354     0x0578
+ 0x8055                0   0x7e344bb9    0x4016      0x0aa0004d      0xc355     0xdead8005     0x001b   0xc0a80005      0xc355     0x0578
+ 0x8065                0   0x7e344bb9    0x4016      0x0aa0004d      0xc356     0xdead8006     0x001b   0xc0a80006      0xc356     0x0578
+ 0x8075                0   0x7e344bb9    0x4016      0x0aa0004d      0xc357     0xdead8007     0x001b   0xc0a80007      0xc357     0x0578
+ 0x8085                0   0x7e344bb9    0x4016      0x0aa0004d      0xc358     0xdead8008     0x001b   0xc0a80008      0xc358     0x0578
+ 0x8095                0   0x7e344bb9    0x4016      0x0aa0004d      0xc359     0xdead8009     0x001b   0xc0a80009      0xc359     0x0578
+ 0x80a5                0   0x7e344bb9    0x4016      0x0aa0004d      0xc35a     0xdead8010     0x001b   0xc0a80010      0xc35a     0x0578
+ 0x80b5                0   0x7e344bb9    0x4016      0x0aa0004d      0xc35b     0xdead8011     0x001b   0xc0a80011      0xc35b     0x0578
+ 0x80c5                0   0x7e344bb9    0x4016      0x0aa0004d      0xc35c     0xdead8012     0x001b   0xc0a80012      0xc35c     0x0578
+ 0x80d5                0   0x7e344bb9    0x4016      0x0aa0004d      0xc35d     0xdead8013     0x001b   0xc0a80013      0xc35d     0x0578
+ 0x80e5                0   0x7e344bb9    0x4016      0x0aa0004d      0xc35e     0xdead8014     0x001b   0xc0a80014      0xc35e     0x0578
+ 0x80f5                0   0x7e344bb9    0x4016      0x0aa0004d      0xc35f     0xdead8015     0x001b   0xc0a80015      0xc35f     0x0578
+ 0x8105                0   0x7e344bb9    0x4016      0x0aa0004d      0xc360     0xdead8016     0x001b   0xc0a80016      0xc360     0x0578
+ 0x8115                0   0x7e344bb9    0x4016      0x0aa0004d      0xc361     0xdead8017     0x001b   0xc0a80017      0xc361     0x0578
 #0x8125                0   0x7e344bb9    0x4016      0xc0a80002      0xc362     0xdead8018     0x001b   0xc0a80018      0xc362     0x0578
 #0x8135                0   0x7e344bb9    0x4016      0xc0a80002      0xc363     0xdead8019     0x001b   0xc0a80019      0xc363     0x0578
 #0x8145                0   0x7e344bb9    0x4016      0xc0a80002      0xc364     0xdead8020     0x001b   0xc0a80020      0xc364     0x0578
index 139fc0461cee664103f6c0323876e3c5c3a023a8..9bcdcdfe0976f18074fe97a0a18a13cb66ad11e6 100755 (executable)
@@ -16,17 +16,19 @@ then
 fi
 
 #export TRB3_SERVER=trb056
-export DAQOPSERVER=localhost:56
+export DAQOPSERVER=10.160.0.77:56
+
 
-echo -n "- number of trb endpoints in the system: "
-trbcmd i 0xffff | wc -l
 
 
 ##################################################
 ## System Reset
 ##################################################
+echo "Doing reset"
 trbcmd reset
 
+echo -n "- number of trb endpoints in the system: "
+trbcmd i 0xffff | wc -l
 ##################################################
 ## Set addresses
 ##################################################
@@ -89,7 +91,7 @@ echo "XXX: Running prepare padiwas invert leds"
 0x00d0 0x00d1 0x00d2 0x00d3 \
 0x00e0 0x00e1 0x00e2 0x00e3 \
 0x00f0 0x00f1 0x00f2 0x00f3 \
-0x0100 0x0101 0x0102 0x0103 "
+0x0100 0x0101 0x0102 0x0103 0x111"
 echo "done..."
 
 # enable used channels
diff --git a/users/cern_cbmrich/thresh/thresholds_padiwa_amps.thr b/users/cern_cbmrich/thresh/thresholds_padiwa_amps.thr
new file mode 100644 (file)
index 0000000..5668c68
--- /dev/null
@@ -0,0 +1,16 @@
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 00 threshold: 0x06F6, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 01 threshold: 0xDB23, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 02 threshold: 0x077D, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 03 threshold: 0xDC50, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 04 threshold: 0x0672, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 05 threshold: 0xDC50, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 06 threshold: 0xffff, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 07 threshold: 0x0000, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 08 threshold: 0xffff, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 09 threshold: 0x0000, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 10 threshold: 0xffff, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 11 threshold: 0x0000, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 12 threshold: 0xffff, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 13 threshold: 0x0000, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 14 threshold: 0xffff, uid: 0
+2014/10/20 00:00:00 endpoint: 0x0111, chain: 00, channel: 15 threshold: 0x0000, uid: 0
\ No newline at end of file