📄 gencom.h
字号:
/*-----------------------------------------------------------------------------
* GENCOM.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 __GENCOM_H__ // Only Include Once
#define __GENCOM_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 MAX_RTU_INPPNT 1000
#define MAX_RTU_COMPARE 48
#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 PULS_FREZ 8 // send pulse frozen command
#define RELY_COMD 9 // send relay command
#define CMDOFFSET 10 // customer command offset
#define PORTINIRTY 20 // port initialize retry times
#define PORTINIWAIT 3000 // port initialize waiting time
#define FOVINIWAIT 5000 // fov initialize waiting time
class CPio;
typedef VOID (__cdecl *LPUNPACKFUNC) (CPio *pPio, int rtuStream);
typedef VOID (__cdecl *LPERRORFUNC) (CPio *pPio);
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
int count;
int tRtu[2];
BYTE vrfData[8];
} 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 + -