]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
new scheme of setting registers
authorPANDA DIRDAQ <M.Traxler@gsi.de>
Sat, 12 Jul 2014 00:01:34 +0000 (02:01 +0200)
committerPANDA DIRDAQ <M.Traxler@gsi.de>
Sat, 12 Jul 2014 00:01:34 +0000 (02:01 +0200)
users/gsi_dirc/prepare_padiwas_invert_leds.pl [new file with mode: 0755]

diff --git a/users/gsi_dirc/prepare_padiwas_invert_leds.pl b/users/gsi_dirc/prepare_padiwas_invert_leds.pl
new file mode 100755 (executable)
index 0000000..0ab3d36
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/perl 
+
+use strict;
+use warnings;
+
+use Parallel::ForkManager;
+
+my $arg=$ARGV[0];
+
+unless ($arg) {
+    print "usage:
+./prepare_padiwas_invert_leds.pl <\"list of hex TRBNet addresses, space separated\">
+";
+exit;
+}
+
+my @padiwas = split /\s+/, $arg;
+
+my $MAX_PROCESSES = 100;
+my $pm = Parallel::ForkManager->new($MAX_PROCESSES);
+
+print "padiwas: inverting padiwa outputs: ";
+
+foreach (@padiwas) { 
+    my $pid = $pm->start and next;
+    print "$_ ";
+    my $c="/home/hadaq/trbsoft/daqtools/padiwa.pl $_ 0 invert 0xffff >/dev/null";
+    qx($c); die "could not execute command $c" if $?;
+    $pm->finish; # Terminates the child process 
+};
+$pm->wait_all_children;
+print "\n";
+
+print "padiwas: turn off all leds: ";
+
+foreach (@padiwas) { 
+    my $pid = $pm->start and next;
+    print "$_ ";
+    my $c="/home/hadaq/trbsoft/daqtools/padiwa.pl $_ 0 led 0x10 >/dev/null";
+    qx($c); die "could not execute command $c" if $?;
+    $pm->finish; # Terminates the child process 
+};
+
+$pm->wait_all_children;
+
+print "\n";
+
+