1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
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<StubMotorResponse>("StubMotorRequest" ,19, (x_GET_PARAM | x_KVAL_HOLD)<<8, 0, 0);
stubManager.Write(response.RecivedData);
stubManager.Write("\t");
response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,19, (x_GET_PARAM | x_KVAL_RUN)<<8, 0, 0);
stubManager.Write(response.RecivedData);
stubManager.Write("\t");
response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,19, (x_GET_PARAM | x_KVAL_ACC)<<8, 0, 0);
stubManager.Write(response.RecivedData);
stubManager.Write("\t");
response = stubManager.Run<StubMotorResponse>("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<StubMotorResponse>("StubMotorRequest" ,24, (x_GET_PARAM | x_KVAL_HOLD)<<8, 0, 0);
stubManager.Write(response.RecivedData);
stubManager.Write("\t");
response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,24, (x_GET_PARAM | x_KVAL_RUN)<<8, 0, 0);
stubManager.Write(response.RecivedData);
stubManager.Write("\t");
response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,24, (x_GET_PARAM | x_KVAL_ACC)<<8, 0, 0);
stubManager.Write(response.RecivedData);
stubManager.Write("\t");
response = stubManager.Run<StubMotorResponse>("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);
}
}
|