 ===================================================================
 --- DeviceAdapters/Prior/Prior.cpp	(revision 15982)
 +++ DeviceAdapters/Prior/Prior.cpp	(working copy)
-@@ -984,27 +984,34 @@
+@@ -33,6 +33,15 @@
+ #include "../../MMDevice/ModuleInterface.h"
+ #include <sstream>
+ 
++#ifdef _WIN32
++#include <Windows.h>
++#define SLEEP(t) (Sleep(t))
++#else
++#include <unistd.h>
++#define SLEEP(t) (usleep(t)*1000)
++#endif
++#define SLEEP_TIME 500
++
+ const char* g_XYStageDeviceName = "XYStage";
+ const char* g_ZStageDeviceName = "ZStage";
+ const char* g_NanoStageDeviceName = "NanoScanZ";
+@@ -970,7 +979,7 @@
+ 
+    return false;
+ }
+- 
++
+ int XYStage::SetPositionSteps(long x, long y)
+ {
+    MMThreadGuard guard(lock_);
+@@ -984,27 +993,40 @@
     command << "G," << x << "," << y;
  
     // send command

+   const int MAX_TRIES = 50;
+   while (tries++ < MAX_TRIES) {
+       ret = SendSerialCommand(port_.c_str(), command.str().c_str(), "\r");
+       if (ret != DEVICE_OK)
+           continue;
 
-   // block/wait for acknowledge, or until we time out;
-   std::string answer;

+   const int MAX_TRIES = 100;
+   while (tries++ < MAX_TRIES) {
+       ret = SendSerialCommand(port_.c_str(), command.str().c_str(), "\r");
+       if (ret != DEVICE_OK) {
+           SLEEP(SLEEP_TIME);
+           continue;
+       }
 
-   // block/wait for acknowledge, or until we time out;
-   std::string answer;
