Index: trunk/FACT++/gui/FactGui.h
===================================================================
--- trunk/FACT++/gui/FactGui.h	(revision 11168)
+++ trunk/FACT++/gui/FactGui.h	(revision 11169)
@@ -391,4 +391,5 @@
     DimStampedInfo fDimFadFwVersion;
     DimStampedInfo fDimFadPllLock;
+    DimStampedInfo fDimFadDrsEnabled;
     DimStampedInfo fDimFadStatistics;
 
@@ -1116,5 +1117,5 @@
     void handleFadPllLock(const DimData &d)
     {
-        if (!CheckSize(d, 43*sizeof(uint8_t)))
+        if (!CheckSize(d, 41*sizeof(uint8_t)))
             return;
 
@@ -1135,8 +1136,8 @@
             {
                 tip << "<td>"
-                    << (int)(ptr[c*10+b+3]&8)
-                    << (int)(ptr[c*10+b+3]&4)
-                    << (int)(ptr[c*10+b+3]&2)
-                    << (int)(ptr[c*10+b+3]&1)
+                    << (int)(ptr[c*10+b+1]&8)
+                    << (int)(ptr[c*10+b+1]&4)
+                    << (int)(ptr[c*10+b+1]&2)
+                    << (int)(ptr[c*10+b+1]&1)
                     << "</td>";
             }
@@ -1146,4 +1147,36 @@
 
         fFadLedPllLock->setToolTip(tip.str().c_str());
+    }
+
+    void handleFadDrsEnabled(const DimData &d)
+    {
+        if (!CheckSize(d, 41*sizeof(uint8_t)))
+            return;
+
+        const uint8_t *ptr = d.ptr<uint8_t>();
+
+        SetLedColor(fFadLedDrsEnabled, d.qos?(ptr[0]?kLedGreen:kLedRed):kLedOrange, d.time);
+
+        ostringstream tip;
+        tip << "<table border='1'><tr><th colspan='11'>" << Time().GetAsStr() << "</th></tr><tr><th></th>";
+        for (int b=0; b<10; b++)
+            tip << "<th>" << b << "</th>";
+        tip << "</tr>";
+
+        for (int c=0; c<4; c++)
+        {
+            tip << "<tr><th>" << c << "</th>";
+            for (int b=0; b<10; b++)
+            {
+                tip << "<td>"
+                    << (ptr[c*10+b+1]?"on":"off")
+                    << "</td>";
+            }
+            tip << "</tr>";
+        }
+        tip << "</table>";
+
+        fFadLedDrsEnabled->setToolTip(tip.str().c_str());
+
     }
 
@@ -1946,4 +1979,7 @@
             return PostInfoHandler(&FactGui::handleFadPllLock);
 
+        if (getInfo()==&fDimFadDrsEnabled)
+            return PostInfoHandler(&FactGui::handleFadDrsEnabled);
+
         if (getInfo()==&fDimFadStatistics)
             return PostInfoHandler(&FactGui::handleFadStatistics);
@@ -2388,4 +2424,5 @@
         fDimFadFwVersion       ("FAD_CONTROL/FIRMWARE_VERSION", (void*)NULL, 0, this),
         fDimFadPllLock         ("FAD_CONTROL/PLL_LOCK",         (void*)NULL, 0, this),
