From e76ea68b02764f2f714c5dfe5c343450fab6686a Mon Sep 17 00:00:00 2001 From: Hades DAQ Date: Thu, 21 Mar 2019 14:18:31 +0100 Subject: [PATCH] few changes during beamtime --- dmon/code/Perl2Epics.pm | 1 + thresholds/thr2flash.pl | 11 +++++++---- tools/HPlot.pm | 2 +- users/frankfurt_test/trb3scadc.pl | 6 +++++- users/giessen_lab/showMagParserValues.pl | 4 ++-- web/htdocs/tools/pwr/pwr.pl | 6 +++--- xml-db/get.pl | 4 ++-- xml-db/put.pl | 4 ++-- 8 files changed, 23 insertions(+), 15 deletions(-) diff --git a/dmon/code/Perl2Epics.pm b/dmon/code/Perl2Epics.pm index 98ab27f..9b35421 100644 --- a/dmon/code/Perl2Epics.pm +++ b/dmon/code/Perl2Epics.pm @@ -7,6 +7,7 @@ use Data::Dumper; #Add all possible paths here... use lib '/home/hadaq/EPICS/base-3.14.12.3/lib/perl'; use lib '/mnt/home_cbm02/hadaq/EPICS/base-3.14.12.3/lib/perl'; +use lib '/home/hadaq/EPICS/EPICS-3.15.6/base/lib/perl'; use CA; # Address list for Epics IOCs. Don't remove unused values diff --git a/thresholds/thr2flash.pl b/thresholds/thr2flash.pl index 46d28c8..4277ae9 100755 --- a/thresholds/thr2flash.pl +++ b/thresholds/thr2flash.pl @@ -13,20 +13,23 @@ if (!defined &trb_init_ports()) { my $dirich = trb_register_read(0xfe51,0x0); -foreach my $b (keys $dirich) { +my $cnt = 1; +foreach my $b (keys %{$dirich}) { my $addr = sprintf("0x%x",$b); writeThr2Flash($addr); + $cnt++; +# sleep 5 unless ($cnt%20) } #print Dumper $dirich; sub writeThr2Flash { - my $addr = @_; + my $addr = shift @_; print $addr."..."; - my $str = qx(/home/hadaq/trbsoft/daqtools/tools/spi_slave.pl -e=$addr -c=0 -flashcmd=8 -x=memtoflash --range '0x0..0xf'); + system("/home/hadaq/trbsoft/daqtools/tools/spi_slave.pl -e=$addr -c=0 -flashcmd=8 -x=memtoflash --range '0x0..0xf' &"); #print $str."\n"; - $str = qx(/home/hadaq/trbsoft/daqtools/tools/spi_slave.pl -e=$addr -c=1 -flashcmd=8 -x=memtoflash --range '0x0..0xf'); + system("/home/hadaq/trbsoft/daqtools/tools/spi_slave.pl -e=$addr -c=1 -flashcmd=8 -x=memtoflash --range '0x0..0xf' &" ); #print $str."\n"; print "done!\n"; } diff --git a/tools/HPlot.pm b/tools/HPlot.pm index 4f1087e..01565f1 100755 --- a/tools/HPlot.pm +++ b/tools/HPlot.pm @@ -56,7 +56,7 @@ sub PlotInit { my $name = $c->{name}; - my $fn = "gnuplot"; + my $fn = "gnuplot 2>1"; #my $fh = new FileHandle ("|$fn") or die "error: no gnuplot"; open my $fh, "|$fn" or die "error: no gnuplot"; $fh->autoflush(1); diff --git a/users/frankfurt_test/trb3scadc.pl b/users/frankfurt_test/trb3scadc.pl index 2bf8a9c..e257196 100755 --- a/users/frankfurt_test/trb3scadc.pl +++ b/users/frankfurt_test/trb3scadc.pl @@ -20,7 +20,7 @@ my $t = [['mV (3.3)','mV (2.5)','mV (1.2)','mV (6)'], ['mV (3.3)','mV (2.5)','mV (1.2)','mV (1.1)'], ['mA (@1.1)','mA (@1.2)','mA (@2.5)','mA (@3.3)'], ['mV (5)','mV (1.1)','mV (2.5)','mV (3.3)']]; -my $channel = [7,7,7,6,5,7]; #SPI interface number +my $channel = [7,7,7,6,6,7]; #SPI interface number - 777657 would be right #1:4V, 2:2V, 3:1V my $resolution = [[2,1,2,1], [2,2,2,1], [2,2,2,4], [2,2,2,2], [3,3,2,2], [1,2,1,2]]; @@ -34,6 +34,7 @@ print "\nRunning in mode ".$modedesc->[$mode]."\n\n"; system("trbcmd w $board 0xd41a 25"); my $cmd; my $s; +trb_register_write($board,0xd417,0x40) if($mode == 4); $cmd = 0xc1830000 + ($resolution->[$mode][0] << 25); $s = Dmon::PadiwaSendCmd($cmd,$board,$channel->[$mode]); @@ -62,6 +63,9 @@ usleep(5000); $s = Dmon::PadiwaSendCmd(0,$board,$channel->[$mode]); printf("0x%08x\t%.2f °C\n",$s->{$board},(($s->{$board}>>19)&0xfff)/16.); +trb_register_write($board,0xd417,0x0) if($mode == 4); + + #back to normal SPI speed system("trbcmd w $board 0xd41a 7"); print "\n"; diff --git a/users/giessen_lab/showMagParserValues.pl b/users/giessen_lab/showMagParserValues.pl index 3c9dbb3..6c949d3 100755 --- a/users/giessen_lab/showMagParserValues.pl +++ b/users/giessen_lab/showMagParserValues.pl @@ -8,8 +8,8 @@ use constant true => 1; ########################################## #variables ########################################## -my $boardAddress = 0x0201; -my $numberOfBoards = 1; +my $boardAddress = 0x0110; +my $numberOfBoards = 6; my $numberOfSensors = 4; my $secondsToWaitBeforeNextPrint = 3; my $writeToFile = false; diff --git a/web/htdocs/tools/pwr/pwr.pl b/web/htdocs/tools/pwr/pwr.pl index 3a8af83..a95002e 100755 --- a/web/htdocs/tools/pwr/pwr.pl +++ b/web/htdocs/tools/pwr/pwr.pl @@ -71,10 +71,10 @@ else { if(defined $isRemote) { my $env = $ENV{'QUERY_STRING'}; # $env =~ s/%20/ /g; - $env =~ s/&/!/g; + $env =~ s/&/\\!/g; my $cmd = "bash -c \"ssh $isRemote 'QUERY_STRING=".$env." perl'\" {'§EntityType'}; diff --git a/xml-db/put.pl b/xml-db/put.pl index b16e8ec..a6bd596 100755 --- a/xml-db/put.pl +++ b/xml-db/put.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use HADES::TrbNet; -use Storable qw(lock_retrieve); +use Storable qw(retrieve); use Time::HiRes qw( usleep ); use feature "switch"; @@ -106,7 +106,7 @@ foreach my $req (@request) { elsif ($name =~ m/^([a-zA-Z0-9]+)$/) {$name = $1; $slice = 0;} else {die "Could not parse name $name \n";} - $db = lock_retrieve($file); + $db = retrieve($file); die "Unable to read cache file\n" unless defined $db; die "Name not found in entity file\n" unless(exists $db->{$name}); -- 2.43.0