From: Your Name Date: Tue, 14 Jun 2022 12:04:58 +0000 (+0200) Subject: fixed web-page issues and threshold-script bugs. mt" X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=38ca0bdcaa13348336d865871ebc3ceb0f3b49bd;p=daqtools.git fixed web-page issues and threshold-script bugs. mt" --- diff --git a/thresholds/set_fixed_threshold.pl b/thresholds/set_fixed_threshold.pl index 1ab1d8b..40e7485 100755 --- a/thresholds/set_fixed_threshold.pl +++ b/thresholds/set_fixed_threshold.pl @@ -49,7 +49,11 @@ if($chain =~ /^0x/) { trb_init_ports() or die trb_strerror(); -foreach my $channel (0..15) { +my $max_number_of_channels = 15; + +$max_number_of_channels = 31 if($mode eq "dirich2"); + +foreach my $channel (0..$max_number_of_channels) { write_threshold($mode, $endpoint, $chain, $channel, $value); } diff --git a/users/ufsd_trb3_sdalinac/second.C b/users/ufsd_trb3_sdalinac/second.C index 91eb1eb..4ec9e44 100644 --- a/users/ufsd_trb3_sdalinac/second.C +++ b/users/ufsd_trb3_sdalinac/second.C @@ -4,6 +4,7 @@ #include #include #include +#include #include "base/EventProc.h" #include "base/Event.h" @@ -220,5 +221,5 @@ class SecondProc : public base::EventProc void second() { - new SecondProc("TEST", "TDC_1405", "TDC_1410", "TDC_1411", "TDC_1415"); + new SecondProc("TEST", "TDC_1401", "TDC_1405", "TDC_1407", "TDC_1408"); } diff --git a/users/ufsd_trb3_sdalinac/startup.sh b/users/ufsd_trb3_sdalinac/startup.sh index 2d6019f..e1fc5cc 100755 --- a/users/ufsd_trb3_sdalinac/startup.sh +++ b/users/ufsd_trb3_sdalinac/startup.sh @@ -101,7 +101,14 @@ echo "trigger type" #trbcmd clearbit 0x1130 0xc801 0x80000000 # disable window #trbcmd w 0x1130 0xc802 0xffff0000 # enable upper 16 channels for padiwa #trbcmd w 0x1580 0xc802 0xffffffff # enable upper 16 channels for padiwa +# activate 32 channels of every TDC +trbcmd w 0xfe57 0xc802 0xffffffff +# set the trigger-out signal width for all TDCs, 0x2 is about 20ns +trbcmd w 0xfe57 0xe000 0x4 + +# activate all trigger-out signals +trbcmd w 0xfe57 0xe002 0xffffffff cd ~/trbsoft/daqtools/xml-db ./put.pl Readout 0xfe51 SetMaxEventSize 500 diff --git a/web/htdocs/commands/getpadiwa.pl b/web/htdocs/commands/getpadiwa.pl index 97bca36..ffa326f 100755 --- a/web/htdocs/commands/getpadiwa.pl +++ b/web/htdocs/commands/getpadiwa.pl @@ -1,6 +1,8 @@ #!/usr/bin/perl use HADES::TrbNet; use warnings; +use Dmon; +use Time::HiRes qq|usleep|; #use strict; # use Data::Dumper; if (defined $ENV{'SERVER_SOFTWARE'} && $ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { @@ -8,14 +10,15 @@ if (defined $ENV{'SERVER_SOFTWARE'} && $ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { print "Content-type: text/html\r\n\r\n"; } else { - use lib '..'; + #use lib '..'; #use apacheEnv; #use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; print "Content-type: text/html\n\n"; } + if (!defined trb_init_ports()) { - print stderr "can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}.\n"; + print STDERR "can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}.\n"; die trb_strerror(); } @@ -32,19 +35,22 @@ if(!defined $board || !defined $task) { } $board = hex($board); - sub sendcmd { my ($cmd,$chain) = @_; + return Dmon::PadiwaSendCmd($cmd, $board, $chain); + # all the rest is old my $c = [$cmd,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1<<$chain,0x10001]; my $errcnt = 0; while(1) { trb_register_write_mem($board,0xd400,0,$c,scalar @{$c}); + + if (trb_strerror() =~ "no endpoint has been reached") {return -1;} if (trb_strerror() ne "No Error") { - sleep 1; - if($errcnt >= 5) { + #sleep 1; usleep 3E4; + if($errcnt >= 12) { die "SPI still blocked\n"; } - elsif($errcnt++ >= 6) { + elsif($errcnt++ >= 10) { trb_register_read($board,0xd412); } } diff --git a/web/htdocs/padiwa/padiwa.htm b/web/htdocs/padiwa/padiwa.htm index 5cfcf9d..963f7ab 100644 --- a/web/htdocs/padiwa/padiwa.htm +++ b/web/htdocs/padiwa/padiwa.htm @@ -122,7 +122,7 @@ function update(data) { valmV = "---"; col = findcolor((val),0x6500,0x9000,0); valhex = (val.toString(16)); - valmV = (val*35E-3).toString(10).slice(0,7); + valmV = (val*38.14697E-3).toString(10).slice(0,7); o += ""+valhex+" "+valmV+"mV"+"
"; //console.log(o); }