]> jspc29.x-matter.uni-frankfurt.de Git - coral.git/commitdiff
bug fixes to acquisition time routine
authorMaps <maps@ikf>
Wed, 15 Apr 2015 13:16:01 +0000 (15:16 +0200)
committerMaps <maps@ikf>
Wed, 15 Apr 2015 13:16:01 +0000 (15:16 +0200)
user_interface/pmt_ro.pm

index 9e9ca1a1aa9f9279678aad4761a065cf97c78c3b..b0d6fccdd44fedd8fe0f75c8d026ebea0255960f 100644 (file)
@@ -335,17 +335,19 @@ sub acquisition_time {
   #if value is given, write acquisition time
     for my $try (1..$tries) {
 #     print "try: $try\n";
+      my $success = 0;
       eval {
         my $is = $self->read_register(regName => "acquisition_time");
-        die "could not read acquisition time setting\n";
+        die "could not read acquisition time setting\n" unless(defined($is));
         if ($is eq $value) {
-          last;
+          $success = 1;
         } else {
           $self->write_register(regName => "acquisition_time", value => $value);
         }
       };
+      last if $success;
       if ($@) {
-        warn "sub acquisition time had some problems:\n";
+        warn "sub acquisition_time had some problems:\n";
         warn "(try $try of $tries)\n";
         warn $@;
         warn "trying again\n";