Index: fact/FADctrl/FAD.cc
===================================================================
--- fact/FADctrl/FAD.cc	(revision 10969)
+++ fact/FADctrl/FAD.cc	(revision 10980)
@@ -62,4 +62,5 @@
   Datafile = -1;
   EventUpdateDelay = atof(GetConfig("EventUpdateDelay", "0.5").c_str());
+  TimeForDIMUpdate = 0;
 
   // Create pipe for data exchange
@@ -633,5 +634,5 @@
 	else if (Mode == acalib) PrintMessage("Current mode is ACALIB (3x%d events, slowest board %d has %d events)\n", NumEventsRequested, SlowestBoard, MinCount);
 	else if (Mode == datarun) PrintMessage("Current mode is DATARUN (%d events requested, %d events taken)\n", NumEventsRequested, NumEvents);
-
+	PrintMessage("Execution time of last DIM event update %d seconds\n", TimeForDIMUpdate);
 	return;
   }    
@@ -999,9 +1000,12 @@
 	}
 
-	// Check if DIM service should be updated
-	if ((Time.tv_sec-LastUpdate.tv_sec)*1e6 + Time.tv_usec-LastUpdate.tv_usec > EventUpdateDelay*1e6) {
+	// Check if DIM service should be updated (delay between updates at least 10xtime to update)
+	if ((Time.tv_sec-LastUpdate.tv_sec)*1e6 + Time.tv_usec-LastUpdate.tv_usec > max(10*TimeForDIMUpdate, EventUpdateDelay)*1e6) {
 	  gettimeofday(&LastUpdate, NULL);
+
 	  EventService.updateService(EventData, sizeof(RunHeader) + sizeof(EventHeader) + ActiveBoards.size()*(sizeof(BoardStructure) + NChips*NChannels*NBins*sizeof(short) + NChips*sizeof(int)));
 	  EventNumService.updateService();
+
+	  TimeForDIMUpdate = time(NULL) - LastUpdate.tv_sec;
 	  if (Mode == datarun) FileSizeService.updateService();
 	}
@@ -1043,18 +1047,4 @@
 	NumEvents++;
 
-	// Write event header to file
-	//if(write(Datafile, EHeader, sizeof(EventHeader)) != sizeof(EventHeader)) Error = true;
-
-	// Write trigger cells
-	//for (unsigned int i=0; i<ActiveBoards.size(); i++) {
-	  //if(write(Datafile, TriggerCell + i*NChips, NChips*sizeof(int)) != NChips*sizeof(int)) Error = true;
-	//}
-
-	// Write ADC data
-	//unsigned int Bins = NChips*NChannels*NBins;
-	//for (unsigned int i=0; i<ActiveBoards.size(); i++) {
-	  //if(write(Datafile, Data+i*Bins, Bins*sizeof(short)) != (ssize_t) (Bins*sizeof(short))) Error = true;
-	//}
-	
 	// Update file size
 	if (fstat(Datafile, &FileStat) == -1) Error = errno;
Index: fact/FADctrl/FAD.h
===================================================================
--- fact/FADctrl/FAD.h	(revision 10969)
+++ fact/FADctrl/FAD.h	(revision 10980)
@@ -46,4 +46,5 @@
 	static void LaunchEventThread(class FAD *);
 	pthread_t Thread;
+	float TimeForDIMUpdate;
 
     int Datafile;
Index: fact/FADctrl/FADBoard.cc
===================================================================
--- fact/FADctrl/FADBoard.cc	(revision 10969)
+++ fact/FADctrl/FADBoard.cc	(revision 10980)
@@ -470,8 +470,8 @@
 	  while (!Continue) {
 		struct timespec Wakeup;
-		Wakeup.tv_sec = time(NULL)+5;
+		Wakeup.tv_sec = time(NULL)+MAX_WAIT_FOR_CONDITION;
 		Wakeup.tv_nsec = 0;
 		if ((Ret = pthread_cond_timedwait(&CondVar, &Mutex, &Wakeup)) != 0) {
-		  if (Ret == ETIMEDOUT) printf("Board %s timed out (5 s) waiting for condition\n", Name);
+		  if (Ret == ETIMEDOUT) SetStatus("Board %s timed out (%d s) waiting for condition\n", Name, MAX_WAIT_FOR_CONDITION);
 		  else m->Message(m->ERROR, "pthread_cond_wait() failed (%s)", strerror(Ret));
 		}
Index: fact/FADctrl/FADBoard.h
===================================================================
--- fact/FADctrl/FADBoard.h	(revision 10969)
+++ fact/FADctrl/FADBoard.h	(revision 10980)
@@ -22,4 +22,5 @@
 const unsigned int READ_BUFFER_SIZE = 1000000;
 const unsigned int STATUS_SIZE = 200;
+const int MAX_WAIT_FOR_CONDITION = 10;
 
 class FADBoard: public DimThread {
Index: fact/FADctrl/History.txt
===================================================================
--- fact/FADctrl/History.txt	(revision 10969)
+++ fact/FADctrl/History.txt	(revision 10980)
@@ -31,2 +31,3 @@
 25/5/2011	dcm_lock and dcm_ready bits were incorrectly evaluated.
 3/6/2011	Raw data files will only contain boards active at the start of the run.
+7/6/2011	DIM event service only contains active boards
