using System; using System.Text; using System.Linq; using System.Drawing; using System.Diagnostics; using System.Windows.Forms; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using Tango.PMR.Stubs; using Tango.Stubs.UI; public void OnExecute(StubManager stubManager) { // UInt32 : MotorID // UInt32 : MicroSteps // Boolean : SetMicroSteps // UInt32 : ACC // Boolean : SetACC // UInt32 : DEC // Boolean : SetDec // UInt32 : MaxSpeed // Boolean : SetMaxSpeed stubManager.Run("StubMotorInitRequest" ,0, 0, false, 0, false, 0, false, 0, false); // UInt32 : MotorID //Thread.Sleep(1000); // Request ---- // UInt32 : MotorID // UInt32 : SetHomeMarkGOHomeMark // Response ---- // UInt32 : MotorID // UInt32 : Position var response5 = stubManager.Run("StubMotorHomeMarkRequest" ,1, 0);//set home var max_speed = 1000; // Request ---- // UInt32 : MotorID // Boolean : Direction // UInt32 : Position stubManager.RequestTimeout=5000; for (int i = 0; i < 20; i++) { // Response ---- // UInt32 : MotorID // UInt32 : Position // UInt32 : StatusReg // Boolean : Direction // UInt32 : MotStatus // Boolean : STEPLOSSA // Boolean : STEPLOSSB var response2 = stubManager.Run("StubMotorMovRequest" ,1, true, 60000); stubManager.Run("StubMotorStopRequest" ,111, 1); // 0 - SoftHiZ / 1 - HardHiZ / 2 - SoftStop / 3 - HardStop max_speed = max_speed -100; stubManager.Run("StubMotorInitRequest" ,0, 0, false, 0, false, 0, false, max_speed, true); // UInt32 : MotorID // Request ---- // UInt32 : MotorID // UInt32 : SetHomeMarkGOHomeMark // Response ---- // UInt32 : MotorID // UInt32 : Position var response3 = stubManager.Run("StubMotorHomeMarkRequest" ,1, 2);//go home } }