⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 locmsgdef.h

📁 用VC编写的设备通讯程序,里面有很多规约,自己下载
💻 H
字号:
//**************************************************************************
//
//
//**************************************************************************
//
//  Filename   :  Msghdler.h
//
//  Subsystem  :
//
//  Description:  Protocol message handlers.
//
//**************************************************************************

#ifndef __MSGHDLER_H__
#define __MSGHDLER_H__

// protocol handle function definition
//
/*
 * meter message types
 */
#define	SYNCODE		0x55
#define	SYNRESN		0xaa
#define	SYNRESA		0xa5
#define	DATAEND		0x0d

#define WSSTADDR	0x1001
#define WSREQLEN	80
#define WSREPLEN	91
#define WSREPBEG	4
#define WSREPDAT	9
#define WSREQCHK	5
#define WSREPCHL	85
#define WSREPCHK	89

typedef struct {			/* status message header	      */
	unsigned char		uid;		/*   unit id					  */
	unsigned char		sync;		/*   synchronization byte (55)	  */
	unsigned short		addr;		/*   data start address			  */
	unsigned char		datlen;		/*   request data length		  */
	unsigned char		chksum;		/*   data check sum				  */
	unsigned char		datend;		/*   data ended code			  */
} WS_POLL;
  
typedef struct {			/* status message header	      */
	unsigned char		uid;		/*   unit id					  */
	unsigned char		sync;		/*   synchronization byte (55)	  */
	unsigned short		addr;		/*   data start address			  */
	unsigned char		datlen;		/*   request data length		  */
	unsigned char		data[1];	/*   data check sum				  */
} WS_RESP;
  

static  WS_POLL wsReqCmd = {0, SYNCODE, 0, 0, 0, DATAEND };
static  WS_RESP *pRetData;

//	RTU I/O module and point table for general meter device
//	=======================================================
//	PA			0		(32)

#define PANORMSLOT		0
#define PNTPERCARD		32

// meter device type
#define METERWSTYPE 	520

#endif	/* __MSGHDLER_H__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -