Index: /trunk/FACT++/src/datalogger.cc
===================================================================
--- /trunk/FACT++/src/datalogger.cc	(revision 12704)
+++ /trunk/FACT++/src/datalogger.cc	(revision 12705)
@@ -2053,4 +2053,8 @@
         names.push_back("MEMBER_NAME");
         dataTypes.push_back(pathTypeName.str());
+        names.push_back("MEMBER_VERSION");
+        dataTypes.push_back("1J");
+        names.push_back("MEMBER_POSITION");
+        dataTypes.push_back("1J");
 
         groupTable = groupFile->addTable("GROUPING", numFilesToGroup, names, dataTypes);
@@ -2064,10 +2068,18 @@
          return;
      }
-
+     try
+     {
+         groupTable->addKey("GRPNAME", "FACT_RAW_DATA", "Data from the FACT telescope");
+     }
+     catch (CCfits::FitsException e)
+     {
+         Error("CCfits::Table::addKey failed for 'GRPNAME' in '"+groupName+"-GROUPING': "+e.message());
+         return;
+     }
     //CCfits seems to be buggy somehow: can't use the column's function "write": it create a compilation error: maybe strings were not thought about.
     //use cfitsio routines instead
     groupTable->makeThisCurrent();
     //create appropriate buffer.
-    const unsigned int n = 8 + 3 + 2*maxCharLength + 1; //+1 for trailling character
+    const unsigned int n = 8 + 3 + 2*maxCharLength + 1 + 8; //+1 for trailling character
 
     vector<unsigned char> realBuffer;
@@ -2080,7 +2092,11 @@
     char* startOfLocation  = reinterpret_cast<char*>(&fitsBuffer[8 + 3]);
     char* startOfName      = reinterpret_cast<char*>(&fitsBuffer[8+3+maxCharLength]);
+ //   char* startOfMemVer    = reinterpret_cast<char*>(&fitsBuffer[8+3+2*maxCharLength]);
+ //   char* startOfMemPos    = reinterpret_cast<char*>(&fitsBuffer[8+3+2*maxCharLength+1]);
 
     strcpy(startOfExtension, "BINTABLE");
     strcpy(startOfURI,       "URL");
+    fitsBuffer[8+3+2*maxCharLength+3] = 1;
+    fitsBuffer[8+3+2*maxCharLength+7] = 1;
 
     int i=1;
@@ -2099,5 +2115,5 @@
 
             int status = 0;
-            fits_write_tblbytes(groupFile->fitsPointer(), i, 1, 8+3+2*maxCharLength, fitsBuffer, &status);
+            fits_write_tblbytes(groupFile->fitsPointer(), i, 1, 8+3+2*maxCharLength +8, fitsBuffer, &status);
             if (status)
             {
