From: hadeshyp Date: Wed, 5 Sep 2012 17:22:28 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=096c620a66771c99e31609c3acaae1cf68f7d524;p=daqtools.git *** empty log message *** --- diff --git a/padiwa.pl b/padiwa.pl index 62c9cdd..ec106ba 100755 --- a/padiwa.pl +++ b/padiwa.pl @@ -4,6 +4,8 @@ use FileHandle; use Time::HiRes qw( usleep ); use Data::Dumper; use HADES::TrbNet; +use Date::Format; + if (!defined &trb_init_ports()) { die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}"); @@ -23,9 +25,10 @@ if(!$ARGV[0]) { print "\t led \t\t read LED status. no options\n"; print "\t monitor \t set input for monitor output. options: mask (4 bit)\n"; print "\t monitor \t read monitor selection. no options\n"; + print "\t time \t\t reads compile time. no options\n"; exit; } -my $board, my $value; +my $board, my $value, my $mask; ($board) = $ARGV[0] =~ /^0?x?(\w+)/; $board = hex($board); @@ -134,4 +137,17 @@ if($ARGV[2] eq "monitor") { printf("0x%04x\t%d\t0x%04x\n",$e,$chain,$b->{$e}&0xf); } } - \ No newline at end of file + +if($ARGV[2] eq "time") { + my $ids; + for(my $i = 0; $i <= 1; $i++) { + my $b = sendcmd(0x21000000 + $i*0x10000); + foreach my $e (sort keys $b) { + $ids->{$e}->{$i} = $b->{$e}&0xffff; + } + } + foreach my $e (sort keys $ids) { + printf("0x%04x\t%d\t0x%04x%04x\t%s\n",$e,$chain,$ids->{$e}->{1},$ids->{$e}->{0},time2str('%Y-%m-%d %H:%M',($ids->{$e}->{1}*2**16+$ids->{$e}->{0}))); + } + } + \ No newline at end of file