Index: /trunk/FACT++/src/fad.cc
===================================================================
--- /trunk/FACT++/src/fad.cc	(revision 10863)
+++ /trunk/FACT++/src/fad.cc	(revision 10864)
@@ -29,4 +29,5 @@
 {
 private:
+    const int fBoardId;
 
     double   fStartTime;
@@ -54,6 +55,6 @@
 
     // The constructor is prvate to force the obtained pointer to be shared
-    tcp_connection(ba::io_service& ioservice) : ba::ip::tcp::socket(ioservice),
-        fTriggerSendData(ioservice)
+    tcp_connection(ba::io_service& ioservice, int boardid) : ba::ip::tcp::socket(ioservice),
+        fBoardId(boardid), fTriggerSendData(ioservice)
     {
     }
@@ -199,4 +200,5 @@
             case kCmdRun:
             case kCmdRun+0x100:
+                fStartTime = Time(Time::utc).UnixTime();
                 cout << "-> Run" << endl;
                 break;
@@ -278,7 +280,7 @@
     typedef boost::shared_ptr<tcp_connection> shared_ptr;
 
-    static shared_ptr create(ba::io_service& io_service)
-    {
-        return shared_ptr(new tcp_connection(io_service));
+    static shared_ptr create(ba::io_service& io_service, int boardid)
+    {
+        return shared_ptr(new tcp_connection(io_service, boardid));
     }
 
@@ -292,4 +294,5 @@
         fHeader.fStartDelimiter = FAD::kDelimiterStart;
         fHeader.fVersion = 0x104;
+        fHeader.fBoardId = (fBoardId%10) | ((fBoardId/10)<<8);
         fHeader.fStatus = 0xf<<12 |
             FAD::EventHeader::kDenable    |
@@ -345,8 +348,8 @@
     tcp::acceptor acc7;
 
-    int fPort;
+    int fBoardId;
 
 public:
-    tcp_server(ba::io_service& ioservice, int port) :
+    tcp_server(ba::io_service& ioservice, int port, int board) :
         acc0(ioservice, tcp::endpoint(tcp::v4(), port)),
         acc1(ioservice, tcp::endpoint(tcp::v4(), port+1)),
@@ -357,5 +360,5 @@
         acc6(ioservice, tcp::endpoint(tcp::v4(), port+6)),
         acc7(ioservice, tcp::endpoint(tcp::v4(), port+7)),
-        fPort(port)
+        fBoardId(board)
     {
         // We could start listening for more than one connection
@@ -382,5 +385,5 @@
     {
         cout << "Start accept " << acc0.local_endpoint().port() << "..." << flush;
-        tcp_connection::shared_ptr new_connection = tcp_connection::create(/*acceptor_.*/acc0.io_service());
+        tcp_connection::shared_ptr new_connection = tcp_connection::create(/*acceptor_.*/acc0.io_service(), fBoardId);
 
         // This will accept a connection without blocking
@@ -423,5 +426,5 @@
 int main(int argc, const char **argv)
 {
-    try
+    //try
     {
         ba::io_service io_service;
@@ -434,5 +437,5 @@
         for (int i=0; i<n; i++)
         {
-            shared_ptr<tcp_server> server(new tcp_server(io_service, port));
+            shared_ptr<tcp_server> server(new tcp_server(io_service, port, i));
             servers.push_back(server);
 
@@ -450,8 +453,8 @@
         //cout << "end." << endl;
     }
-    catch (std::exception& e)
+    /*catch (std::exception& e)
     {
         std::cerr << e.what() << std::endl;
-    }
+    }*/
 
     return 0;
