Index: trunk/FACT++/src/StateMachineDimControl.cc
===================================================================
--- trunk/FACT++/src/StateMachineDimControl.cc	(revision 14550)
+++ trunk/FACT++/src/StateMachineDimControl.cc	(revision 14551)
@@ -297,4 +297,6 @@
     fMutex.unlock();
 
+    fStateCallback(server, state);
+
     return GetCurrentState();
 }
@@ -342,11 +344,21 @@
     if (server!="DIS_DNS")
     {
-        DimDescriptions *d = new DimDescriptions(server);
-
-        fDimDescriptionsList.push_back(d);
-        d->SetCallback(bind(&StateMachineDimControl::HandleStateChange, this, server, d));
-        d->SetCallbackStates(bind(&StateMachineDimControl::HandleStates, this, server, d));
-        d->SetCallbackDescriptions(bind(&StateMachineDimControl::HandleDescriptions, this, d));
-        d->Subscribe(*this);
+        struct Find : string
+        {
+            Find(const string &ref) : string(ref) { }
+            bool operator()(const DimDescriptions *dim) { return *this==dim->server; }
+        };
+
+        if (find_if(fDimDescriptionsList.begin(), fDimDescriptionsList.end(),
+                    Find(server))==fDimDescriptionsList.end())
+        {
+            DimDescriptions *d = new DimDescriptions(server);
+
+            fDimDescriptionsList.push_back(d);
+            d->SetCallback(bind(&StateMachineDimControl::HandleStateChange, this, server, d));
+            d->SetCallbackStates(bind(&StateMachineDimControl::HandleStates, this, server, d));
+            d->SetCallbackDescriptions(bind(&StateMachineDimControl::HandleDescriptions, this, d));
+            d->Subscribe(*this);
+        }
     }
 
Index: trunk/FACT++/src/StateMachineDimControl.h
===================================================================
--- trunk/FACT++/src/StateMachineDimControl.h	(revision 14550)
+++ trunk/FACT++/src/StateMachineDimControl.h	(revision 14551)
@@ -21,4 +21,6 @@
     std::map<std::pair<std::string, int32_t>, std::pair<std::string, std::string>> fStateDescriptionList;
     std::map<std::string, std::vector<Description>> fServiceDescriptionList;
+
+    std::function<void(const std::string &, const State&)> fStateCallback;
 
     DimVersion fDim;
@@ -63,4 +65,6 @@
     void SendDimCommand(const std::string &server, std::string str, std::ostream &lout);
 
+    void SetStateCallback(const std::function<void(const std::string &, const State &)> &func) { fStateCallback = func; }
+
 public:
     StateMachineDimControl(std::ostream &out=std::cout);
