From: hadaq Date: Wed, 1 Dec 2021 16:29:37 +0000 (+0100) Subject: fix calculation in ststrate X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=100479c08999c371c5b78716706358a97346d29e;p=hadesdaq.git fix calculation in ststrate --- diff --git a/hmon/hmon_stsrate.pl b/hmon/hmon_stsrate.pl index 156407f..2bc77b9 100755 --- a/hmon/hmon_stsrate.pl +++ b/hmon/hmon_stsrate.pl @@ -51,7 +51,7 @@ trb_init_ports() or die trb_strerror(); my $old; while(1) { - my $o = trb_registertime_read_mem(0xfe4c,0xc000,0,49) or sleep 5 and next; + my $o = trb_registertime_read_mem(0xfe4c,0xdfc0,0,48) or sleep 5 and next; if (defined $old) { foreach my $b (keys %$o) { #my $ratesum = 0; @@ -60,15 +60,14 @@ while(1) { my $old_t = $old->{$b}{time}->[0]; my $t_diff = ($this_t - $old_t) || 1; $t_diff += 2**16 if $t_diff < 0; - $t_diff *= 16; + $t_diff *= 16 / 1E6; my $xpos = (($b>>4)&0xF)*10 + ($b&0xF); for my $v (0..47) { last if $v == 32 && ($b&0xF)==3 && $b < 0x6440; last if $v == 32 && ($b == 0x6464 || $b == 0x6465); - my $vdiff = ($o->{$b}{value}->[$v+1]&0xfffffff) - ($old->{$b}{value}->[$v+1]&0xfffffff); - $vdiff += 2**28 if $vdiff < 0; - + my $vdiff = ($o->{$b}{value}->[$v]&0xffffff) - ($old->{$b}{value}->[$v]&0xffffff); + $vdiff += 2**24 if $vdiff < 0; HPlot::PlotFill('StsRate',$vdiff/$t_diff,$v,$xpos); } } @@ -77,5 +76,5 @@ while(1) { } $old = $o; - sleep 2; + sleep 1; }