QuakeGod
2022-07-22 dd67df95a7303aee3bed65ffa935465f20ee8b32
提交 | 用户 | age
0a20f7 1 #pragma once
Q 2 // 下列 ifdef 块是创建使从 DLL 导出更简单的
3 // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 MDH_SOCKET_EXPORTS
4 // 符号编译的。在使用此 DLL 的
5 // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
6 // MDH_SOCKET_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
7 // 符号视为是被导出的。
8 #ifdef KLINK_EXPORTS
9 #define KLINK2_API __declspec(dllexport)
10 #else
11 #define KLINK2_API __declspec(dllimport)
12 #endif
13
14 //#include "KDefine.h"
15 #include <functional>
16 /*
17
18
19
20 */
326d3e 21 //AFX_EXT_CLASS 
0a20f7 22 // 此类是从KLink2.dll 导出的
Q 23 class KLINK2_API KLink2 {
24
25
26     typedef unsigned char UCHAR;
27     typedef unsigned short USHORT;
28     typedef unsigned int UINT;
29
30 public:
31     KLink2();
32     virtual ~KLink2();
33
34
35 #define TYPECOIL 0x00
36 #define TYPEDATA 0x80
37     enum enKLCoilTypes
38     {
39         KLCoilTypeX = 0 | TYPECOIL,        //X Input
40         KLCoilTypeY = 1 | TYPECOIL,        //Y Output
41         KLCoilTypeR = 2 | TYPECOIL,        //R register
42         KLCoilTypeLX = 3 | TYPECOIL,        //Link register
43         KLCoilTypeLY = 4 | TYPECOIL,        //Link register
44         KLCoilTypeT = 5 | TYPECOIL,        //Timer
45         KLCoilTypeC = 6 | TYPECOIL,        //Counter
46         KLCoilTypeLR = 7 | TYPECOIL,        //Link register
47         KLCoilTypeSR = 8 | TYPECOIL,        //Link register
48
49
50     };
51     enum enKLDataTypes
52     {
53         KLDataTypeDEC = 0 | TYPEDATA,
54         KLDataTypeHEX = 1 | TYPEDATA,
55         KLDataTypeFloat = 2 | TYPEDATA,
56         KLDataTypeWX = 3 | TYPEDATA,
57         KLDataTypeWY = 4 | TYPEDATA,
58         KLDataTypeWR = 5 | TYPEDATA,
59         KLDataTypeWLX = 6 | TYPEDATA,
60         KLDataTypeWLY = 7 | TYPEDATA,
61         KLDataTypeDT = 8 | TYPEDATA,
62         KLDataTypeSDT = 9 | TYPEDATA,
63         KLDataTypeWSR = 10 | TYPEDATA,
64         KLDataTypeSV = 11 | TYPEDATA,
65         KLDataTypeEV = 12 | TYPEDATA,
66         KLDataTypeLD = 13 | TYPEDATA,
67         KLDataSysCfg = 25 | TYPEDATA,
68         KLDataTypeFlash = 33 | TYPEDATA,
69         KLDataTypeTest = 254 | TYPEDATA,
70     };
71     enum enKLDataCounts
72     {
73         KLDataDTCount = 256,
74         KLDataSDTCount = 256,
75
76         KLDataWXCount = 16,
77         KLDataWYCount = 16,
78         KLDataWRCount = 16,
79         KLDataLDCount = 64,
80         KLDataWLCount = 8,
81
82         KLCoilXCount = KLDataWXCount * 16,
83         KLCoilYCount = KLDataWYCount * 16,
84         KLCoilRCount = KLDataWRCount * 16,
85
86         KLCoilTCount = 64,
87         KLCoilCCount = KLCoilTCount,
88         KLDataSVCount = KLCoilTCount,
89         KLDataEVCount = KLCoilTCount,
90
91         KLCoilLXCount = 128,
92         KLCoilLYCount = 128,
93         KLCoilLRCount = 128,
94         KLCoilSRCount = 128,
95
96     };
97     typedef struct tagKLTypeName
98     {
99         int nType;
100         const char * sName;
101         int nRange = 0;
102     }stKLTypeName;
103     static const stKLTypeName KLCoilTypeNames[];
104     static const stKLTypeName KLDataTypeNames[];
105
106     enum eKLResult
107     {
108         KL_ERR = -1,
109         KL_OK = 0,
110         KL_NG = 1,
111         KL_UNKNOWN = 2,
112         KL_TIMEOUT = 3,
113         KL_BCC_ERR = 4,
114         KL_PKG_ERR = 5,
115         KL_SEQ_ERR = 6,
116         KL_LENTH_EXCEED,
117         KL_NEED_PASS,
118         KL_NOT_SUPPORT,
119     };
120     const char * GetErrDescStr(int nErrNo);
121     enum
122     {
123         KLSignStart = '%',
124         KLSignReply = 'U',
125         KLSignEnd = 0x0D,
126         KLMaxPacketLength = 128,
127
128     };
129     enum ExtraDataType
130     {
131         KLExtTypeNone = 0,
132         KLExtTypeText = 1,
133         KLExtTypeCmd = 2,
134         KLExtTypePassTh = 3,
135
136         KLExtTypeTestData = 8,
137     };
138
139     enum enCMDs
140     {
141         //        cmdOK = '1',        //Reply OK
142         //        cmdNG = '2',        //Rplay NG
143         KLCmdNone = 0x00,        //Nothing
144         KLCmdPing = 0x01,            //Ping
145         KLCmdPingReply = 0x02,        //PingReply
146         KLCmdGetInfo = 0x03,            //GetInfo
147         KLCmdVerInfo = 0x04,            //InfoReply
148
149         KLCmdRead = 0x05,            //Read
150         KLCmdReadReply = 0x06,        //ReadReply
151         KLCmdWrite = 0x07,            //Write
152         KLCmdWriteReply = 0x08,    //WriteReply
153         KLCmdSaveToFlash = 0x09,                //Write
154
155         KLCmdExChgData = 0x0A,                //ExChangeDate, = Wirte + Read
156         KLCmdExChgDataReply,            //ExchangeData Reply
157
158         KLCmdSyncRead = 0x0D,                //SyncRead
159         KLCmdSyncWrite,                        //SyncWrite
160         KLCmdSequenRead,                    //Sequence Read
161         KLCmdSyncTime,                        //SyncTime
162
163         KLCmdChgMode = 0x11,
164         KLCmdGetMode = 0x12,
165
166         KLCmdChkPass,
167         KLCmdSetPass,
168         KLCmdEraseAll,
169         KLCmdReadProgram,
170         KLCmdStartProgram,
171         KLCmdWriteProgram,
172         KLCmdFinishProgram,
173
174         KLCmdRead1Bit = 0x21,                //ReadSingleBit
175         KLCmdWrite1Bit = 0x22,                //WriteSingleBit
176
177         KLCmdReadBits = 0x23,                //ReadBits        n = 1 - 8
178         KLCmdWriteBits = 0x24,                //ReadBits        n = 1 - 8
179
180         KLCmdReadBitsByByte = 0x25,            //ReadBitsByByte    ,byteCount
181         KLCmdWriteBitsByByte = 0x26,        //ReadBitsByByte    ,ByteCount
182
183         KLCmdReadBitsByWord = 0x27,            //ReadBitsByWord    ,WordCount
184         KLCmdWriteBitsByWord = 0x28,        //ReadBitsByWord    ,WordCount
185
186         KLCmdReadDataByte = 0x31,            //ByteCount
187         KLCmdWriteDataByte = 0x32,
188
189         KLCmdReadDataWord = 0x33,            //WordCount
190         KLCmdWriteDataWord = 0x34,
191
192         KLCmdReadData = 0x35,                //?Count
193         KLCmdWriteData = 0x36,
194
195         KLCmdReadProg = 0x51,
196         KLCmdWriteProg,
197         KLCmdReadSysCfg,
198         KLCmdWriteSysCfg,
199         KLCmdSaveSysCfg,
200         KLCmdSaveRunStat,
201         KLCmdReadRunStat,
202
203         KLCmdEraseFlashPage = 0x61,
204         KLCmdWriteToFlash = 0x62,
205
206         KLCmdGetEventLogCount,
207         KLCmdGetEventLog,
208         KLCmdClearEventLog,
209         KLCmdGetFactoryData,
210         KLCmdWriteFactoryData,
211         KLCmdResetMachine,
212         KLCmdGetUid,
213         KLCmdSetTime,
214
215         KLCmdMC,
216         KLCmdMD,
217         KLCmdMG,
218
219         KLCmdErrRply = 0xEE,                //ERRORReply
220     };
221
222     typedef struct tagRunStat
223     {
224         unsigned short Sign1;
225         unsigned short Seq1;
226         volatile unsigned short PowerCount;    //
227         volatile unsigned short Reserved1;
228         volatile unsigned int UpTime;        //Seconds;
229         volatile unsigned int UserData1;
230         volatile unsigned short WorkMode;
231         volatile unsigned short WorkMode2;
232         volatile unsigned short nBinProgBank;
233         volatile unsigned short nBinProgSize;
234         unsigned int Reserved2[1];
235         unsigned short CRC1;
236         unsigned short EndSign1;
237     }stRunStat, *pRunStat;
238
239     stRunStat KMRunStat;
240
241     enum enKeventType
242     {
243         EventTypeNone = 0,
244         EventTypePowerUp = 1,
245         EventTypePowerDown = 2,
246         EventTypePowerRecover = 3,
247         EventTypeConnected = 4,
248         EventTypeLostCon = 5,
249         EventTypeSetTime = 6,
250         EventTypeSysCfg = 7,
251         EventTypeProg = 8,
252         EventTypeForce = 9,
253         EventTypeClearEvent = 10,
254
255         EventType
256     };
257
258     typedef struct tagEventLog
259     {
260         unsigned short Sign1;
261         unsigned short Seq1;
262         unsigned int nTime;
263         unsigned short nType;
264         unsigned short nParam1;
265         unsigned int nParam2;
266     }stEventLog, *pEventLog;
267
268
269     typedef struct tagKLCmdName
270     {
271         const int nCmd;
272         const char * sName;
273         const char * sType;
274
275     }KLCmdName;
276
277     const KLCmdName KLCmdNames[42] =
278     {
279         {KLCmdNone,"None",""},    //==0    //Nothing
280         {KLCmdPing,"Ping"},    //=1        //Ping
281         {KLCmdPingReply,"PingReply"}, //2        //PingReply
282         {KLCmdGetInfo,"GetInfo"},//3            //GetInfo
283         {KLCmdVerInfo,"VerInfo"},// = 0x04,            //InfoReply
284
285         {KLCmdRead,"Read","WX;WY;DT;SDT;EV;SV;LD;WL;CFG;FLASH;RAM"},// = 0x05,            //Read
286         {KLCmdReadReply,"ReadReply"},// = 0x06,        //ReadReply
287         {KLCmdWrite,"Write"},// = 0x07,            //Write
288         {KLCmdWriteReply,"WriteReply"},// = 0x08,    //WriteReply
289         {KLCmdSaveToFlash,"SaveToFlash"},// = 0x09,                //Write
290
291         {KLCmdExChgData,"ExChgData"},// = 0x0A,                //ExChangeDate, = Wirte + Read
292         {KLCmdExChgDataReply,"ExChgDataReply"},//,            //ExchangeData Reply
293
294         {    KLCmdSyncRead,"SyncRead"},// = 0x0D,                //SyncRead
295         {    KLCmdSyncWrite,    "SyncWrite"},//                     //SyncWrite
296         {    KLCmdSequenRead,"SequenRead"},//                     //Sequence Read
297         {    KLCmdSyncTime,"SyncTime"},//                         //SyncTime
298
299         {    KLCmdGetMode,"GetMode"},//  = 0x12,
300
301         {    KLCmdChkPass,"ChkPass"},// 
302         {    KLCmdSetPass,"SetPass"},// 
303         {    KLCmdEraseAll,"EraseAll"},// 
304         {    KLCmdReadProgram,"ReadProgram"},// 
305         {    KLCmdWriteProgram,"WriteProgram"},// 
306
307         {    KLCmdRead1Bit,"Read1Bit"},//  = 0x21,                //ReadSingleBit
308         {    KLCmdWrite1Bit,"Write1Bit"},//  = 0x22,                //WriteSingleBit
309
310         {    KLCmdReadBits,"ReadBits"},//  = 0x23,                //ReadBits        n = 1 - 8
311         {    KLCmdWriteBits,"WriteBits"},//  = 0x24,                //ReadBits        n = 1 - 8
312
313         {    KLCmdReadBitsByByte,"ReadBitsByByte"},//  = 0x25,            //ReadBitsByByte
314         {    KLCmdWriteBitsByByte,"WriteBitsByByte"},//  = 0x26,        //ReadBitsByByte
315
316         {    KLCmdReadBitsByWord,"ReadBitsByWord"},//  = 0x27,            //ReadBitsByWord
317         {    KLCmdWriteBitsByWord,"WriteBitsByWord"},//  = 0x28,        //ReadBitsByWord
318
319         {    KLCmdReadDataByte,"ReadDataByte"},//  = 0x31,
320         {    KLCmdWriteDataByte,"WriteDataByte"},//  = 0x32,
321
322         {    KLCmdReadDataWord,"ReadDataWord"},//  = 0x33,
323         {    KLCmdWriteDataWord,"WriteDataWord"},//  = 0x34,
324
325         {    KLCmdReadData,"ReadData"},//  = 0x35,
326         {    KLCmdWriteData,"WriteData"},//  = 0x36,
327
328         {    KLCmdReadProg,"ReadProg"},//  = 0x51,
329         {    KLCmdWriteProg,"WriteProg"},// 
330         {    KLCmdReadSysCfg,"ReadSysCfg"},// 
331         {    KLCmdWriteSysCfg,"WriteSysCfg"},// 
332
333         {    KLCmdSaveSysCfg,"SaveSysCfg"},// 
334     //        KLCmdReadRunStat,
335
336
337         {    KLCmdErrRply,"ErrRply"}//  = 0xEE,                //ERRORReply
338     };
339
340     typedef struct tagKLExtDataFrame
341     {
342         UCHAR Dst;
343         UCHAR nType;
344         UCHAR Len2;
345         UCHAR Data[1];
346     }*pKLExtDataFrame;
347
348
349     typedef union tagKLStatDef
350     {
351         UCHAR StatByte;
352         struct {
353             UCHAR nSEQ : 4;
354             UCHAR HasExt : 1;
355             UCHAR HasErr : 1;
356         };
357     }unKLStat, *pKLStat;
358
359     int m_nSeq = 0;
360     int m_nRSeq = 0;
361     unsigned char m_Dst;
362
363     //unsigned char m_Stat;
364
365     unKLStat m_Stat1 = { 0 };
366     unKLStat m_DstStat;
367     typedef struct tagKLReqPacketDef
368     {
369
370         UCHAR StartSign;
371         UCHAR DstAddr;
372         UCHAR Stat;
373         UCHAR Cmd;
374         UCHAR Type1;
375         UCHAR Params[1];
376     }stKLReqPacket, *pKLReqPacket;
377
378     typedef struct tagKLRplyPktHdr
379     {
380         unsigned char RplyStSgn;    //
381         unsigned char DstAddr;        //
382         unsigned char nStatus;        //
383         unsigned char nRplyCMD;        //
384         unsigned char nSize1;            //
385         unsigned char Datas[1];        //
386     }stKLRplyPktHdr, *pKLRplyPktHdr;
387
388     unsigned char m_Packetbuf[256];
389     unsigned char m_SendBuf[1024];
390     unsigned char m_RecvBuf[1024];
391     unsigned char m_DataBuf[1024];
392
393     typedef struct tagChnStat
394     {
395         unsigned int Stat;
396         unsigned int SendPackets;
397         unsigned int RecvPackets;
398         unsigned int LastSentTimeuS;
399         unsigned int LostPackets;
400         unsigned int CtnLstPkts;
401         unsigned int MaxCtnLstPkts;
402         unsigned int NotPkgErr;
403         unsigned int PkgLenErr;
404         unsigned int BCCErr;
405         unsigned int TimeOutErr;
406         unsigned int Delay;
407         unsigned int MaxDelay;
408         unsigned int SendTimeInterval;
409         union
410         {
411             unsigned int ClientDatas[10];
412             struct {
413                 unsigned int ClientRecvPkts;    //
414                 unsigned int ClientSendPkts;    //
415                 unsigned int ClientNotPktErr;    //
416                 unsigned int ClientMisIdPkts;    //
417                 unsigned int ClientPkgLenErr;    //
418                 unsigned int ClientBccErr;        //
419                 unsigned int ClientTimeOutErr;    //
420             };
421         };
422     } stChnStat, *pChnStat;
423
424     struct tagMEM
425     {
426         union //tagWX
427         {
428             USHORT WX[64];
429             UCHAR WXB[128];
430             UINT WXD[32];
431         };
432         union //tagWY
433         {
434             USHORT WY[64];
435             UCHAR WYB[128];
436             UINT WYD[32];
437         };
438         union //tagDT
439         {
440             USHORT DT[256];
441             UCHAR DTB[512];
442             UINT DTD[128];
443         };
444         union //tagWR
445         {
446             USHORT WR[64];
447             UCHAR WRB[128];
448             UINT WRD[32];
449         };
450         union //tagSDT
451         {
452             UCHAR SDB[512];
453             USHORT SDT[256];
454             UINT SDD[128];
455             struct {
456                 unsigned int EffJumperSW;
457                 unsigned int CurJumperSW;
458                 unsigned int haltick;
459                 unsigned int RunStat;
460                 unsigned int ErrStat;
461                 unsigned int nTickCount;
462                 unsigned int TotalRunTime;
463                 unsigned int ThisRunTime;
464                 unsigned int PwrOnCount;
465                 unsigned int LastScanTime;
466                 unsigned int ScanTimeuS;
467                 unsigned int MinScanTimeuS;
468                 unsigned int MaxScanTimeuS;
469                 unsigned short ADCValues[20];
470             };
471         };
472     }MEM;
473
474     CString m_resultStr;
475
476     static int xtoi(const char * hexstr, int len = 0);
477     unsigned char KLBCC(void * pData, int nSize);
478
479     int CalCRC(void * pBuf, int nSize);
480
481     /*
482         连接状态
483         开始连接(未定)-> 心跳包正常->已连接 -> 心跳包连续正常 -> 连接很好
484
485         连接很好 -> 心跳包 失败 / 数据包失败 -> 已连接 (有错误)
486
487         已连接 (有错误) -> 心跳包正常 -> 已连接
488
489
490
491     */
492
493     int fnTest1(int n);
494
495     int ParseReqPacket();
496     int MakeRplyPacket();
497
498     typedef int(*pSend)(void *, int);
499     typedef int(*pRecv)(void *, int);
500     typedef int(*pOpen)(int);
501     typedef int(*pClose)(int);
502
503     // pSend SendPkgFunc;
504     //  pRecv RecvPkgFunc;
505     //  pOpen OpenFunc;
506     //  pClose CloseFunc;
507
508     std::function<int(void *, int)> SendPkgFunc;
509     std::function<int(void *, int)> RecvPkgFunc;
510     std::function<int(int)> OpenFunc;
511     std::function<int(int)> CloseFunc;
512
513
514
515     int m_bSendCallBackSet = 0;
516     int m_bRecvCallBackSet = 0;
517     int m_bOpenCallBackSet = 0;
518     int m_bCloseCallBackSet = 0;
519
520     bool m_bOpened = false;
521
522     int SetSendCallBackFunc(std::function<int(void *, int)> pSendFunc);
523     int SetRecvCallBackFunc(std::function<int(void *, int)> pRecvFunc);
524     int SetOpenCallBackFunc(std::function<int(int)> pOpenFunc);
525     int SetCloseCallBackFunc(std::function<int(int)> pCloseFunc);
526
527     int m_nErrCount = 0;
528     int m_nContinueErrCount = 0;
529     int Open(int OpenParam = 0)
530     {
531         if (m_bOpenCallBackSet)
532         {
533             OpenFunc(OpenParam);
534         }
535         m_bOpened = true;
536         return KL_OK;
537     };
538     int Close(int CloseParam = 0)
539     {
540         if (m_bCloseCallBackSet)
541         {
542             CloseFunc(CloseParam);
543         }
544         m_bOpened = false;
545         return KL_OK;
546     };
547     int SendPacket(void * pBuf, int Len)
548     {
549         if (m_bOpened && m_bSendCallBackSet) return SendPkgFunc(pBuf, Len);
550         else return KL_ERR;
551     }
552
553     int RecvPacket(void * pBuf, int LenToRead, int ReTryCount = 3)
554     {
555
556         if (m_bOpened && m_bRecvCallBackSet)
557         {
558             int len2 = 0;
559             char * pBufByte = (char *)pBuf;
560             for (int i = 0; i < ReTryCount; i++)
561             {
562                 int len1 = RecvPkgFunc(pBufByte + len2, LenToRead - len2);
563                 len2 += len1;
564                 if (len2 >= LenToRead) break;
565             }
566             if (len2 >= LenToRead) {
567                 m_nContinueErrCount = 0;
568                 return len2;
569             }
570             else if (len2 <= 0) {
571                 m_nErrCount++;
572                 m_nContinueErrCount++;
573                 if (m_nContinueErrCount > 10)
574                 {
575                     //    Close(-1);
576                 }
577                 return KL_ERR;
578             }
579             else {
580                 return len2;
581             }
582         }
583         else
584         {
585             return KL_ERR;
586         }
587     }
588     int GetNextSeq();
589
590     int MakeExtDataFrame(void * pBuf, UCHAR nDst, UCHAR nType, UCHAR len2, void * pData);
591
592     //int MakeReqPacket(void * pBuf, UCHAR nDst, UCHAR Stat, UCHAR nCMD, UCHAR Type, USHORT nAddr = 0, USHORT nCount = 0, void * pData = NULL);
593
594     int MakeReqPacketEx(void * pBuf, UCHAR nDst, UCHAR Stat, UCHAR nCMD, UCHAR Type, USHORT nAddr = 0, USHORT nCount = 0, void * pData = NULL, int ExtFrameLen = 0, void * pExtDataFrame = NULL);
595
596     int CheckPackage(void * pBuf, int nSize);
597     int ProcessPacket(void *pBuf, int nLen);
598     int ParseRplyPacket(void *pBuf, int nPkgLen, UCHAR * nCmd, UCHAR * Status, USHORT* nCount, void * pData);
599
600     int GetInfo(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
601     int GetSN(UCHAR nDst, int * nCount);
602     int GetUID(UCHAR nDst, int * nCount);
603     //int GetTime32(UCHAR nDst, int * nCount);
604     //int SetTime32(UCHAR nDst, int * nCount);
605     int GetDateTime32(UCHAR nDst, UINT * pValue);
606     int SetDateTime32(UCHAR nDst, UINT Value);
607
608
609     int GetEventLogCount(UCHAR nDst, int * nCount);
610     int GetEventLog(UCHAR nDst, int nStartIndex, int nCount, stEventLog * pEventLogs);
611
612
613     int ReadBit(UCHAR nDst, UCHAR nType, USHORT nBitAddr, UCHAR * Value);//Read 1 Single bit
614     int WriteBit(UCHAR nDst, UCHAR nType, USHORT nBitAddr, UCHAR Value);//Write 1 Single bit
615     int ReadBits(UCHAR nDst, UCHAR nBitCount, UCHAR nType, USHORT nBitAddr, UCHAR * Values);
616     int WriteBits(UCHAR nDst, UCHAR nBitCount, UCHAR nType, USHORT nBitAddr, UCHAR * Values);
617     int ReadBitsByWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT *Values);
618     int WriteBitsByWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT *Values);
619
620     int ReadDataByte(UCHAR nDst, UCHAR nByteCount, UCHAR nType, USHORT nByteAddr, UCHAR * Values);
621     int WriteDataByte(UCHAR nDst, UCHAR nByteCount, UCHAR nType, USHORT nByteAddr, UCHAR * Values);
622
623     int ReadDataWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
624     int WriteDataWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
625
626     int ReadData(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
627     int WriteData(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
628
629     int GetMode(UCHAR nDst, UCHAR nType);
630     int ChangeMode(UCHAR nDst, UCHAR nType);
631
632
633     int ReadProgram(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
634
635     int StartProgram(UCHAR nDst, UCHAR nType);
636     int WriteProgram(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
637     int FinishProgram(UCHAR nDst, UCHAR nType, USHORT nStepSize);
638
639     int ReadRunStat(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
640
641 };
642