]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Mon, 27 Aug 2012 11:31:32 +0000 (11:31 +0000)
committerhadeshyp <hadeshyp>
Mon, 27 Aug 2012 11:31:32 +0000 (11:31 +0000)
README.txt [new file with mode: 0644]
adcplot.pl [new file with mode: 0755]
config/DAC_cbmrich.db [moved from cbmrich.txt with 100% similarity]
config/DAC_config.db [moved from dac_configuration.txt with 100% similarity]
dac_program.pl

diff --git a/README.txt b/README.txt
new file mode 100644 (file)
index 0000000..aea17bd
--- /dev/null
@@ -0,0 +1,2 @@
+adcplot.pl     Takes values (measurements from AD9222 and similar) from a TrbNet-Fifo and plots them using the HPlot library
+dac_progam.pl  Programs a LTC2600 DAC with settings from a db files
diff --git a/adcplot.pl b/adcplot.pl
new file mode 100755 (executable)
index 0000000..9d32c4a
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+use warnings;
+use FileHandle;
+use Time::HiRes qw( usleep );
+use Data::Dumper;
+use HPlot;
+use HADES::TrbNet;
+# my $fh;
+
+trb_init_ports() or die("could not connect to trbnetd");
+# open $fh, "../../trb3/multitest/adcdump.txt" or die $!."\nFile  not found.";
+
+
+my $plot = ();
+$plot->{name}    = "ADC";
+$plot->{file}    = "files/ADC";
+$plot->{entries} = 1000;
+$plot->{type}    = HPlot::TYPE_HISTORY;
+$plot->{output}  = HPlot::OUT_SCREEN;
+$plot->{titles}->[0] = "";
+$plot->{xlabel}  = "sample";
+$plot->{ylabel}  = "value";
+$plot->{sizex}   = 1200;
+$plot->{sizey}   = 900;
+$plot->{ymin} = 0;
+$plot->{ymax} = 2**12;
+$plot->{nokey} = 1;
+HPlot::PlotInit($plot);
+
+
+while(1) {
+
+trb_register_write(0xfadc,0xc000,0) or sleep 5 and next;
+usleep(100);
+my $mux1 = trb_register_read_mem(0xfadc,0xc006,1,1050) or sleep 5 and next;
+
+foreach my $v (@{$mux1->{0xfadc}}) {
+  HPlot::PlotAdd("ADC",$v & 0xfff,0);
+  }
+HPlot::PlotDraw("ADC");
+sleep(1);
+}
+
similarity index 100%
rename from cbmrich.txt
rename to config/DAC_cbmrich.db
similarity index 100%
rename from dac_configuration.txt
rename to config/DAC_config.db
index c0c3c48c8b68ed79ead8a2d200b5e5cff3d4acb5..4abc01fb6fdf3ee61ad70e76ee9dc3335b753f42 100755 (executable)
@@ -33,17 +33,17 @@ while (my $a = <$fh>) {
   if(my ($ref) = $a =~ /^\s*!Reference\s+(\w+)/i) {
     $ref = hex(substr($ref,2)) if (substr($ref,0,2) eq "0x");
     $reference = $ref * 1.;
-    print $reference."\n";
+    print $reference."\n";
     }
  
   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");
+    $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);
+    $cmd   = hex($cmd);
     $board = hex($board);
     
-    if ($val > $reference) {
-      printf("Error, value %i is higher than reference %i\n",$val,$reference);
+    if ($val >= $reference) {
+      printf(STDERR "Error, value %i is higher than reference %i\n",$val,$reference);
       next;
       }