Index: trunk/FACT++/scripts/Main.js
===================================================================
--- trunk/FACT++/scripts/Main.js	(revision 16386)
+++ trunk/FACT++/scripts/Main.js	(revision 16441)
@@ -195,5 +195,4 @@
         return;
 
-    this.voltageStep = null;
     if (!evt.data)
         return;
@@ -216,5 +215,5 @@
     this.previous = avg;
 
-    console.out("  DeltaV="+this.voltageStep);
+    console.out("  DeltaV=%.3f".$(this.voltageStep));
 }
 
@@ -253,5 +252,5 @@
 
         // Switch voltage off
-        console.out("  Voltage on: switch off");
+        console.out("  "+new Date().toUTCString()+": Voltage off: switch off");
         dim.send("BIAS_CONTROL/SET_ZERO_VOLTAGE");
 
@@ -303,5 +302,5 @@
     if (isOff)
     {
-        console.out("  Voltage on: switch on");
+        console.out("  "+new Date().toUTCString()+": Voltage on: switch on");
         //console.out(JSON.stringify(dim.state("BIAS_CONTROL")));
 
@@ -347,15 +346,14 @@
     console.out("  Feedback wait: start");
 
-    function func(service)
-    {
-        if ((service.cnt!=undefined && service.get().counter>service.cnt+10) ||
-            (service.voltageStep && service.voltageStep<0.02))
+    function func()
+    {
+        if ((this.cnt!=undefined && this.get().counter>this.cnt+10) ||
+            (this.voltageStep && this.voltageStep<0.02))
             return true;
     }
 
     var now = new Date();
-    //v8.timeout(5*60000, func, this);
-    while ((this.cnt==undefined || this.get().counter<=this.cnt+10) && (!this.voltageStep || this.voltageStep>0.02))
-        v8.sleep(100);
+
+    v8.timeout(4*60000, func, this);
 
     console.out("  Feedback wait: end [dV=%.3f, cnt=%d, %.2fs]".$(this.voltageStep, this.get().counter, (new Date()-now)/1000));
