Index: /trunk/FACT++/scripts/Startup.js
===================================================================
--- /trunk/FACT++/scripts/Startup.js	(revision 15081)
+++ /trunk/FACT++/scripts/Startup.js	(revision 15082)
@@ -44,4 +44,5 @@
 
 console.out("");
+dim.alarm();
 
 var loop;
@@ -175,11 +176,12 @@
     dim.send("PWR_CONTROL/TOGGLE_DRIVE");
 }
-    include("scripts/handleDriveArmed.js");
-
-    checkSend(["DRIVE_CONTROL"]);
-
-    loop = new Handler("ArmDrive");
-    loop.add(handleDriveArmed);
-    loop.run();
+
+include("scripts/handleDriveArmed.js");
+
+checkSend(["DRIVE_CONTROL"]);
+
+loop = new Handler("ArmDrive");
+loop.add(handleDriveArmed);
+loop.run();
 
 
@@ -195,19 +197,9 @@
 //  2) The feedback is stopped
 //  3) The voltage is off
-
-// Check age of calibration
-var service_calibration = new Subscription("FEEDBACK/CALIBRATION");
-
-var data_calibration = service_calibration.get(-5000);
-//if (!data_calibration)
-//    throw new Error("Could not connect to FEEDBACK/CALIBRATION");
-
-function makeCurrentCalibration( reason_string  )
-{
-     console.out( reason_string );
- 
+function makeCurrentCalibration()
+{
      dim.send("BIAS_CONTROL/SET_GLOBAL_DAC", 1);
      dim.wait("BIAS_CONTROL", "VoltageOn", 3000);
- 
+
      var now = new Date();
      dim.send("FEEDBACK/CALIBRATE_CURRENTS");
@@ -227,29 +219,27 @@
 }
 
-if (!data_calibration)
-{
-   // FEEDBACK might just be freshly started and 
-   // will not yet serve this service.
-   var reason_msg = "No current calibration avaliable. New calibration needed.";
-   makeCurrentCalibration( reason_msg );
-}
-else 
-{
-    var age = data_calibration.time;
-    var now = new Date();
-
-    //service_calibration.close();
-
-    var diff = (now-age)/3600000;
-
-    if ((diff>8 && now.getHours()>16)/* || empty*/)
-    {
-        var reason_msg = "Last BIAS crate calibration taken at "+age.toUTCString()+": New calibration needed.";
-        makeCurrentCalibration( reason_msg );
-    }
-}
-
-
-
+// Check age of calibration
+var service_calibration = new Subscription("FEEDBACK/CALIBRATION");
+
+var data_calibration = service_calibration.get(3000, false);
+
+var age = data_calibration.time;
+var now = new Date();
+
+var diff = (now-age)/3600000;
+
+// !data_calibration.data: FEEDBACK might just be freshly
+// started and will not yet serve this service.
+if (data_calibration.data==null || (diff>8 && now.getHours()>16))
+{
+    if (data_calibration.data==null)
+        console.out("No BIAS crate calibration avaliable: New calibration needed.");
+    else
+        console.out("Last BIAS crate calibration taken at "+age.toUTCString()+": New calibration needed.");
+
+    makeCurrentCalibration();
+}
+
+service_calibration.close();
 
 // ================================================================
