From 58ed984234dc632d7d23d52eaf7b658445700add Mon Sep 17 00:00:00 2001 From: PANDA DIRDAQ Date: Sat, 12 Jul 2014 02:01:34 +0200 Subject: [PATCH] new scheme of setting registers --- users/gsi_dirc/prepare_padiwas_invert_leds.pl | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 users/gsi_dirc/prepare_padiwas_invert_leds.pl 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"; + + -- 2.43.0