+        fDimFadDrsEnabled      ("FAD_CONTROL/DRS_ENABLED",      (void*)NULL, 0, this),
         fDimFadStatistics      ("FAD_CONTROL/STATISTICS",       (void*)NULL, 0, this)
     {
Index: trunk/FACT++/gui/design.ui
===================================================================
--- trunk/FACT++/gui/design.ui	(revision 11168)
+++ trunk/FACT++/gui/design.ui	(revision 11169)
@@ -3088,5 +3088,5 @@
             <layout class="QGridLayout" name="gridLayout_37">
              <item row="1" column="0">
-              <widget class="QPushButton" name="fFadLedDenable">
+              <widget class="QPushButton" name="fFadLedDrsEnabled">
                <property name="enabled">
                 <bool>true</bool>
Index: trunk/FACT++/src/EventBuilderWrapper.h
===================================================================
--- trunk/FACT++/src/EventBuilderWrapper.h	(revision 11168)
+++ trunk/FACT++/src/EventBuilderWrapper.h	(revision 11169)
@@ -722,4 +722,5 @@
     DimDescribedService fDimFwVersion;
     DimDescribedService fDimPllLock;
+    DimDescribedService fDimDrsEnabled;
     DimDescribedService fDimStatistics;
 
@@ -741,5 +742,6 @@
 	fDimEventData("FAD_CONTROL/EVENT_DATA", "S:1;I:1;S:1;I:2;S:1;S", ""),
         fDimFwVersion("FAD_CONTROL/FIRMWARE_VERSION", "F:43", ""),
-        fDimPllLock("FAD_CONTROL/PLL_LOCK", "C:43", ""),
+        fDimPllLock("FAD_CONTROL/PLL_LOCK", "C:41", ""),
+        fDimDrsEnabled("FAD_CONTROL/DRS_ENABLED", "C:41", ""),
         fDimStatistics("FAD_CONTROL/STATISTICS", "X:8", ""),
         fDebugStream(false), fDebugRead(false)
@@ -1353,5 +1355,5 @@
             const T *ref = reinterpret_cast<const T*>(base+offset);
 
-            vec[i+3] = *ref;
+            vec[i+3] = (*ref&mask)>>shift;
 
 //            if (gi_NumConnect[i/7]!=7)
@@ -1378,16 +1380,16 @@
             return make_pair(false, vec);
 
-        vec[0] =  *min;
+        vec[0] = (*min&mask)>>shift;
         vec[1] = (*val&mask)>>shift;
-        vec[2] =  *max;
+        vec[2] = (*max&mask)>>shift;
 
         return make_pair(rc, vec);
     }
 
-    template<typename T>
-    void Update(DimDescribedService &svc, const pair<bool,boost::array<T, 43>> &data)
+    template<typename T, size_t N>
+    void Update(DimDescribedService &svc, const pair<bool,boost::array<T, N>> &data)
     {
         svc.setQuality(data.first);
-        svc.setData(const_cast<T*>(data.second.data()), sizeof(T)*43);
+        svc.setData(const_cast<T*>(data.second.data()), sizeof(T)*N);
         svc.updateService();
     }
@@ -1444,16 +1446,21 @@
         {
             const pair<bool, boost::array<uint16_t,43>> pll = Compare(&h, &h.fStatus, 0xf<<12, 12);
+            pair<bool, boost::array<uint8_t,41>> data;
+            data.first = pll.first;
+            data.second[0] = pll.second[1];
+            for (int i=0; i<40; i++)
+                data.second[i+1] = pll.second[i+3];
+            Update(fDimPllLock, data);
+        }
+
+        if (old.HasDenable() != h.HasDenable())
+        {
+            const pair<bool, boost::array<uint16_t,43>> drs = Compare(&h, &h.fStatus, FAD::EventHeader::kDenable);
             pair<bool, boost::array<uint8_t,43>> data;
-            data.first = pll.first;
-
-            for (int i=0; i<43; i++)
-                data.second[i] = (pll.second[i]>>12)&0xf;
-            Update(fDimPllLock, data);
-        }
-
-        if (old.HasDenable() != h.HasDenable())
-        {
-            const pair<bool, boost::array<uint16_t,43>> drs = Compare(&h, &h.fStatus, FAD::EventHeader::kDenable);
-            Print("Drs", drs);
+            data.first = drs.first;
+            data.second[0] = drs.second[1];
+            for (int i=0; i<40; i++)
+                data.second[i+1] = drs.second[i+3];
+            Update(fDimDrsEnabled, data);
         }
 
