| | |
| | | */
|
| | | #pragma once
|
| | | #include "KDefine.h"
|
| | | typedef struct tagInfoBlockHdr {
|
| | | unsigned short nBlkSign; // 开始标志
|
| | | unsigned short nBlkTypeVer; // 类型和版本
|
| | | unsigned short nBlkSize; // Block 大小, 包括开始和结束标志
|
| | | unsigned short Pad1;
|
| | | }stInfoBlockHdr;
|
| | |
|
| | | typedef struct tagInfoBlockTail {
|
| | |
|
| | | unsigned short CRC16;
|
| | | unsigned short EndSign;
|
| | | }stInfoBlockTail;
|
| | |
|
| | | typedef struct tagBtLdrInfoBlock {
|
| | | stInfoBlockHdr Hdr;
|
| | | unsigned short nBtldrVer;
|
| | | unsigned short nBtldrDevice;
|
| | | unsigned short nBtldrSize; // 设计大小
|
| | | unsigned short nBtldrDataSize; //代码大小 |
| | | unsigned int nBtldr_AppAddr;
|
| | | unsigned int nBtldr_NewAppInfoAddr;
|
| | | unsigned int nBtldr_NewAppAddr;
|
| | | stInfoBlockTail tail;
|
| | | }stBtLdrInfoBlock, * pBtLdrInfoBlock;
|
| | |
|
| | | typedef struct tagAppInfoBlock {
|
| | | stInfoBlockHdr Hdr;
|
| | | unsigned short nAppVer;
|
| | | unsigned short nAppDevice;
|
| | | unsigned short nAppSize; // 设计大小
|
| | | unsigned short nAppDataSize; //代码大小 |
| | | unsigned int nAppStartAddr;
|
| | | unsigned int nAppStartOffset;
|
| | | unsigned int nApp;
|
| | | stInfoBlockTail tail;
|
| | | }stAppInfoBlock, * pAppInfoBlock;
|
| | |
|
| | | class KMachine
|
| | | {
|
| | |
|
| | |
| | | int PopOutVal(void);
|
| | | // int ProcessPLCProg(const stProg * prog, int nSize);
|
| | | int ProcPLC();
|
| | | int ProcessPLCBinProg(const stBinProg1 * pBinprog, int nSize);
|
| | | int ProcessPLCBinProg(const stBinProg1 * pBinprog, int nProgSteps);
|
| | |
|
| | | };
|
| | |
|