提交 | 用户 | age
|
0ed438
|
1 |
/*
|
Q |
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
*/
|
|
7 |
#pragma once
|
|
8 |
#include "KDefine.h"
|
|
9 |
class KMachine
|
|
10 |
{
|
|
11 |
|
|
12 |
public:
|
|
13 |
KMachine::KMachine();
|
|
14 |
KMachine::~KMachine();
|
|
15 |
|
|
16 |
stKMem KMem;
|
|
17 |
double StartTime;
|
|
18 |
int nScanCount = 0;
|
|
19 |
int ProgTrace[2048] = { 0 };
|
|
20 |
|
|
21 |
stBinProg1 BinProgs[2000];
|
|
22 |
int nBinProgSteps = 0;
|
|
23 |
|
|
24 |
int m_bPlcRunning = 0;
|
|
25 |
|
|
26 |
double GetTimemS();
|
|
27 |
int GetTick100uS();
|
|
28 |
|
|
29 |
int Init();
|
|
30 |
|
|
31 |
int Download(stBinProg1 * pBinrog, int nBinSteps);
|
|
32 |
|
|
33 |
int Upload();
|
|
34 |
int StartPLC();
|
|
35 |
int StopPLC();
|
|
36 |
int AddMonitor();
|
|
37 |
int ClearMonitor();
|
|
38 |
int DoMonitor();
|
|
39 |
|
|
40 |
|
|
41 |
int GetCoilValue(int nCoilType, int nCoilAddr);
|
|
42 |
int SetCoilValue(int nCoilType, int nCoilAddr, int nCoilValue);
|
|
43 |
|
|
44 |
int GetVarData(int nDataType, int nDataAddr);
|
|
45 |
int SetVarData(int nDataType, int nDataAddr, int nDataValue);
|
|
46 |
|
|
47 |
int InitTimer(int nIndex, int nType);
|
|
48 |
int RunTimer(int nIndex, int SV);
|
|
49 |
int StopTimer(int nIndex);
|
|
50 |
int ResetTimer(int nIndex);
|
|
51 |
int SetTimerValue(int nIndex, int bSet, int SV);
|
|
52 |
int ProcessTimer(int nIndex);
|
|
53 |
int IsTimerOn(int nIndex);
|
|
54 |
int GetTimerSV(int nIndex);
|
|
55 |
int GetTimerEV(int nIndex);
|
|
56 |
|
|
57 |
|
|
58 |
int PushInVal(void);
|
|
59 |
int PopOutVal(void);
|
|
60 |
// int ProcessPLCProg(const stProg * prog, int nSize);
|
|
61 |
int ProcPLC();
|
|
62 |
int ProcessPLCBinProg(const stBinProg1 * pBinprog, int nSize);
|
|
63 |
|
|
64 |
};
|
|
65 |
|