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

📄 locmsgdef.h

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

#ifndef __MSGHDLER_H__
#define __MSGHDLER_H__

// protocol handle function definition
//
/*
 * DC controller message length
 */
#define	POLLREQLEN	13		// normal polling command length
#define	POLLANALEN	72		// analog data length
#define	POLLDIGLEN	21		// digital data length
#define	POLLADRPOS	4		// normal rtu net id position
#define	POLLANAITM	24		// analog data items

/*
 * DC controller polling commands
 */
static char	anapollcmd[POLLREQLEN] = {
	(char)0xeb, (char)0x90, (char)0xeb, (char)0x90, (char)0x00, (char)0x00, (char)0x00,
	(char)0x03, (char)0x01, (char)0x01, (char)0x00, (char)0x90, (char)0xeb };
static char	digpollcmd[POLLREQLEN] = {
	(char)0xeb, (char)0x90, (char)0xeb, (char)0x90, (char)0x00, (char)0x00, (char)0x00,
	(char)0x03, (char)0x01, (char)0x02, (char)0x00, (char)0x90, (char)0xeb };

/*
 * DC controller message types
 */
typedef enum { 
	POLLDIG = 0,
	POLLANA
} POLLSTS;

//	RTU I/O module and point table for DC controller device
//	=======================================================
//	AI			0		(24)
//	DI			1 - 6	(32)

#define AINORMSLOT		0
#define DINORMSLOT		1
#define PNTPERCARD		32

/*
 * DC controller analog response data structure
 */
typedef struct { 
	char	bigsyn[4];
	char	tarid;
	char	srcid;
	short	len;
	char	cmdtyp;
	char	cmdidx;
	BYTE	inpdat[POLLANAITM][3];
	BYTE	crc;
	char	endsyn[2];
} POLANA;

typedef struct { 
	char	bigsyn[4];
	char	tarid;
	char	srcid;
	short	len;
	char	cmdtyp;
	char	cmdidx;
	BYTE	inpdat[POLLDIGLEN];
	BYTE	crc;
	char	endsyn[2];
} POLDIG;

// meter device type
#define UPSRTUTYPE	 	660

#endif	/* __MSGHDLER_H__ */

⌨️ 快捷键说明

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