Index: trunk/FACT++/scripts/Main.js
===================================================================
--- trunk/FACT++/scripts/Main.js	(revision 17189)
+++ trunk/FACT++/scripts/Main.js	(revision 17190)
@@ -221,15 +221,12 @@
         return;
 
-    this.ok = cnt==0;
-
-    console.out("  DeltaUov=%.3f [N(>0.033V)=%d]".$(avg, cnt));
-}
-
-// DN:  Why is voltageOff() implemented as 
-//      a method of a Subscription to a specific Service
-//      I naively would think of voltageOff() as an unbound function.
-//      I seems to me it has to be a method of a Subscription object, in order
-//      to use the update counting method. But does it have to be
-//      a Subscription to FEEDBACK/DEVIATION, or could it work with other services as well?
+
+    this.ok = cnt==0;// || (this.last!=undefined && Math.abs(this.last-avg)<0.002);
+
+    console.out("  DeltaUov=%.3f (%.3f) [N(>0.033V)=%d]".$(avg, Math.abs(this.last-avg), cnt));
+
+    this.last = avg;
+}
+
 service_feedback.voltageOff = function()
 {
@@ -247,6 +244,4 @@
     {
         dim.log("Switching voltage off.");
-
-        this.ok = undefined;
 
         // Supress the possibility that the bias control is
@@ -260,5 +255,5 @@
     }
 
-    dim.wait("BIAS_CONTROL", "VoltageOff", 60000);
+    dim.wait("BIAS_CONTROL", "VoltageOff", 60000); // FIXME: 30000?
 
     // FEEDBACK stays in CurrentCtrl when Voltage is off but output enabled
@@ -305,8 +300,8 @@
 
     // Wait until voltage on
-    dim.wait("BIAS_CONTROL", "VoltageOn", 60000);
-
-    if (isOff)
-        this.ok = false;
+    dim.wait("BIAS_CONTROL", "VoltageOn", 60000); // FIXME: 30000?
+
+//    if (isOff)
+//        this.ok = false;
 }
 
@@ -324,5 +319,8 @@
     var now = new Date();
 
-    v8.timeout(60000, func, this);
+    this.last = undefined;
+    this.ok = false;
+    v8.timeout(4*60000, func, this); // FIMXE: Remove 4!
+    this.ok = undefined;
 
     if (irq)
@@ -330,6 +328,4 @@
     else
         dim.log("Voltage stable within limits");
-
-    this.ok = undefined;
 }
 
@@ -378,9 +374,10 @@
     //dim.send("FEEDBACK/STOP");
     dim.send("FTM_CONTROL/STOP_TRIGGER");
+
+    dim.wait("FTM_CONTROL",  "Valid",        3000);
+    dim.wait("FEEDBACK",     "Calibrated",   3000);
+
     dim.send("BIAS_CONTROL/DISCONNECT");
-
-    dim.wait("FTM_CONTROL",  "Valid",        3000);
     dim.wait("BIAS_CONTROL", "Disconnected", 3000);
-    dim.wait("FEEDBACK",     "Calibrated",   3000);
 
     var report = sub.get();
@@ -808,4 +805,5 @@
         // It is unclear what comes next, so we better switch off the voltage
         service_feedback.voltageOff();
+
         system_on = true;
         dim.log("Task finished [STARTUP]");
@@ -909,5 +907,4 @@
         console.out("");
         break; // case "RATESCAN"
-
 
     case "DATA":
