aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Stubs Collection/stubs/Scripts/Assemblies/Header/header_LimitSwitch.cs
blob: 4454e9c63cf1e751fa0be495f1a1f9ba7dfcec01 (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
40
41
42
43
44
45
46
47
48
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 "..\..\Defines\Tango_Defines_Basic.cs"
include "Tango_Defines_LimitSwitch.cs"
//include "C:\To_Backup\Mulberry\Mulberry_current\Customers\Twine\Tango\LAB_Tests\Main_PCB\ATP_Test\Scripts\Defines\Tango_Defines_Basic.cs"
//include "C:\To_Backup\Mulberry\Mulberry_current\Customers\Twine\Tango\LAB_Tests\Main_PCB\ATP_Test\Scripts\Defines\Tango_Defines_LimitSwitch.cs"




public void OnExecute(StubManager stubManager)
{
 	
 	uint Temp = 0;
	int counter = 0;
	stubManager.Write("\nReading register F1_LS_01_Direct: ");
	var RetVal = Fpga_Read_Reg(FPGA1, F1_LS_01_Direct, 0);
	stubManager.WriteHex(RetVal.Value,4); 
	Temp = RetVal.Value;
	stubManager.Write("\nActivate limit switches one-by-one");
	
	while ( counter != 10000)
	{
		RetVal = Fpga_Read_Reg(FPGA1, F1_LS_01_Direct, 0);
		if (RetVal.Value != Temp)
		{
			stubManager.Write("\nRegister F1_LS_01_Direct new value: ");
			stubManager.WriteHex(RetVal.Value,4);	
			counter = counter + 1;
		}
		Thread.Sleep(100);
			Temp = RetVal.Value;

	}
	


}