]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Thu, 14 Jun 2012 12:37:24 +0000 (12:37 +0000)
committerhadeshyp <hadeshyp>
Thu, 14 Jun 2012 12:37:24 +0000 (12:37 +0000)
cbmrich.txt
dac_configuration.txt
dac_program.pl

index 3d7fbc712ec2134d2584141c67b8e22f188a642b..b203e59739d57fa7be23077a104b1944170c9f79 100644 (file)
@@ -1,9 +1,9 @@
-# Board   ChainLen    DAC     Channel       Command       Value
-  f300    1           0       0             3             0x3450
-  f300    1           0       1             3             0x1230
-  f300    1           0       2             3             0x6780
-  f300    1           0       3             3             0x0345
-  f300    1           0       4             3             0x3450
-  f300    1           0       5             3             0x1230
-  f300    1           0       6             3             0x6780
-  f300    1           0       7             3             0x0345
+# Board   Chain     ChainLen    DAC     Channel       Command       Value
+  f300    1         1           0       0             3             0x3450
+  f300    1         1           0       1             3             0x1230
+  f300    1         1           0       2             3             0x6780
+  f300    1         1           0       3             3             0x0345
+  f300    1         1           0       4             3             0x3450
+  f300    1         1           0       5             3             0x1230
+  f300    1         1           0       6             3             0x6780
+  f300    1         1           0       7             3             0x0345
index 4e483f3a884ced2fb685872202f308612fac6a5e..f1b780b45e33613d11861c7188e6ae4325808756 100644 (file)
@@ -1,5 +1,5 @@
-# Board   ChainLen   DAC     Channel       Command       Value
-  f333    4          0       0             3             0x3450
-  f333    4          0       1             3             0x1230
-  f333    4          1       0             3             0x6780
-  f333    4          2       0             3             0x345
+# Board   Chain     ChainLen   DAC     Channel       Command       Value
+  f333    1         4          0       0             3             0x3450
+  f333    1         4          0       1             3             0x1230
+  f333    1         4          1       0             3             0x6780
+  f333    1         4          2       0             3             0x3450
\ No newline at end of file
index 4e8a0186fe3bb41a6ff5dae1de27b7afd407f124..68983912242b059ed3933b35a84cdb6532866b43 100755 (executable)
@@ -13,11 +13,11 @@ my $fh;
 if(!$ARGV[0]) {
   print "usage: dac_program.pl <filename of configuration file>\n\n";
   print "Example config file:\n";
-  print "# Board   ChainLen    DAC     Channel       Command       Value\n";
-  print "  f300    1           0       0             3             0x3450\n";
-  print "  f300    1           0       1             3             0x1230\n";
-  print "  f300    1           0       2             3             0x6780\n";
-  print "  f300    1           0       3             3             0x0345\n";
+  print "# Board   Chain     ChainLen    DAC     Channel       Command       Value\n";
+  print "  f300    1         1           0       0             3             0x3450\n";
+  print "  f300    1         1           0       1             3             0x1230\n";
+  print "  f300    1         1           0       2             3             0x6780\n";
+  print "  f300    1         1           0       3             3             0x0345\n";
   exit;
   }
 
@@ -30,10 +30,9 @@ while (my $a = <$fh>) {
   $a=~s/#.*//;
   
  
-  if(my ($board,$chain,$dac,$chan,$cmd,$val) = $a =~ /^\s*(\w\w\w\w)\s+(\d+)\s+(\d+)\s+(\d)\s+(\w)\s+(\w+)/) {
-    if (substr($val,0,2) eq "0x") {
-      $val = hex(substr($val,2));
-      }
+  if(my ($board,$chain,$chainlen,$dac,$chan,$cmd,$val) = $a =~ /^\s*(\w\w\w\w)\s+(\w+)\s+(\d+)\s+(\d+)\s+(\d)\s+(\w)\s+(\w+)/) {
+    $val = hex(substr($val,2)) if (substr($val,0,2) eq "0x");
+    $chain = hex(substr($chain,2)) if (substr($chain,0,2) eq "0x");
     $cmd = hex($cmd);
     $board = hex($board);
     
@@ -46,9 +45,10 @@ while (my $a = <$fh>) {
       $values[$i] = 0x00F00000;
       }
     $values[16] = $chain;
-    $values[$chain-1-$dac] = $o;
+    $values[17] = $chainlen;
+    $values[$chainlen-1-$dac] = $o;
 #     print Dumper @values;
-    trb_register_write_mem($board,0xd400,0,\@values,17) or die "trb_register_write_mem: ", trb_strerror(); 
-    usleep(5*$chain);
+    trb_register_write_mem($board,0xd400,0,\@values,18) or die "trb_register_write_mem: ", trb_strerror(); 
+    usleep(5*$chainlen);
     }
   }
\ No newline at end of file