]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
adding modes for DiRich to ADC reader
authorJan Michel <j.michel@gsi.de>
Thu, 18 Aug 2016 09:49:37 +0000 (11:49 +0200)
committerJan Michel <j.michel@gsi.de>
Thu, 18 Aug 2016 09:49:37 +0000 (11:49 +0200)
tools/hadplot
users/frankfurt_test/adcsettings.sh
users/frankfurt_test/trb3scadc.pl
web/htdocs/tools/pwr/pwr.conf

index dc6da35522d961adda8c888e270cdfa39992ab57..ecc455a3f1fe6389a024f4da0d869b776f9df864 100755 (executable)
@@ -154,7 +154,7 @@ if($style == 5) {$curvestyle="histostacked";      $xticks=1;}
 
 #Open Gnuplot
 our $fh;
-my $fn = "gnuplot -noraise -geometry $geom -bg 'ghost white'";
+my $fn = "tee /dev/stderr | gnuplot -noraise -geometry $geom -bg 'ghost white'";
 $fh = new FileHandle ("|$fn") or  die "error: no gnuplot";
 $fh->autoflush(1);
 
@@ -273,7 +273,7 @@ sub plot_reset {
     if ($plotendedbefore != 0) {
       $plotendedbefore = 0;
       print $fh makeTimeString();      
-      print $fh "replot\n";
+      print $fh "replot \n";
       }
     }
   else {
@@ -726,7 +726,7 @@ sub genreg {
     plot_write("set autoscale xfix ");    
     }
 
-  plot_write("plot",1);
+  plot_write("plot ",1);
   for(my $i = 0; $i<scalar(@{$address});$i++) {
     plot_write("'-' ",NONEWLINE);
     if($xticks) {
index 30fb4afff7d1eed9d966abe65232a8ccd06ebb14..dcba39d35fee04b2376d02648a6e949e7d82aad9 100755 (executable)
@@ -1,41 +1,41 @@
 #!/bin/bash
 
 #Disable second TRB3 & unused ADC FPGA
-trbcmd w 0xc000 0xc0 0x0ff9
-trbcmd w 0xc000 0xc1 0x0ff9
-trbcmd w 0xc000 0xc3 0x0ff9
-
-
-cd ../../tools/
-./adc.pl 0x5003 init
-cd ../users/frankfurt_test
-
-
-trbcmd w 0xfe4b 0xa010 24          #Buffer depth
-trbcmd w 0xfe4b 0xa011 8           #Samples after trigger
-trbcmd w 0xfe4b 0xa012 2           #Process blocks
-trbcmd w 0xfe4b 0xa013 40          #Trigger offset
-trbcmd w 0xfe4b 0xa014 40          #Readout offset
-trbcmd w 0xfe4b 0xa015 0           #Downsampling
-trbcmd w 0xfe4b 0xa016 8           #Baseline
-trbcmd w 0xfe4b 0xa017 1           #Trigger Enable
-
-trbcmd w 0xfe4b 0xa020 0           #Sum values
-trbcmd w 0xfe4b 0xa021 0           #Sum values
-trbcmd w 0xfe4b 0xa022 0           #Sum values
-trbcmd w 0xfe4b 0xa023 0           #Sum values
-trbcmd w 0xfe4b 0xa024 15          #word count
-trbcmd w 0xfe4b 0xa025 7           #word count
-trbcmd w 0xfe4b 0xa026 0           #word count
-trbcmd w 0xfe4b 0xa027 0           #word count
-
-trbcmd w 0xfe4b 0xa000 0x100       #Reset Baseline
-
-trbcmd setbit  0x8000 0xa14d 0x00040000              #External trigger selector
-trbcmd setbit  0x8000 0xa101 0x00000400              #External trigger on
-
-trbcmd w       0x8000 0xa150 0x05f5e0ff              #1 Hz pulser
-trbcmd loadbit 0x8000 0xa158 0x000000f0 0x000000e0   #Pulser 0xe type
-trbcmd setbit  0x8000 0xa101 0x00000002              #Pulser on
+#trbcmd w 0xc000 0xc0 0x0ff9
+#trbcmd w 0xc000 0xc1 0x0ff9
+#trbcmd w 0xc000 0xc3 0x0ff9
+
+
+#cd ../../tools/
+./adc.pl 0xf4cc init
+#cd ../users/frankfurt_test
+
+
+trbcmd w 0xf4cc 0xa010 24          #Buffer depth
+trbcmd w 0xf4cc 0xa011 8           #Samples after trigger
+trbcmd w 0xf4cc 0xa012 2           #Process blocks
+trbcmd w 0xf4cc 0xa013 40          #Trigger offset
+trbcmd w 0xf4cc 0xa014 40          #Readout offset
+trbcmd w 0xf4cc 0xa015 0           #Downsampling
+trbcmd w 0xf4cc 0xa016 8           #Baseline
+trbcmd w 0xf4cc 0xa017 1           #Trigger Enable
+
+trbcmd w 0xf4cc 0xa020 0           #Sum values
+trbcmd w 0xf4cc 0xa021 0           #Sum values
+trbcmd w 0xf4cc 0xa022 0           #Sum values
+trbcmd w 0xf4cc 0xa023 0           #Sum values
+trbcmd w 0xf4cc 0xa024 15          #word count
+trbcmd w 0xf4cc 0xa025 7           #word count
+trbcmd w 0xf4cc 0xa026 0           #word count
+trbcmd w 0xf4cc 0xa027 0           #word count
+
+trbcmd w 0xf4cc 0xa000 0x100       #Reset Baseline
+
+#trbcmd setbit  0x8000 0xa14d 0x00040000              #External trigger selector
+#trbcmd setbit  0x8000 0xa101 0x00000400              #External trigger on
+
+#trbcmd w       0x8000 0xa150 0x05f5e0ff              #1 Hz pulser
+#trbcmd loadbit 0x8000 0xa158 0x000000f0 0x000000e0   #Pulser 0xe type
+#trbcmd setbit  0x8000 0xa101 0x00000002              #Pulser on
 
 
index e694456e68f9bc8fa9fc8fe47146163b206d9568..729226277f0f3e11a3a3eaece86d4634dd34c5bd 100755 (executable)
@@ -12,38 +12,52 @@ trb_init_ports() or die trb_strerror();
 
 my $board = hex($ARGV[0]);
 
+#0 for TRB3sc, 1 for DiRich, 2 for Concentrator, 3 for PowerVoltages, 4 for PowerCurrents
+my $modedesc = ['Trb3sc','DiRich','Concentrator','Power-Voltages','Power-Currents'];
+my $mode = $ARGV[1] || 0;
+my $multiplier= [[2,1,1,2],[2,2,1,0],[2,2,1,25],[2,2,1,1],[10,5,2,1]];
+my $t = [['mV (3.3)','mV (2.5)','mV (1.2)','mV (6)'],
+         ['mV (3.3)','mV (2.5)','mV (1.1)',''],
+         ['mV (3.3)','mV (2.5)','mV (1.2)','mA (@1.2)'],
+         ['mV (3.3)','mV (2.5)','mV (1.2)','mV (1.1)'],
+         ['mA (@1.1)','mA (@1.2)','mA (@2.5)','mA (@3.3)']];
+my $channel = [7,7,7,6,5];
+
+print "\nRunning in mode ".$modedesc->[$mode]."\n\n";
+
+
 #2 MHz SPI
 system("trbcmd w $board 0xd41a 25");
 
 my $cmd; my $s;
 
 $cmd = 0xc3830000;
-$s = Dmon::PadiwaSendCmd($cmd,$board,7);
+$s = Dmon::PadiwaSendCmd($cmd,$board,$channel->[$mode]);
 
-usleep(1000);
+usleep(5000);
 $cmd = 0xd3830000;
-$s = Dmon::PadiwaSendCmd($cmd,$board,7);
-printf("0x%08x\t%i mV\n",$s->{$board},($s->{$board}>>19&0xfff)*2);
+$s = Dmon::PadiwaSendCmd($cmd,$board,$channel->[$mode]);
+printf("0x%08x\t%i %s\n",$s->{$board},($s->{$board}>>19&0xfff)*$multiplier->[$mode][0],$t->[$mode][0]);
 
-usleep(1000);
-$cmd = 0xe5830000;
-$s = Dmon::PadiwaSendCmd($cmd,$board,7);
-printf("0x%08x\t%i mV\n",$s->{$board},($s->{$board}>>19)&0xfff);
+usleep(5000);
+$cmd = 0xe3830000;
+$s = Dmon::PadiwaSendCmd($cmd,$board,$channel->[$mode]);
+printf("0x%08x\t%i %s\n",$s->{$board},($s->{$board}>>19&0xfff)*$multiplier->[$mode][1],$t->[$mode][1]);
 
 usleep(1000);
 $cmd = 0xf3830000;
-$s = Dmon::PadiwaSendCmd($cmd,$board,7);
-printf("0x%08x\t%i mV\n",$s->{$board},($s->{$board}>>19&0xfff)/2);
-
+$s = Dmon::PadiwaSendCmd($cmd,$board,$channel->[$mode]);
+printf("0x%08x\t%i %s\n",$s->{$board},($s->{$board}>>19&0xfff)*$multiplier->[$mode][2],$t->[$mode][2]);
 
-usleep(1000);
+usleep(5000);
 $cmd = 0xf3930000;
-$s = Dmon::PadiwaSendCmd($cmd,$board,7);
-printf("0x%08x\t%i mV\n",$s->{$board},($s->{$board}>>19&0xfff)*2);
+$s = Dmon::PadiwaSendCmd($cmd,$board,$channel->[$mode]);
+printf("0x%08x\t%i %s\n",$s->{$board},($s->{$board}>>19&0xfff)*$multiplier->[$mode][3],$t->[$mode][3]);
 
-usleep(1000);
-$s = Dmon::PadiwaSendCmd(0,$board,7);
+usleep(5000);
+$s = Dmon::PadiwaSendCmd(0,$board,$channel->[$mode]);
 printf("0x%08x\t%.2f °C\n",$s->{$board},(($s->{$board}>>19)&0xfff)/16.);
 
 #back to normal SPI speed
 system("trbcmd w $board 0xd41a 7");
+print "\n";
\ No newline at end of file
index f1393887333f935123f93bb00152c55a052f6fb6..12556522a33d2867ab435186cfc5e5fe770c8afb 100644 (file)
@@ -1,9 +1,8 @@
-Content-type: text/html
-
 //PWRSPLY:/path/to/device:speed:Name:Type:Channels
 //type can be HMP, PSP, PST
 
-PWRSPLY:/dev/ttyUSB0:9600:PST3202:PST:3
+//PWRSPLY:/dev/ttyUSB0:9600:PST3202:PST:3
 //PWRSPLY:/dev/ttyUSB0:115200:HMP4030:HMP:3
-//PWRSPLY:/dev/ttyUSB1:2400:PSP405:PSP:1
+PWRSPLY:/dev/FTDI_FT232R_USB_UART_AH02HFZW:2400:PSP2010:PSP:1
+PWRSPLY:/dev/FTDI_FT232R_USB_UART_A702HE33:2400:PSP405:PSP:1