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
|
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_SSR.cs"
include "Tango_Defines_Tacho.cs"
const int Time_Test_On_Second= 60*30*3 ; //1.5 hour
const string File_Name = @"P:\Scripts\Assemblies\Dryer\Blowe_RMO_LOG.CSV"; //3 hour
public void OnExecute(StubManager stubManager)
{
/*
const int LOW = 75;//0 - 100%
var response = stubManager.Run<StubFpgaWriteRegResponse>("StubFpgaWriteRegRequest" ,0x60000400 | 0x112, 0xFF);//Freq 8 bit
var response1 = stubManager.Run<StubFpgaWriteRegResponse>("StubFpgaWriteRegRequest" ,0x60000400 | 0x3EC, LOW+1);//Low 8 bit
var response2 = stubManager.Run<StubFpgaWriteRegResponse>("StubFpgaWriteRegRequest" ,0x60000400 | 0x3EE, 101 - LOW);//High 8 bit
*/
var RetVal=Fpga_Read_Reg(FPGA1, F1_Tacho_reg8, 0);
UInt32 temp;
// stubManager.WriteToFile(File_Name,",RPM ");
for (int i=0;i<Time_Test_On_Second;i++)
{
Thread.Sleep(1000);
RetVal=Fpga_Read_Reg(FPGA1, F1_Tacho_reg8, 0);
temp=60/12; //60 sec
temp=temp *29166667;
temp=temp/RetVal.Value;
temp=temp/250;
// stubManager.AppendToFile(File_Name,i+ ","+ temp );
stubManager.Write("Fan5 Speed- \t"+temp + "\n");
// stubManager.WriteHex(RetVal.Value,4);
}
}
|