Index: /trunk/FACT++/src/fadctrl.cc
===================================================================
--- /trunk/FACT++/src/fadctrl.cc	(revision 11242)
+++ /trunk/FACT++/src/fadctrl.cc	(revision 11243)
@@ -802,4 +802,25 @@
 
         SetMaxMemory(mem);
+
+        return T::GetCurrentState();
+    }
+
+    int SetFileFormat(const EventImp &evt)
+    {
+        if (!CheckEventSize(evt.GetSize(), "SetFileFormat", 2))
+            return T::kSM_FatalError;
+
+        const uint16_t fmt = evt.GetUShort();
+
+	switch (fmt)
+	{
+	case 0: SetOutputFormat(kNone);  break;
+	case 1: SetOutputFormat(kDebug); break;
+	case 2: SetOutputFormat(kFits);  break;
+	case 3: SetOutputFormat(kRaw);   break;
+	default:
+            T::Error("File format unknonw.");
+            return false;
+        }
 
         return T::GetCurrentState();
@@ -1524,4 +1545,8 @@
             ("");
 
+        T::AddEvent("SET_FILE_FORMAT", "S:1")
+            (boost::bind(&StateMachineFAD::SetFileFormat, this, _1))
+            ("");
+
 
         T::AddEvent("ADD_ADDRESS", "C", FAD::kOffline)
