Index: /drsdaq/DAQReadout.cc
===================================================================
--- /drsdaq/DAQReadout.cc	(revision 85)
+++ /drsdaq/DAQReadout.cc	(revision 86)
@@ -153,5 +153,8 @@
   char Filename[MAX_PATH];
   snprintf(Filename,sizeof(Filename),"%s/SlowData/", fRawDataPath);
-  SlowDataClass = new SlowData(this, "DAQ", Filename);
+  SlowDataClass = new SlowData("DAQ", Filename);
+  if(SlowDataClass->ErrorCode != 0) {
+   PrintMessage("Warning: Could not open DAQ slowdata file (%s)\n", strerror(SlowDataClass->ErrorCode));
+  }
 }
 
@@ -1275,5 +1278,9 @@
     m->PrintMessage("\rRun #%d (%s) %s, %d events\n",m->RunNumber,daq_runtype_str[m->daq_runtype],(m->NumEvents == m->NumEventsRequested) ? "completed":"stopped",m->NumEvents);
     m->SlowDataClass->NewEntry("Runinfo");
-    m->SlowDataClass->AddToEntry("%d %s %s %d %d",m->RunNumber,daq_runtype_str[m->daq_runtype],m->RHeader->Description,m->NumEvents,m->FileNumber);
+    m->SlowDataClass->AddToEntry("%d %s %s %d %d", m->RunNumber, daq_runtype_str[m->daq_runtype], m->RHeader->Description, m->NumEvents, m->FileNumber);
+    if(m->SlowDataClass->ErrorCode != 0) {
+      m->PrintMessage("SlowData: Error, could not write data to file (%s); closing file\n", strerror(m->SlowDataClass->ErrorCode));
+    }
+
   }
   else m->PrintMessage("\rRun #%d (%s) aborted due to error after %d events\n",m->RunNumber,daq_runtype_str[m->daq_runtype],m->NumEvents);
Index: /drsdaq/HVFeedback.cc
===================================================================
--- /drsdaq/HVFeedback.cc	(revision 85)
+++ /drsdaq/HVFeedback.cc	(revision 86)
@@ -30,5 +30,5 @@
 
   snprintf(Filename,sizeof(Filename),"%s/SlowData/", m->fRawDataPath);
-  SlowDataClass = new SlowData(m, "HVFB", Filename);
+  SlowDataClass = new SlowData("HVFB", Filename);
 
   // Initialise with zero content
Index: /drsdaq/History.txt
===================================================================
--- /drsdaq/History.txt	(revision 85)
+++ /drsdaq/History.txt	(revision 86)
@@ -40,3 +40,4 @@
     	    correct order using writev() (10% gain in rate)
 18/6/2009   Run date is now calculated with a change to the next date on 13:00 UTC.
-	    
+9/7/2009    SlowData class is now independet of PrintMessage() method, thus more
+	    universal	    
Index: /drsdaq/SlowData.cc
===================================================================
--- /drsdaq/SlowData.cc	(revision 85)
+++ /drsdaq/SlowData.cc	(revision 86)
@@ -16,5 +16,5 @@
 // Constructor: Open slow data file (filename generate using current date)
 //
-SlowData::SlowData(DAQReadout* DAQClass, const char* IssuerName, char* Direcory) {
+SlowData::SlowData(const char* IssuerName, const char* Direcory) {
 
   time_t rawtime;
@@ -22,5 +22,4 @@
   char Filename[MAX_PATH];
 
-  m = DAQClass;
   Issuer = IssuerName;
   NewEntryCalled = false;
@@ -31,8 +30,8 @@
   if(timeinfo->tm_hour>=13) rawtime += 12*60*60;
   timeinfo = gmtime(&rawtime);
-  snprintf(Filename,sizeof(Filename),"%s/%s_%d%02d%02d.slow",Direcory,Issuer,timeinfo->tm_year+1900,timeinfo->tm_mon+1,timeinfo->tm_mday);
+  snprintf(Filename, sizeof(Filename), "%s/%s_%d%02d%02d.slow", Direcory, Issuer, timeinfo->tm_year+1900,timeinfo->tm_mon+1,timeinfo->tm_mday);
 
-  if ((SlowdataFile = fopen(Filename, "a")) == NULL)
-    m->PrintMessage("Warning: Could not open slowdata file '%s' (%s)\n", Filename, strerror(errno));
+  if ((SlowdataFile = fopen(Filename, "a")) == NULL) ErrorCode = errno;
+  else ErrorCode = 0;
 }
 
@@ -41,6 +40,5 @@
 //
 SlowData::~SlowData() {
-  if(SlowdataFile!=NULL && fclose(SlowdataFile)==-1)
-    m->PrintMessage("SlowData: Error, could not close slowdata file (%s)\n", strerror(errno));  
+  if(SlowdataFile!=NULL) fclose(SlowdataFile);  
 }
 
@@ -48,5 +46,5 @@
 // Add a new entry to slow data file
 //
-bool SlowData::NewEntry(char *Variable) {
+bool SlowData::NewEntry(const char *Variable) {
 
   time_t RawTime;
@@ -66,5 +64,5 @@
 // Add data to an open entry
 //
-bool SlowData::AddToEntry(char *Format, ...) {
+bool SlowData::AddToEntry(const char *Format, ...) {
 
   char Textbuffer[MAX_COM_SIZE];
@@ -82,5 +80,5 @@
 
   if(fprintf(SlowdataFile, "%s", Textbuffer) == -1) {
-    m->PrintMessage("SlowData: Error, could not write data to file (%s); closing file\n", strerror(errno));
+    ErrorCode = errno;
     fclose(SlowdataFile);
     SlowdataFile = NULL;  
@@ -88,4 +86,5 @@
   }
   fflush(SlowdataFile);
+  ErrorCode = 0;
   return true;
 }
Index: /drsdaq/SlowData.h
===================================================================
--- /drsdaq/SlowData.h	(revision 85)
+++ /drsdaq/SlowData.h	(revision 86)
@@ -7,5 +7,4 @@
 class SlowData {
 
-    class DAQReadout *m;
     const char *Issuer;
     FILE *SlowdataFile;
@@ -14,9 +13,10 @@
 	   	    	  
   public:
-    SlowData(class DAQReadout*, const char*, char*);
+    SlowData(const char*, const char*);
     ~SlowData();
 
-    bool NewEntry(char*);
-    bool AddToEntry(char*, ...);
+    int ErrorCode;	// Set to errno if an error occured, zero otherwise
+    bool NewEntry(const char*);
+    bool AddToEntry(const char*, ...);
 };
 
