Index: trunk/MagicSoft/Cosy/devdrv/macs.cc
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/macs.cc	(revision 808)
+++ trunk/MagicSoft/Cosy/devdrv/macs.cc	(revision 910)
@@ -188,5 +188,5 @@
 }
 
-void Macs::SetHome(LWORDS_t pos)
+void Macs::SetHome(LWORDS_t pos, WORD_t maxtime)
 {
     lout << "- Driving #" << (int)GetId() << " to home position, Offset=" << dec << pos << endl;
@@ -195,6 +195,7 @@
 
     // home also defines the zero point of the system
+    // maximum time allowd for home drive: 25.000ms
     SendSDO(0x3001, string('h','o','m','e'));       // home
-    WaitForSdo(0x3001);
+    WaitForSdo(0x3001, 0, maxtime*1000);
     lout << "- Home position of #" << (int)GetId() << " reached. " << endl;
 
@@ -253,9 +254,24 @@
 }
 
-void Macs::SetSyncMode()
-{
-    lout << "- Setting Sync Mode #" << (int)GetId() << endl;
-    SendSDO(0x3007, string('S', 'Y', 'N', 'C'));
-    WaitForSdo(0x3007);
+void Macs::StartVelSync()
+{
+    //
+    // The syncronization mode is disabled by a 'MOTOR STOP'
+    // or by a positioning command (POSA, ...)
+    //
+    lout << "- Setting Vel Sync Mode #" << (int)GetId() << endl;
+    SendSDO(0x3007, 0, string('S', 'Y', 'N', 'C'));
+    WaitForSdo(0x3007, 0);
+}
+
+void Macs::StartPosSync()
+{
+    //
+    // The syncronization mode is disabled by a 'MOTOR STOP'
+    // or by a positioning command (POSA, ...)
+    //
+    lout << "- Setting Pos Sync Mode #" << (int)GetId() << endl;
+    SendSDO(0x3007, 1, string('S', 'Y', 'N', 'C'));
+    WaitForSdo(0x3007, 1);
 }
 /*
Index: trunk/MagicSoft/Cosy/devdrv/macs.h
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/macs.h	(revision 808)
+++ trunk/MagicSoft/Cosy/devdrv/macs.h	(revision 910)
@@ -2,6 +2,6 @@
 #define MACS_H
 
-#include "timer.h"
 #include "nodedrv.h"
+#include "base/timer.h"
 
 class Macs : public NodeDrv
@@ -51,10 +51,9 @@
     void ReqAxEnd();
     void ReqVelRes();
-    void SetHome(LWORDS_t pos=0);
+    void SetHome(LWORDS_t pos=0, WORD_t maxtime=25);
     void SetAcceleration(LWORD_t acc);
     void SetDeceleration(LWORD_t dec);
     void SetVelocity(LWORD_t vel);
     void SetNoWait(BYTE_t flag=TRUE);
-    void SetSyncMode();
     void SetRpmMode(BYTE_t mode=TRUE);
     void SetRpmVelocity(LWORDS_t cvel);
@@ -64,4 +63,7 @@
 
     void EnableEndswitches(bool neg=true, bool pos=true);
+
+    void StartVelSync();
+    void StartPosSync();
 
     void StartRelPos(LWORDS_t pos);
Index: trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc	(revision 808)
+++ trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc	(revision 910)
@@ -18,5 +18,5 @@
     // Show information
     //
-    pthread_create(&fThread, NULL, MapUpdateThread, this);
+    //    pthread_create(&fThread, NULL, MapUpdateThread, this);
 
 }
@@ -24,5 +24,5 @@
 ShaftEncoder::~ShaftEncoder()
 {
-    pthread_cancel(fThread);
+    //    pthread_cancel(fThread);
 }
 
@@ -91,5 +91,5 @@
     cout << endl;
 }
-
+/*
 void *ShaftEncoder::MapUpdateThread(void *data)
 {
@@ -106,11 +106,38 @@
     return NULL;
 }
-
+*/
+void ShaftEncoder::DisplayVal()
+{
+    static LWORDS_t pos;   // ticks
+    static WORDS_t  vel;   // ticks per 5ms
+    static WORDS_t  acc;   // ticks per 25ms^2
+
+    char text[21];
+
+    if (fPos!=pos)
+    {
+        sprintf(text, "%ld", fPos);
+        fLabel[0]->SetText(new TGString(text));
+    }
+
+    if (fVel!=vel)
+    {
+        sprintf(text, "%d", fVel);
+        fLabel[1]->SetText(new TGString(text));
+    }
+
+    if (fAcc!=acc)
+    {
+        sprintf(text, "%d", fAcc);
+        fLabel[2]->SetText(new TGString(text));
+    }
+}
+/*
 void ShaftEncoder::UpdateThread()
 {
+    return;
     //
     // check for a running thread and lock mutex
     //
-    char text[21];
 
     //
@@ -122,25 +149,19 @@
     while (1)
     {
-        WaitForNextPdo1();
+        usleep(40000);
+        //WaitForNextPdo1();
 
         //
         // Update information
         //
-        sprintf(text, "%ld", fPos);
-        fLabel[0]->SetText(new TGString(text));
-
-        sprintf(text, "%d", fVel);
-        fLabel[1]->SetText(new TGString(text));
-
-        sprintf(text, "%d", fAcc);
-        fLabel[2]->SetText(new TGString(text));
+
 
         //
         // make updated information visible
         //
-        gSystem->ProcessEvents();
-    }
-}
-
+        //gSystem->ProcessEvents(); ----> MCosy::GuiThread
+    }
+}
+*/
 void ShaftEncoder::HandlePDOType0(BYTE_t *data)
 {
Index: trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/shaftencoder.h	(revision 808)
+++ trunk/MagicSoft/Cosy/devdrv/shaftencoder.h	(revision 910)
@@ -23,8 +23,7 @@
     Timer fTime;
 
-    pthread_t fThread;
-
-    static void *MapUpdateThread(void *se);
-    void UpdateThread();
+    //    pthread_t fThread;
+    //    static void *MapUpdateThread(void *se);
+    //    void UpdateThread();
 
     void HandlePDOType0(BYTE_t *data);
@@ -58,4 +57,6 @@
 
     void SetPreset(LWORD_t pre=0);
+
+    void DisplayVal();
 };
 
