]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
added temperature compensation to padiwa.pl
authorJan Michel <j.michel@gsi.de>
Tue, 10 Sep 2013 08:20:34 +0000 (10:20 +0200)
committerJan Michel <j.michel@gsi.de>
Tue, 10 Sep 2013 08:20:34 +0000 (10:20 +0200)
tools/padiwa.pl

index e3d5791b25a4dea71098e387af3780c9e5785248..f7e75a6514748ac7058ac9a7af96817832931efa 100755 (executable)
@@ -24,6 +24,8 @@ if(!(defined $ARGV[0]) || !(defined $ARGV[1]) || !(defined $ARGV[2])) {
   print "\t dac \t\t set LTC-DAC value. options: \$channel, \$value\n";
   print "\t pwm \t\t set PWM value. options: \$channel, \$value\n";
   print "\t  \t\t read PWM value. options: \$channel\n";
+  print "\t comp \t\t set temperature compensation value. options: \$value\n";
+  print "\t  \t\t read temperature compensation value. no options\n";
   print "\t disable \t set input diable. options: \$mask\n";
   print "\t \t\t read input disable. no options\n";
   print "\t input \t\t read input status. no options\n";
@@ -127,7 +129,18 @@ if($ARGV[2] eq "pwm") {
     printf("0x%04x\t%d\t%d\t0x%04x\t%4.2f\n",$e,$chain,$ARGV[3],$b->{$e}&0xffff,($b->{$e}&0xffff)*3300/65536);
     }
   }  
+
+if($ARGV[2] eq "comp" && defined $ARGV[3]) {
+  my $b = sendcmd(0x20860000+($mask&0xffff));
+  print "Wrote Temperature Compensation settings.\n";
+  }    
   
+if($ARGV[2] eq "comp") {
+  my $b = sendcmd(0x20060000);
+  foreach my $e (sort keys %$b) {
+    printf("0x%04x\t%d\t0x%04x\n",$e,$chain,$b->{$e}&0xffff);
+    }
+  }   
   
 if($ARGV[2] eq "disable" && defined $ARGV[3]) {
   my $b = sendcmd(0x20800000+($mask&0xffff));