From 00f31fe3564bd9bd364305264abcfb72e7ebdb7a Mon Sep 17 00:00:00 2001 From: "Hadaq@styx" Date: Thu, 12 Dec 2013 16:23:07 +0100 Subject: [PATCH] another try to get git straight --- users/cosy_test/config/cts.sh | 12 ++++++++---- .../cosy_test/config/nxyter/nxsetup_0x3800.dat | 8 ++++---- .../cosy_test/config/nxyter/nxsetup_0x3801.dat | 4 ++-- .../cosy_test/config/nxyter/nxsetup_0x3802.dat | 6 +++--- .../cosy_test/config/nxyter/nxsetup_0x3803.dat | 6 +++--- users/cosy_test/config/nxyter/trb3_setup.sh | 14 +++++++++++--- users/cosy_test/config/startup.sh | 5 +++++ users/cosy_test/evtbuilder_start.sh | 7 +++++++ users/cosy_test/nxscripts/mode_p.sh | 2 ++ users/cosy_test/nxscripts/quicklook.sh | 8 ++++---- users/cosy_test/nxscripts/reset.sh | 2 +- users/cosy_test/nxscripts/set_dacs.sh | 2 +- users/cosy_test/nxscripts/trig_no.sh | 17 ++--------------- users/cosy_test/trbnet_env_pexor.sh | 7 +++++++ web/htdocs/tools/scaler.pl | 8 ++++---- 15 files changed, 64 insertions(+), 44 deletions(-) diff --git a/users/cosy_test/config/cts.sh b/users/cosy_test/config/cts.sh index c6d7b68..9d7d137 100755 --- a/users/cosy_test/config/cts.sh +++ b/users/cosy_test/config/cts.sh @@ -2,14 +2,18 @@ echo "Doing CTS configuration" -#trbcmd w 0x8000 0xa140 0x000f4240 # pulser freq 100 Hz -trbcmd w 0x8000 0xa140 0x05f5e0ff # pulser freq 1 Hz +trbcmd w 0x8000 0xa140 0x000f4240 # pulser freq 100 Hz +#trbcmd w 0x8000 0xa140 0x05f5e0ff # pulser freq 1 Hz trbcmd w 0x8000 0xa141 0x05f5e100 #periodic pulser 1 at 1 Hz for 0xE trigger type trbcmd loadbit 0x8000 0xa148 0x0f00 0x0e00 # setting trigger type E for second pulser -trbcmd setbit 0x8000 0xa101 0x6 # turn on periodic pulser 1 and 0 +#trbcmd setbit 0x8000 0xa101 0x6 # turn on periodic pulser 1 and 0 +trbcmd setbit 0x8000 0xa101 0x2 # turn on periodic pulser 0 +#trbcmd setbit 0x8000 0xa101 0x4 # turn on periodic pulser 1 + +#trbcmd loadbit 0x8000 0xa13d 0x7f 0xa # setting multiplexer input +trbcmd loadbit 0x8000 0xa13d 0x7f 0xc # nim 1 -trbcmd loadbit 0x8000 0xa13d 0x7f 0xa # setting multiplexer input trbcmd loadbit 0x8000 0xa13e 0x7f 0xb # setting multiplexer input trbcmd loadbit 0x8000 0xa129 0x100 0x100 # setting multiplexer input invert diff --git a/users/cosy_test/config/nxyter/nxsetup_0x3800.dat b/users/cosy_test/config/nxyter/nxsetup_0x3800.dat index eeee72c..5f421cb 100644 --- a/users/cosy_test/config/nxyter/nxsetup_0x3800.dat +++ b/users/cosy_test/config/nxyter/nxsetup_0x3800.dat @@ -19,10 +19,10 @@ 0x00000000 # 15 Channel Masks END 0x000000a0 # 16 0x000000ff # 17 -0x00000028 # 18 Common Threshold, default 0x80 +0x00000023 # 18 Common Threshold, default 0x80 0x0000001e # 19 0x0000005f # 20 -0x0000008a # 21 +0x0000008e # 21 0x00000064 # 22 0x00000089 # 23 0x000000ff # 24 Testpulse Strength, default 0x80 @@ -33,8 +33,8 @@ 0x00000045 # 29 0x000000be # 30 0x000000be # 31 -0x00000004 # 32 TestTrigger setup etc. , default 0x00 -0x00000008 # 33 clock input 256A, set bit #3, default 0x08 (normal mode) +0x00000000 # 32 TestTrigger setup etc. , default 0x00 +0x0000000c # 33 clock input 256A, set bit #3, default 0x08 (normal mode) 0x000000be # 34 0x000000be # 35 0x000000be # 36 diff --git a/users/cosy_test/config/nxyter/nxsetup_0x3801.dat b/users/cosy_test/config/nxyter/nxsetup_0x3801.dat index 503ccf3..24db9e5 100644 --- a/users/cosy_test/config/nxyter/nxsetup_0x3801.dat +++ b/users/cosy_test/config/nxyter/nxsetup_0x3801.dat @@ -33,8 +33,8 @@ 0x00000045 # 29 0x000000be # 30 0x000000be # 31 -0x00000000 # 32 TestTrigger setup etc. , default 0x00 -0x0000000c # 33 clock input 256A, set bit #3, default 0x08 (normal mode) +0x00000004 # 32 TestTrigger setup etc. , default 0x00 +0x00000008 # 33 clock input 256A, set bit #3, default 0x08 (normal mode) 0x000000be # 34 0x000000be # 35 0x000000be # 36 diff --git a/users/cosy_test/config/nxyter/nxsetup_0x3802.dat b/users/cosy_test/config/nxyter/nxsetup_0x3802.dat index 1afed2b..3e2d7e6 100644 --- a/users/cosy_test/config/nxyter/nxsetup_0x3802.dat +++ b/users/cosy_test/config/nxyter/nxsetup_0x3802.dat @@ -19,7 +19,7 @@ 0x00000000 # 15 Channel Masks END 0x000000a0 # 16 0x000000ff # 17 -0x00000028 # 18 Common Threshold, default 0x80 +0x00000023 # 18 Common Threshold, default 0x80 0x0000001e # 19 0x0000005f # 20 0x0000009b # 21 @@ -33,8 +33,8 @@ 0x00000045 # 29 0x000000be # 30 0x000000be # 31 -0x00000004 # 32 TestTrigger setup etc. , default 0x00 -0x00000008 # 33 clock input 256A, set bit #3, default 0x08 (normal mode) +0x00000000 # 32 TestTrigger setup etc. , default 0x00 +0x0000000c # 33 clock input 256A, set bit #3, default 0x08 (normal mode) 0x000000be # 34 0x000000be # 35 0x000000be # 36 diff --git a/users/cosy_test/config/nxyter/nxsetup_0x3803.dat b/users/cosy_test/config/nxyter/nxsetup_0x3803.dat index f7506a9..ef4eabc 100644 --- a/users/cosy_test/config/nxyter/nxsetup_0x3803.dat +++ b/users/cosy_test/config/nxyter/nxsetup_0x3803.dat @@ -22,7 +22,7 @@ 0x00000028 # 18 Common Threshold, default 0x80 0x0000001e # 19 0x0000005f # 20 -0x000000a8 # 21 +0x000000ae # 21 0x00000064 # 22 0x00000089 # 23 0x000000ff # 24 Testpulse Strength, default 0x80 @@ -33,8 +33,8 @@ 0x00000045 # 29 0x000000be # 30 0x000000be # 31 -0x00000000 # 32 TestTrigger setup etc. , default 0x00 -0x0000000c # 33 clock input 256A, set bit #3, default 0x08 (normal mode) +0x00000004 # 32 TestTrigger setup etc. , default 0x00 +0x00000008 # 33 clock input 256A, set bit #3, default 0x08 (normal mode) 0x000000be # 34 0x000000be # 35 0x000000be # 36 diff --git a/users/cosy_test/config/nxyter/trb3_setup.sh b/users/cosy_test/config/nxyter/trb3_setup.sh index 82c3e18..32d39f6 100755 --- a/users/cosy_test/config/nxyter/trb3_setup.sh +++ b/users/cosy_test/config/nxyter/trb3_setup.sh @@ -35,13 +35,21 @@ trbcmd rm $board 0x8600 4000 2>/dev/null trbcmd w $board 0x8400 0x00 # 0: normal mode 4: no TS Window mode trbcmd w $board 0x8401 0 # window offset 200ns #trbcmd w $board 0x8402 250 # window width 800ns -trbcmd w $board 0x8402 400 # window width 1600ns -trbcmd w $board 0x8403 125 # CTS-Delay 400ns +trbcmd w $board 0x8402 100 # window width 1600ns +trbcmd w $board 0x8403 100 # CTS-Delay 400ns trbcmd w $board 0x8140 100 # test pulse length 400 ns # TS sync -trbcmd w $board 0x850d 8 # reset all counters + +#if [[ ${board} -eq 0x3801 ]]; then +# trbcmd w $board 0x850d 7; # ts delay +#else + trbcmd w $board 0x850d 8; # ts delay +#fi + +# CVT +trbcmd w $board 0x841a 400 # reset all counters # Decoder Settings trbcmd w $board 0x8120 0 # reset all counters diff --git a/users/cosy_test/config/startup.sh b/users/cosy_test/config/startup.sh index cdfe9c3..f22ae17 100755 --- a/users/cosy_test/config/startup.sh +++ b/users/cosy_test/config/startup.sh @@ -4,6 +4,11 @@ echo "================================" echo "++ Using Daqopserver $DAQOPSERVER." echo "++ Run Reset" + +#pkill trbnetd -SIGUSR1; +#TRB3_SERVER=trb3069 ~/trbsoft/trbnettools/binlocal/trbcmd reset; +#pkill trbnetd -SIGUSR2; + trbcmd reset #Network configuration diff --git a/users/cosy_test/evtbuilder_start.sh b/users/cosy_test/evtbuilder_start.sh index 6853429..1849f8b 100755 --- a/users/cosy_test/evtbuilder_start.sh +++ b/users/cosy_test/evtbuilder_start.sh @@ -49,8 +49,14 @@ cd $tmpdir # source ${HOME}/bin/trbnet_env.sh +#Variants: +#1 without CTS +#2 normal mode with everything +#3 without TRB2 + #exec uxterm -bg khaki -geometry 120x19+945+35 -e "/home/hadaq/bin/daq_evtbuild -m 2 -o ${dest} -x ${pref} -I 1 --ebnum 1 -q 32 -S test -d file ${extraopts}; read; bash" & exec uxterm -bg khaki -geometry 120x20+900+45 -e "/home/hadaq/bin/daq_evtbuild -m 3 -o ${dest} -x ${pref} -I 1 --ebnum 1 -q 32 -S test -d file ${extraopts}; read ; bash" & +#exec uxterm -bg khaki -geometry 120x20+900+45 -e "/home/hadaq/bin/daq_evtbuild -m 2 -o ${dest} -x ${pref} -I 1 --ebnum 1 -q 32 -S test -d file ${extraopts}; read ; bash" & pid=$! echo $pid > $tmpdir/.daq_evtbuild.pid @@ -58,6 +64,7 @@ sleep 1 #exec uxterm -bg tan -geometry 120x19+945+320 -e "/home/hadaq/bin/daq_netmem -m 2 -i UDP:0.0.0.0:50008 -i UDP:0.0.0.0:50009 -q 32 -d 1 -S test ; " & exec uxterm -bg tan -geometry 120x20+900+345 -e "/home/hadaq/bin/daq_netmem -m 3 -i UDP:0.0.0.0:50000 -i UDP:0.0.0.0:50008 -i UDP:0.0.0.0:50009 -q 32 -d 1 -S test ; read ; bash " & +#exec uxterm -bg tan -geometry 120x20+900+345 -e "/home/hadaq/bin/daq_netmem -m 2 -i UDP:0.0.0.0:50000 -i UDP:0.0.0.0:50009 -q 32 -d 1 -S test ; read ; bash " & pid=$! echo $pid > $tmpdir/.daq_netmem.pid diff --git a/users/cosy_test/nxscripts/mode_p.sh b/users/cosy_test/nxscripts/mode_p.sh index 69a5754..9b2dab1 100755 --- a/users/cosy_test/nxscripts/mode_p.sh +++ b/users/cosy_test/nxscripts/mode_p.sh @@ -6,5 +6,7 @@ trbcmd setbit $addr $(( 0x8200 + 32 )) 0x01 trbcmd clearbit $addr $(( 0x8200 + 32 )) 0x08 +trbcmd w $addr 0x8218 0xff + trbcmd w $addr 0x8160 1 trbcmd w $addr 0x8140 100 diff --git a/users/cosy_test/nxscripts/quicklook.sh b/users/cosy_test/nxscripts/quicklook.sh index f0e55e1..9ddf657 100755 --- a/users/cosy_test/nxscripts/quicklook.sh +++ b/users/cosy_test/nxscripts/quicklook.sh @@ -1,8 +1,8 @@ #!/bin/bash -watch -n 1 " \ -trbcmd -d1 r 0xfe49 0x8124; \ -trbcmd -d1 r 0xfe49 0x8125; \ -trbcmd -d1 r 0xfe49 0x8162; \ +watch -n 1 \ +"echo Hit rate [Hz]; trbcmd -D r 0xfe49 0x8124; \ +echo Clocks [Hz]; trbcmd -D r 0xfe49 0x8125; \ +echo Trigger rate [Hz]; trbcmd -D r 0xfe49 0x8162; \ " diff --git a/users/cosy_test/nxscripts/reset.sh b/users/cosy_test/nxscripts/reset.sh index 0d12bed..8bddc25 100755 --- a/users/cosy_test/nxscripts/reset.sh +++ b/users/cosy_test/nxscripts/reset.sh @@ -1,6 +1,6 @@ #!/bin/bash -[ -n $1 ] && addr=0xfe49 || addr=$1 +[ -z $1 ] && addr=0xfe49 || addr=$1 trbcmd w $addr 0x8100 1 trbcmd w $addr 0x8101 1 diff --git a/users/cosy_test/nxscripts/set_dacs.sh b/users/cosy_test/nxscripts/set_dacs.sh index e61a00a..b437703 100755 --- a/users/cosy_test/nxscripts/set_dacs.sh +++ b/users/cosy_test/nxscripts/set_dacs.sh @@ -1,6 +1,6 @@ #!/bin/bash -[ -n $1 ] && addr=0xfe49 || addr=$1 +[ -z $1 ] && addr=0xfe49 || addr=$1 # nx settings diff --git a/users/cosy_test/nxscripts/trig_no.sh b/users/cosy_test/nxscripts/trig_no.sh index 4002bcd..4e4ed34 100755 --- a/users/cosy_test/nxscripts/trig_no.sh +++ b/users/cosy_test/nxscripts/trig_no.sh @@ -1,18 +1,5 @@ #!/bin/bash -[ -n $1 ] && addr=0xfe49 || addr=$1 +[ -z $1 ] && addr=0xfe49 || addr=$1 -trbcmd w $addr 0x8180 0 -trbcmd w $addr 0x8181 0 -trbcmd w $addr 0x8182 250 -trbcmd w $addr 0x8183 100 - -trbcmd w $addr 0x8140 0 -#trbcmd w $addr 0x8144 1 - -trbcmd w $addr 0x8160 0 -trbcmd w $addr 0x8161 0 -#trbcmd w $addr 0x8144 1 - -trbcmd w $addr 0x8102 1 -trbcmd w $addr 0x8103 0 +trbcmd w $addr 0x8400 0x00 diff --git a/users/cosy_test/trbnet_env_pexor.sh b/users/cosy_test/trbnet_env_pexor.sh index ea23497..f66d463 100755 --- a/users/cosy_test/trbnet_env_pexor.sh +++ b/users/cosy_test/trbnet_env_pexor.sh @@ -23,3 +23,10 @@ echo "" #PS1=${COLOR_YELLOW}'\u@\h\[\033[01;34m\] \w$(parse_git_branch)'${COLOR_NC}' ' [ -z "$(pidof trbnetd)" ] && /home/hadaq/trbsoft/trbnettools/bin/trbnetd + +function treset { + pkill trbnetd -SIGUSR1; + ~/trbsoft/trbnettools/binlocal/trbcmd reset; + pkill trbnetd -SIGUSR2; +} + diff --git a/web/htdocs/tools/scaler.pl b/web/htdocs/tools/scaler.pl index 50b6727..7bd37d8 100755 --- a/web/htdocs/tools/scaler.pl +++ b/web/htdocs/tools/scaler.pl @@ -90,7 +90,7 @@ if($ENV{'QUERY_STRING'} =~ /get/) { $delay *= 16.; $delay = 1E6 if $delay == 0; for(my $i = 0; $i<3; $i++) { - $rate->[64+$i] = (($data->{0x8000}->{value}[$i]||0) & 0x00ffffff) - (($olddata->{values}->{0x8000}->{value}[$i]||($data->{0x3820}->{value}[$i]||0)) & 0x00ffffff); + $rate->[64+$i] = (($data->{0x8000}->{value}[$i]||0) & 0x00ffffff) - (($olddata->{values}->{0x8000}->{value}[$i]||($data->{0x8000}->{value}[$i]||0)) & 0x00ffffff); $rate->[64+$i] += 0x01000000 if ($rate->[64+$i] < 0); $rate->[64+$i] = $rate->[64+$i] / ($delay/1E6); } @@ -114,7 +114,7 @@ if($ENV{'QUERY_STRING'} =~ /get/) { $avgsum /= 1-$start; print "

"; $t = sprintf("
CTSAverageCurrentRatio"); - $t .= sprintf("",$j+5,$q,time()/5); + $t .= sprintf("",5,$p[1],time()/5); $t .= sprintf("
Sum%d%d",$avgsum,$sum); for(my $j=0;$j<2;$j++) { my $avgrate = $rate->[$j*2+64]; @@ -152,7 +152,7 @@ elsif($ENV{'QUERY_STRING'} =~ /plot/) { my $q = $ENV{'QUERY_STRING'}; my @p = split('\.',$q); - + my $num = $p[1]; if(-e "/tmp/scalers.$p[2].store") { $data = lock_retrieve("/tmp/scalers.$p[2].store"); } @@ -194,7 +194,7 @@ else { my @setup; $setup[0]->{name} = "Scalers"; - $setup[0]->{cmd} = "get".$ts; + $setup[0]->{cmd} = "get.".$ts; $setup[0]->{period} = 800; $setup[0]->{generic} = 0; -- 2.43.0