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);
}
#include <sstream>
#include <fstream>
#include <vector>
+#include <array>
#include "base/EventProc.h"
#include "base/Event.h"
void second()
{
- new SecondProc("TEST", "TDC_1405", "TDC_1410", "TDC_1411", "TDC_1415");
+ new SecondProc("TEST", "TDC_1401", "TDC_1405", "TDC_1407", "TDC_1408");
}
#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
#!/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) {
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();
}
}
$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);
}
}
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 += "<span class=\"fixed\" style=\"background:"+col+"\">"+valhex+" "+valmV+"mV"+"</span><br>";
//console.log(o);
}