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
|
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;
include "D:\stubs\michael stubs\Tango_Defines_Basic.cs"
include "D:\stubs\michael stubs\Interfaces\Tango_Defines_LimitSwitch.cs"
//string[] F1_LS_03_Bits = { "F1_LS_SCREW_RIGHT", "F1_LS_SCREW_LEFT", "F1_LS_RSPARE2", "F1_LS_RSPARE1", "F1_LS_RLOADRAM_UP", "F1_LS_RLOADRAM_DOWN", "F1_LS_RLOADMOTOR_UP", "F1_LS_RLOADMOTOR_DOWN", "F1_LS_RDANCER_UP", "F1_LS_RDANCER_DOWN", "F1_SW_SPARE", "F1_SW_SPOOL_EXISTS", "rsv", "rsv", "rsv", "rsv"};
public void OnExecute(StubManager stubManager)
{
int k = 0;
for (int i = 0; i < 10000; i++)
{
stubManager.Write("\n\nIndex =");
stubManager.WriteHex(k,2);
k++;
var RetVal_03 = Fpga_Read_Reg(FPGA1, F1_LS_03_Direct, 0);
stubManager.Write("\nF1_LS_03_Direct =");
stubManager.WriteHex(RetVal_03.Value,4);
if ( (RetVal_03.Value & 0x1) == 0x0)
{
stubManager.Write(" F1_LS_SCREW_RIGHT");
}
if ( (RetVal_03.Value & 0x2) == 0x0)
{
stubManager.Write(" F1_LS_SCREW_LEFT");
}
Thread.Sleep(1000);
}
}
/* Sample output - no limit switches are activated
Index =#00
F1_LS_02_Direct =#3130
F1_LS_03_Direct =#0BE0
Index =#01
F1_LS_02_Direct =#3130
F1_LS_03_Direct =#0BE0
Index =#02
F1_LS_02_Direct =#3130
F1_LS_03_Direct =#0BE0
*/
|