From 40cc43af8a7420ab49a8adcb900941eced000b25 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Thu, 14 Jun 2012 12:37:24 +0000 Subject: [PATCH] *** empty log message *** --- cbmrich.txt | 18 +++++++++--------- dac_configuration.txt | 10 +++++----- dac_program.pl | 24 ++++++++++++------------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cbmrich.txt b/cbmrich.txt index 3d7fbc7..b203e59 100644 --- a/cbmrich.txt +++ b/cbmrich.txt @@ -1,9 +1,9 @@ -# Board ChainLen DAC Channel Command Value - f300 1 0 0 3 0x3450 - f300 1 0 1 3 0x1230 - f300 1 0 2 3 0x6780 - f300 1 0 3 3 0x0345 - f300 1 0 4 3 0x3450 - f300 1 0 5 3 0x1230 - f300 1 0 6 3 0x6780 - f300 1 0 7 3 0x0345 +# Board Chain ChainLen DAC Channel Command Value + f300 1 1 0 0 3 0x3450 + f300 1 1 0 1 3 0x1230 + f300 1 1 0 2 3 0x6780 + f300 1 1 0 3 3 0x0345 + f300 1 1 0 4 3 0x3450 + f300 1 1 0 5 3 0x1230 + f300 1 1 0 6 3 0x6780 + f300 1 1 0 7 3 0x0345 diff --git a/dac_configuration.txt b/dac_configuration.txt index 4e483f3..f1b780b 100644 --- a/dac_configuration.txt +++ b/dac_configuration.txt @@ -1,5 +1,5 @@ -# Board ChainLen DAC Channel Command Value - f333 4 0 0 3 0x3450 - f333 4 0 1 3 0x1230 - f333 4 1 0 3 0x6780 - f333 4 2 0 3 0x345 +# Board Chain ChainLen DAC Channel Command Value + f333 1 4 0 0 3 0x3450 + f333 1 4 0 1 3 0x1230 + f333 1 4 1 0 3 0x6780 + f333 1 4 2 0 3 0x3450 \ No newline at end of file diff --git a/dac_program.pl b/dac_program.pl index 4e8a018..6898391 100755 --- a/dac_program.pl +++ b/dac_program.pl @@ -13,11 +13,11 @@ my $fh; if(!$ARGV[0]) { print "usage: dac_program.pl \n\n"; print "Example config file:\n"; - print "# Board ChainLen DAC Channel Command Value\n"; - print " f300 1 0 0 3 0x3450\n"; - print " f300 1 0 1 3 0x1230\n"; - print " f300 1 0 2 3 0x6780\n"; - print " f300 1 0 3 3 0x0345\n"; + print "# Board Chain ChainLen DAC Channel Command Value\n"; + print " f300 1 1 0 0 3 0x3450\n"; + print " f300 1 1 0 1 3 0x1230\n"; + print " f300 1 1 0 2 3 0x6780\n"; + print " f300 1 1 0 3 3 0x0345\n"; exit; } @@ -30,10 +30,9 @@ while (my $a = <$fh>) { $a=~s/#.*//; - if(my ($board,$chain,$dac,$chan,$cmd,$val) = $a =~ /^\s*(\w\w\w\w)\s+(\d+)\s+(\d+)\s+(\d)\s+(\w)\s+(\w+)/) { - if (substr($val,0,2) eq "0x") { - $val = hex(substr($val,2)); - } + if(my ($board,$chain,$chainlen,$dac,$chan,$cmd,$val) = $a =~ /^\s*(\w\w\w\w)\s+(\w+)\s+(\d+)\s+(\d+)\s+(\d)\s+(\w)\s+(\w+)/) { + $val = hex(substr($val,2)) if (substr($val,0,2) eq "0x"); + $chain = hex(substr($chain,2)) if (substr($chain,0,2) eq "0x"); $cmd = hex($cmd); $board = hex($board); @@ -46,9 +45,10 @@ while (my $a = <$fh>) { $values[$i] = 0x00F00000; } $values[16] = $chain; - $values[$chain-1-$dac] = $o; + $values[17] = $chainlen; + $values[$chainlen-1-$dac] = $o; # print Dumper @values; - trb_register_write_mem($board,0xd400,0,\@values,17) or die "trb_register_write_mem: ", trb_strerror(); - usleep(5*$chain); + trb_register_write_mem($board,0xd400,0,\@values,18) or die "trb_register_write_mem: ", trb_strerror(); + usleep(5*$chainlen); } } \ No newline at end of file -- 2.43.0