]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
TRB3sc ADC script takes network address as argument
authorJan Michel <j.michel@gsi.de>
Fri, 16 Oct 2015 16:34:11 +0000 (18:34 +0200)
committerJan Michel <j.michel@gsi.de>
Fri, 16 Oct 2015 16:34:38 +0000 (18:34 +0200)
users/frankfurt_test/trb3scadc.pl

index 1b245b22673459ba51b554df26fd3a5e3f9263ad..e694456e68f9bc8fa9fc8fe47146163b206d9568 100755 (executable)
@@ -10,38 +10,40 @@ use Time::HiRes qq|usleep|;
 
 trb_init_ports() or die trb_strerror();
 
+my $board = hex($ARGV[0]);
+
 #2 MHz SPI
-system("trbcmd w 0xf3cc 0xd41a 25");
+system("trbcmd w $board 0xd41a 25");
 
 my $cmd; my $s;
 
 $cmd = 0xc3830000;
-$s = Dmon::PadiwaSendCmd($cmd,0xf3cc,7);
+$s = Dmon::PadiwaSendCmd($cmd,$board,7);
 
 usleep(1000);
 $cmd = 0xd3830000;
-$s = Dmon::PadiwaSendCmd($cmd,0xf3cc,7);
-printf("0x%08x\t%i mV\n",$s->{62412},($s->{62412}>>19&0xfff)*2);
+$s = Dmon::PadiwaSendCmd($cmd,$board,7);
+printf("0x%08x\t%i mV\n",$s->{$board},($s->{$board}>>19&0xfff)*2);
 
 usleep(1000);
 $cmd = 0xe5830000;
-$s = Dmon::PadiwaSendCmd($cmd,0xf3cc,7);
-printf("0x%08x\t%i mV\n",$s->{62412},($s->{62412}>>19)&0xfff);
+$s = Dmon::PadiwaSendCmd($cmd,$board,7);
+printf("0x%08x\t%i mV\n",$s->{$board},($s->{$board}>>19)&0xfff);
 
 usleep(1000);
 $cmd = 0xf3830000;
-$s = Dmon::PadiwaSendCmd($cmd,0xf3cc,7);
-printf("0x%08x\t%i mV\n",$s->{62412},($s->{62412}>>19&0xfff)/2);
+$s = Dmon::PadiwaSendCmd($cmd,$board,7);
+printf("0x%08x\t%i mV\n",$s->{$board},($s->{$board}>>19&0xfff)/2);
 
 
 usleep(1000);
 $cmd = 0xf3930000;
-$s = Dmon::PadiwaSendCmd($cmd,0xf3cc,7);
-printf("0x%08x\t%i mV\n",$s->{62412},($s->{62412}>>19&0xfff)*2);
+$s = Dmon::PadiwaSendCmd($cmd,$board,7);
+printf("0x%08x\t%i mV\n",$s->{$board},($s->{$board}>>19&0xfff)*2);
 
 usleep(1000);
-$s = Dmon::PadiwaSendCmd(0,0xf3cc,7);
-printf("0x%08x\t%.2f °C\n",$s->{62412},(($s->{62412}>>19)&0xfff)/16.);
+$s = Dmon::PadiwaSendCmd(0,$board,7);
+printf("0x%08x\t%.2f °C\n",$s->{$board},(($s->{$board}>>19)&0xfff)/16.);
 
 #back to normal SPI speed
-system("trbcmd w 0xf3cc 0xd41a 7");
\ No newline at end of file
+system("trbcmd w $board 0xd41a 7");