aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Stubs Collection/stubs/mot run.cs
blob: b9c2c938c098835237cc794f738d788264a13835 (plain)
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
40pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.h
using System;
using System.Text;
using System.Linq;
using System.Drawing;<
an class="w"> System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using Tango.PMR.Stubs; using Tango.Stubs; public void OnExecute(StubManager stubManager) { //stubManager.Run("StubMotorStopRequest" ,22, 1); // 0 - SoftHiZ / 1 - HardHiZ / 2 - SoftStop / 3 - HardStop //Thread.Sleep(1000); // Request ---- // UInt32 : MotorID // UInt32 : MicroSteps // Boolean : SetMicroSteps // UInt32 : ACC // Boolean : SetACC // UInt32 : DEC // Boolean : SetDec // UInt32 : MaxSpeed // Boolean : SetMaxSpeed //stubManager.Run<StubMotorInitResponse>("StubMotorInitRequest" ,22, 1, true, 0x0ff, true, 0x0ff, true, 0x3ff, true); // 0x3ff for QSH2818-32-07-006 roker //stubManager.Run<StubMotorInitResponse>("StubMotorInitRequest" ,21, 0, true, 0x0ff, true, 0x0ff, true, 50000, true); // fidder //stubManager.Run<StubMotorInitResponse>("StubMotorInitRequest" ,0, 0, true, 0, true, 0, true, 0, true); // Request ---- // UInt32 : MotorID // UInt32 : MicroSteps // Boolean : SetMicroSteps // UInt32 : ACC // Boolean : SetACC // UInt32 : DEC // Boolean : SetDec // UInt32 : MaxSpeed // Boolean : SetMaxSpeed // UInt32 : MinSpeedLSPDOPT // Boolean : SetMinSpeedLSPDOPT // UInt32 : Config // UInt32 : KVALHOLD // UInt32 : KVALRUN // UInt32 : KVALACC // UInt32 : KVALDEC // UInt32 : STSLP // UInt32 : INTSPD // UInt32 : FNSLPACC // UInt32 : FNSLPDEC // Response ---- // UInt32 : MotorID // UInt32 : Status //stubManager.Run<StubMotorInitResponse>("StubMotorInitRequest" ,18, 0, true, 0x0ff, true, 0x0ff, true, 50000, true, 0, true, 1, 1, 1, 1, 1, 1, 1, 1, 1); //stubManager.Run("StubMotorStopRequest" ,18, 1); // 0 - SoftHiZ / 1 - HardHiZ / 2 - SoftStop / 3 - HardStop //Thread.Sleep(1000); for (int i= 0 ;i<10;i++) { stubManager.Run("StubMotorRunRequest" ,14, false, 8000 ); //5000 fidder (18 TESTED) Thread.Sleep(590); var response = stubManager.Run<StubMotorSpeedResponse>("StubMotorSpeedRequest" ,14); stubManager.Write(response.Speed); stubManager.Write("\n\n"); Thread.Sleep(10); stubManager.Run("StubMotorRunRequest" ,14, true, 8000 ); //5000 fidder (18 TESTED) Thread.Sleep(600); } //stubManager.Run<StubMotorStatusResponse>("StubMotorStatusRequest" ,15, true); //Thread.Sleep(1000); // Request ---- // UInt32 : MotorID // Response ---- // UInt32 : MotorID // Double : Speed //stubManager.Run<StubMotorSpeedResponse>("StubMotorSpeedRequest" ,15); stubManager.Run("StubMotorStopRequest" ,14, 2); // 3 - SoftHiZ / 2 - HardHiZ / 1 - SoftStop / 0 - HardStop }