From: Jan Michel Date: Tue, 10 Sep 2013 08:20:34 +0000 (+0200) Subject: added temperature compensation to padiwa.pl X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=f8f72d15659b4cb2055f9c3fd0bd411415916e6d;p=daqtools.git added temperature compensation to padiwa.pl --- diff --git a/tools/padiwa.pl b/tools/padiwa.pl index e3d5791..f7e75a6 100755 --- a/tools/padiwa.pl +++ b/tools/padiwa.pl @@ -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));