aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Stubs Collection/stubs/Scripts/Assemblies/Dryer/GoTo_Dryer_LimitSwitch.cs
blob: bbca9f1d01a91dc6e50ae71902291075ad96b2da (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
49
50
51
52
53
54
55
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 "..\Defines\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)
{
	Int32 Bit = 1;	
 	uint Temp = 0;
	int counter = 0;
	

	stubManager.Run<StubMotorMovResponse>("StubMotorMovRequest" ,4, true, 0x800000 + 00); //  02 close up, 0 open down (0x800000 to use GOTO, The direction is DONT CARE)

	while (Bit != 0x0)		//wait until Dryer Lid open
			{	
					Bit = GetBit(FPGA1, F1_LS_01_Direct,5);	
					Thread.Sleep(10);
			}
					stubManager.Write("\n--------1-Lid Open--------");

stubManager.Run<StubMotorStopResponse>("StubMotorStopRequest" ,4, 2);		//Hard stop hiZ motor
			Thread.Sleep(1000);




stubManager.Run<StubMotorMovResponse>("StubMotorMovRequest" ,4, true, 0x800000 + 02); //  02 close up, 0 open down (0x800000 to use GOTO, The direction is DONT CARE)
	 Bit = 1;	
	while (Bit != 0x0)		//wait until Dryer Lid open
			{	
					Bit = GetBit(FPGA1, F1_LS_01_Direct,4);	
					Thread.Sleep(10);
			}
					stubManager.Write("\n--------2-Lid Close--------");


stubManager.Run<StubMotorStopResponse>("StubMotorStopRequest" ,4, 2);		//Hard stop hiZ motor



}