2013-08-19 11:00:05 +08:00
|
|
|
|
#ifndef USER_APP
|
|
|
|
|
#define USER_APP
|
2013-08-03 11:39:51 +08:00
|
|
|
|
/* ----------------------- Modbus includes ----------------------------------*/
|
|
|
|
|
#include "mb.h"
|
|
|
|
|
#include "mbport.h"
|
|
|
|
|
/* ----------------------- Defines ------------------------------------------*/
|
|
|
|
|
#define DISCRETE_INPUT_START 1
|
|
|
|
|
#define DISCRETE_INPUT_NDISCRETES 16
|
|
|
|
|
#define COIL_START 1
|
|
|
|
|
#define COIL_NCOILS 64
|
|
|
|
|
#define REG_INPUT_START 1
|
|
|
|
|
#define REG_INPUT_NREGS 100
|
|
|
|
|
#define REG_HOLDING_START 1
|
|
|
|
|
#define REG_HOLDING_NREGS 100
|
|
|
|
|
|
|
|
|
|
//===========================<3D>ڱ<EFBFBD><DAB1>ּĴ<D6BC><C4B4><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>Ӧ<EFBFBD>Ĺ<EFBFBD><C4B9>ܶ<EFBFBD><DCB6><EFBFBD>========================
|
|
|
|
|
#define HD_RESERVE 0 //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
#define HD_CPU_USAGE_MAJOR 1 //<2F><>ǰCPU<50><55><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>λ
|
|
|
|
|
#define HD_CPU_USAGE_MINOR 2 //<2F><>ǰCPU<50><55><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>С<EFBFBD><D0A1>λ
|
|
|
|
|
|
|
|
|
|
//===========================<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>Ӧ<EFBFBD>Ĺ<EFBFBD><C4B9>ܶ<EFBFBD><DCB6><EFBFBD>========================
|
|
|
|
|
#define IN_RESERVE 0 //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//===========================<3D><><EFBFBD><EFBFBD>Ȧ<EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>Ӧ<EFBFBD>Ĺ<EFBFBD><C4B9>ܶ<EFBFBD><DCB6><EFBFBD>============================
|
|
|
|
|
#define CO_RESERVE 2 //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//===========================<3D><><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>Ӧ<EFBFBD>Ĺ<EFBFBD><C4B9>ܶ<EFBFBD><DCB6><EFBFBD>=========================
|
|
|
|
|
#define DI_RESERVE 1 //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
/*--------------------------Extern Functions------------------------------------*/
|
|
|
|
|
extern UCHAR xMBUtilGetBits( UCHAR * ucByteBuf, USHORT usBitOffset, UCHAR ucNBits );
|
|
|
|
|
extern void xMBUtilSetBits( UCHAR * ucByteBuf, USHORT usBitOffset, UCHAR ucNBits,UCHAR ucValue );
|
|
|
|
|
|
|
|
|
|
#endif
|