From: Jan Michel Date: Fri, 16 Oct 2015 16:34:11 +0000 (+0200) Subject: TRB3sc ADC script takes network address as argument X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a4b71d689682f031576165ec5fe8f818adbd43a0;p=daqtools.git TRB3sc ADC script takes network address as argument --- diff --git a/users/frankfurt_test/trb3scadc.pl b/users/frankfurt_test/trb3scadc.pl index 1b245b2..e694456 100755 --- a/users/frankfurt_test/trb3scadc.pl +++ b/users/frankfurt_test/trb3scadc.pl @@ -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");