From: PANDA DIRDAQ Date: Sat, 12 Jul 2014 00:01:34 +0000 (+0200) Subject: new scheme of setting registers X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=58ed984234dc632d7d23d52eaf7b658445700add;p=daqtools.git new scheme of setting registers --- diff --git a/users/gsi_dirc/prepare_padiwas_invert_leds.pl b/users/gsi_dirc/prepare_padiwas_invert_leds.pl new file mode 100755 index 0000000..0ab3d36 --- /dev/null +++ b/users/gsi_dirc/prepare_padiwas_invert_leds.pl @@ -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"; + +