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; const Int32 x_KVAL_HOLD = 0x09; const Int32 x_KVAL_RUN = 0x0A; const Int32 x_KVAL_ACC = 0x0B; const Int32 x_KVAL_DEC = 0x0C; const Int32 x_GET_PARAM = 0x20; public void OnExecute(StubManager stubManager) { while (true) { stubManager.Write("\nLeft Load KVAL \t"); var response = stubManager.Run("StubMotorRequest" ,19, (x_GET_PARAM | x_KVAL_HOLD)<<8, 0, 0); stubManager.Write(response.RecivedData); stubManager.Write("\t"); response = stubManager.Run("StubMotorRequest" ,19, (x_GET_PARAM | x_KVAL_RUN)<<8, 0, 0); stubManager.Write(response.RecivedData); stubManager.Write("\t"); response = stubManager.Run("StubMotorRequest" ,19, (x_GET_PARAM | x_KVAL_ACC)<<8, 0, 0); stubManager.Write(response.RecivedData); stubManager.Write("\t"); response = stubManager.Run("StubMotorRequest" ,19, (x_GET_PARAM | x_KVAL_DEC)<<8, 0, 0); stubManager.Write(response.RecivedData); stubManager.Write("\n"); stubManager.Write("Right Load KVAL \t"); response = stubManager.Run("StubMotorRequest" ,24, (x_GET_PARAM | x_KVAL_HOLD)<<8, 0, 0); stubManager.Write(response.RecivedData); stubManager.Write("\t"); response = stubManager.Run("StubMotorRequest" ,24, (x_GET_PARAM | x_KVAL_RUN)<<8, 0, 0); stubManager.Write(response.RecivedData); stubManager.Write("\t"); response = stubManager.Run("StubMotorRequest" ,24, (x_GET_PARAM | x_KVAL_ACC)<<8, 0, 0); stubManager.Write(response.RecivedData); stubManager.Write("\t"); response = stubManager.Run("StubMotorRequest" ,24, (x_GET_PARAM | x_KVAL_DEC)<<8, 0, 0); stubManager.Write(response.RecivedData); stubManager.Write("\n"); stubManager.Write(DateTime.Now.ToString("MM_dd_yyyy_HH_mm_ss")); Thread.Sleep(1000); } }