public static void Move_Method2(IGenericAdvancedMotor device, decimal position) { Console.WriteLine("Moving Device to {0}", position); _taskComplete = false; _taskID = device.MoveTo(position, CommandCompleteFunction); while (!_taskComplete) { Thread.Sleep(500); StatusBase status = device.Status; Console.WriteLine("Device Moving {0}", status.Position); // will need some timeout functionality; } Console.WriteLine("Device Moved"); }
public static void Move_Method1(IGenericAdvancedMotor device, decimal position) { try { Console.WriteLine("Moving Device to {0}", position); device.MoveTo(position, 60000); } catch (Exception) { Console.WriteLine("Failed to move to position"); Console.ReadKey(); return; } Console.WriteLine("Device Moved"); }