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

📄 gencmr.h

📁 用VC编写的设备通讯程序,里面有很多规约,自己下载
💻 H
字号:
/*-----------------------------------------------------------------------------
 * GENCMR.H	- GENERAL CUSTOMER PROTOCOL DATA STRUCTURE DEFINITION
 *
 * LAST EDIT: 08-Feb-02	xcy
 *
 *		++++++++++++++++++++++++++
 *		+ Central Control System +
 *		++++++++++++++++++++++++++
 *
 * FUNCTIONAL DESCRIPTION
 *
 *	This file defines the general protocol data structure.
 *
 *	*** DO NOT CHANGE ANY DEFINITION IN THIS FILE ***
 *
 *
 * UPDATE HISTORY
 *
 *	000  08-Feb-02		New version.
 *-----------------------------------------------------------------------------
 */

#ifndef __GENCMR_H__               // Only Include Once
#define __GENCMR_H__

#define DEBUGOUT		0

// protocol specific data definition

#define UNACKALRM		0x00000008	// for mapboard unacknowledged alarm
#define OUTOFSERV		0x00000080	// for mapboard out of service

#define	MAX_MSG_POOLCNT	4096
#define PORT_DATALEN	8
#define PORT_STOPBIT	1
#define PORT_FLWCTRL	NONE

#define DIOPROTOCOL	1

#define POLL_RQST	1		// poll action
#define INIT_POLL	2		// init poll function code
#define INFO_POLL	3		// poll function code
#define RFLH_POLL	4		// reflush function code
#define DIGI_COMD	5		// send digital command
#define ANAL_COMD	6		// send analog command
#define TIME_SYNC	7		// send time synchronization command
#define RELY_COMD	8		// send relay control command

#define CMDOFFSET	10		// customer command offset

#define	PORTINIRTY	20		// port initialize retry times
#define	PORTINIWAIT	3000	// port initialize waiting time
#define TRDEXTWAIT	3000	// time(ms) for waiting GetIncomData to exit
#define	FOVINIWAIT	5000	// fov initialize waiting time

// point status tag definition for setup function SetPntStatusFlag()
#define	PNTGLOBALTAG	1	// point global tag
#define	PNTTRAINTAG		2	// point training tag
#define	PNTVERIFYTAG	3	// point verification tag

class CPio;
typedef VOID (__cdecl *LPUNPACKFUNC) (CPio *pPio, int rtuStream);

typedef struct {
    WORD year;
    WORD mon;
    WORD day;
    WORD hour;
    WORD min;
    WORD sec;
    WORD cms;
} SOETIME;

typedef struct
{
	void	*pRtu;			/* RTU database address		  */
	int		pntIdx;			/* point database index		  */
	int		rGrpIdx;		/* RTU group index		      */
	int		rPntIdx;		/* RTU point index		      */
	int		lvalue;			/* long value			      */
	float	fvalue;			/* float value			      */
	int		cmdIdx;			/* command index		      */
    int		FuncCode;		// message function code
} REQUEST_MSGS;

typedef enum { 
	PIO__NOT_DEFINED = 0,
    PIO__SUCCESS = 1,
    PIO__IO_TIMEOUT,
	PIO__NON_TRANSLATED_ERROR,
	PIO__WRITE_SUCCESS,
	PIO__READ_SUCCESS,
	PIO__WARNING, 
	PIO__FUNCTION_NOT_SUPPORTED,
	PIO__TIMEOUT,
	PIO__ILLEGAL_BAUD_RATE,
	PIO__ILLEGAL_PARITY_SETTING,
	PIO__ILLEGAL_WORD_LENGTH,
	PIO__ILLEGAL_STOP_BITS,
	PIO__ILLEGAL_LINE_NUMBER,
	PIO__NO_TERMINATOR,
	PIO__READ_TMO,
	PIO__WRITE_TMO,
	PIO__READ_IO_FAIL,
	PIO__WRITE_IO_FAIL,
    PIO__BYTECNT_MISMATCH,
	PIO__PORT_NOT_FOUND,
	PIO__PORT_IN_USE,
	PIO__BAD_CHECKSUM,
	PIO__BAD_MSG_LENGTH,
	PIO__ILLEGAL_START_SEQ,
	PIO__ILLEGAL_END_SEQ,
    PIO__UNEXPECTED_HEADER,
    PIO__TOO_MANY_NAKS,
    PIO__TOO_MANY_ENQS,
    PIO__ACK_NOT_FOUND,
    PIO__IO_MT_BUFFER,
    PIO__DEVICE_ACTIVE,
    PIO__BUFFER_FULL,
	PIO__IO_FAIL
} PIO_ERROR;

#endif

⌨️ 快捷键说明

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