Index: trunk/FACT++/src/ratescan.cc
===================================================================
--- trunk/FACT++/src/ratescan.cc	(revision 12239)
+++ trunk/FACT++/src/ratescan.cc	(revision 12240)
@@ -200,8 +200,16 @@
             fCounter++;
 
-            if (fSeconds>=fSecondsMax || fThresholdMin+fCounter*fThresholdStep>fThresholdMax)
+            if (fSeconds>=fSecondsMax)
             {
+                Message("Rate scan stopped due to timeout.");
+                fCounter=-1;
+                return;
+            }
+
+            if (fThresholdMin+fCounter*fThresholdStep>fThresholdMax)
+            {
+                Message("Rate scan finished.");
                 fCounter = -1;
-                cout << "The END" << endl;
+
                 //DimClient::sendCommandNB("FTM_CONTROL/STOP_RUN", NULL, 0);
                 return;
@@ -264,5 +272,5 @@
         const int32_t data[2] = { -1, fThresholdMin };
 
-        Message("Starting Trigger (FTM)");
+        //Message("Starting Trigger (FTM)");
         //Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", int32_t(20));
         Dim::SendCommand("FTM_CONTROL/SET_THRESHOLD", data);
@@ -272,4 +280,10 @@
         fSeconds = -2;
 
+        ostringstream msg;
+        msg << "Rate scan from DAC=" << fThresholdMin << " to DAC=";
+        msg << fThresholdMax << " in steps of " << fThresholdStep;
+        msg << " started.";
+        Message(msg);
+
         return GetCurrentState();
     }
@@ -278,4 +292,5 @@
     {
         fCounter = -1;
+        Message("Rate scan manually stopped.");
 
         //if (fStatusFTM.second==FTM::kTakingData)
