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

📄 dtl.h

📁 AB_5000_PLC以太网通讯动态连接库
💻 H
📖 第 1 页 / 共 5 页
字号:
#define PCCCSTSA4       PCCCSTSBASE+0xA4        /* COM port hardware problem */
#define PCCCSTSA5       PCCCSTSBASE+0xA5        /* Packet is too large */
#define PCCCSTSA7       PCCCSTSBASE+0xA7        /* Illegal station address seen */
#define PCCCSTSA8       PCCCSTSBASE+0xA8        /* Not getting solicited */
#define PCCCSTSA9       PCCCSTSBASE+0xA9        /* Service/LSAP not supported */

#define	PCCCSTSB0	PCCCSTSBASE+0xB0	/* Remote station problem, due to download. */
#define	PCCCSTSC0	PCCCSTSBASE+0xC0	/* Cannot execute command, due to IBP's. */

#define PCCCEXTBASE	0x200	/* pccc Extended sts base  */
#define	PCCCEXT01	PCCCEXTBASE+1	/* Illegal Address Format; a field has an illegal value. */
#define	PCCCEXT02	PCCCEXTBASE+2	/* Illegal Address Format; not enough fields specified. */
#define	PCCCEXT03	PCCCEXTBASE+3	/* Illegal Address Format; too many fields specified. */
#define	PCCCEXT04	PCCCEXTBASE+4	/* Illegal Address; symbol not found. */
#define	PCCCEXT05	PCCCEXTBASE+5	/* Illegal Address Format; symbol is 0 or greater than 8 characters. */
#define	PCCCEXT06	PCCCEXTBASE+6	/* Illegal Address; address does not exist. */
#define	PCCCEXT07	PCCCEXTBASE+7	/* Illegal size. */
#define	PCCCEXT08	PCCCEXTBASE+8	/* Cannot complete request, situation changed during multipacket operation. */
#define	PCCCEXT09	PCCCEXTBASE+9	/* Data is too large. */
#define	PCCCEXT0A	PCCCEXTBASE+0x0a	/* Size too big */
#define	PCCCEXT0B	PCCCEXTBASE+0x0b	/* No access, privilege violation. */
#define	PCCCEXT0C	PCCCEXTBASE+0x0c	/* Resource is not available */
#define	PCCCEXT0D	PCCCEXTBASE+0x0d	/* Resource is already available. */
#define	PCCCEXT0E	PCCCEXTBASE+0x0e	/* Command cannot be executed. */
#define	PCCCEXT0F	PCCCEXTBASE+0x0f	/* Overflow; histogram overflow. */
#define	PCCCEXT10	PCCCEXTBASE+0x10	/* No access. */
#define	PCCCEXT11	PCCCEXTBASE+0x11	/* Incorrect Type data */
#define	PCCCEXT12	PCCCEXTBASE+0x12	/* Bad Parameter */
#define	PCCCEXT13	PCCCEXTBASE+0x13	/* Address reference exists to deleted area */
#define	PCCCEXT14	PCCCEXTBASE+0x14	/* Command Execution failure for unknown reason */
#define	PCCCEXT15	PCCCEXTBASE+0x15	/* Data conversion error */
#define	PCCCEXT16	PCCCEXTBASE+0x16	/* 1771 rack adapter not responding */
#define	PCCCEXT17	PCCCEXTBASE+0x17	/* Timed out, 1771 backplane module not responding */
#define	PCCCEXT18	PCCCEXTBASE+0x18	/* 1771 module response was not valid: size, checksum,etc */
#define	PCCCEXT19	PCCCEXTBASE+0x19	/* Duplicated label */
#define	PCCCEXT1A	PCCCEXTBASE+0x1a	/* File is open - another station owns it */
#define	PCCCEXT1B	PCCCEXTBASE+0x1b	/* Another station is the program owner */

#define DTL_CIP_ERROR_BASE	0x00400			/* CIP error base offset with which CIP General Status is OR'ed */
#define DTL_CIP_ERROR_FLAG_TRUNCATED_STATUS  0x100	/* OR'ed with DTL_CIP_ERROR_BASE to indicate truncated extended status */
#define DTL_CIP_ERROR_FLAG_TRUNCATED_DATA    0x200	/* OR'ed with DTL_CIP_ERROR_BASE to indicate truncated data */

#define	DTL_NOS_ERROR_BASE	0x10000	/* Allen-Bradley NOS error base.*/
#define	DTL_UNIX_ERROR_BASE	0x20000	/* UNIX(TM) error base.		*/
#define	DTL_VMS_ERROR_BASE	0x30000	/* VMS(R) error base.		*/
#define DTL_WIN16_ERROR_BASE	0x40000	/* Win16 error base.		*/
#define DTL_WIN32_ERROR_BASE	0x50000	/* Win32 error base.		*/


/* Wait timeout defs	*/
#define 	DTL_FOREVER    0x7fffffff	/* Don't timeout	*/


/* Maximum wait identifier number  */
#define		DTL_MAX_WAIT_ID		40


/*---- solicited and unsolicited host data type codes ----*/
#define 	DTL_TYP_WORD		0	/* signed word 		*/
#define 	DTL_TYP_UWORD		1	/* unsigned word	*/
#define 	DTL_TYP_LONG		2	/* signed long 		*/
#define 	DTL_TYP_FLOAT		3	/* single precision float */
#define 	DTL_TYP_RAW		4	/* no conversion	*/
#define 	DTL_TYP_BCD		5	/* BCD 			*/
#define 	DTL_TYP_BIT		6	/* bit field operation	*/
#define 	DTL_TYP_STRUCT		7	/* structure		*/
#define 	DTL_TYP_FLT_IEEE	8	/* IEEE float		*/
#define 	DTL_TYP_FLT_DEC		9	/* DEC float		*/
#define 	DTL_TYP_IO		10	/* block I/O type	*/
#define 	DTL_TYP_PLC3_LONG	11	/* PLC-3 long		*/
#define 	DTL_TYP_SYMBOL		12	/* symbol translation	*/
#define		DTL_TYP_BYT		13	/* plc-5/250 byte	*/
#define		DTL_TYP_FLT_SLC500	14	/* slc500 IEEE float    */
#define		DTL_TYP_RESERVED1	14	/* reserved for copro.	*/
#define		DTL_TYP_RESERVED2	15	/* reserved for copro.	*/
#define		DTL_TYP_RESERVED3	16	/* reserved for copro.	*/
#define		DTL_TYP_DIAG_STATUS	100	/* diag host status	*/
#define		DTL_TYP_DIAG_COUNTERS	101	/* diag counters read	*/
#define		DTL_TYP_DIAG_RESET	102	/* diag counters reset	*/
#define		DTL_TYP_DIAG_ECHO	103	/* diag echo		*/
#define		DTL_TYP_BYTE		200	/* byte			*/
#define 	DTL_TYP_TIMER   	201	/* timer		*/
#define 	DTL_TYP_COUNTER 	202	/* counter		*/
#define 	DTL_TYP_CONTROL     	203	/* control		*/
#define 	DTL_TYP_PID     	204	/* pid			*/
#define 	DTL_TYP_MSG     	205	/* message		*/
#define		DTL_TYP_STRING		206	/* string		*/
#define		DTL_TYP_PLC3_IO		207	/* plc-3 i/o section	*/
#define		DTL_TYP_PLC3_POINTER	208	/* plc-3 ptr section	*/
#define		DTL_TYP_PLC3_STATUS	209	/* plc-3 status section	*/
#define		DTL_TYP_STATUS		210	/* generic status section*/
#define		DTL_TYP_TOKENDATA	211	/* global status section*/
#define		DTL_TYP_SFCSTATUS	212	/* sfc status data section*/
#define		DTL_TYP_BLOCKTRANS	213	/* block transfer data section*/
#define		DTL_TYP_CN			214 /* control net 'ct'. */
#define		DTL_TYP_DEVCONF		254	/* internal		*/

/*---- data type sizes ----*/
#define 	DTL_TYP_WORD_SIZ	2	/* signed word 		*/
#define 	DTL_TYP_UWORD_SIZ	2	/* unsigned word	*/
#define 	DTL_TYP_LONG_SIZ	4	/* signed long 		*/
#define 	DTL_TYP_FLOAT_SIZ	4	/* single precision float */
#define 	DTL_TYP_RAW_SIZ		2	/* raw size, to start	*/
#define		DTL_TYP_BYT_SIZ		1	/* signed char		*/

/*---- unsolicited plc data type codes ----*/
#define 	DTL_PLC_WORD		DTL_TYP_WORD
#define 	DTL_PLC_UWORD		DTL_TYP_UWORD
#define 	DTL_PLC_LONG		DTL_TYP_LONG
#define 	DTL_PLC_IEEE_FLOAT	DTL_TYP_FLT_IEEE
#define 	DTL_PLC_PLC3_LONG	DTL_TYP_PLC3_LONG
#define 	DTL_PLC_PLC3_FLOAT	DTL_TYP_FLT_DEC
#define 	DTL_PLC_DECIMAL		DTL_TYP_BCD
#define 	DTL_PLC_RAW		DTL_TYP_RAW
#define 	DTL_PLC_SLC500_FLOAT	DTL_TYP_FLT_SLC500

/*---- plc data type sizes ----*/
#define 	DTL_PLC_WORD_SIZ	DTL_TYP_WORD_SIZ
#define 	DTL_PLC_UWORD_SIZ	DTL_TYP_UWORD_SIZ
#define 	DTL_PLC_LONG_SIZ	DTL_TYP_LONG_SIZ
#define 	DTL_PLC_IEEE_FLOAT_SIZ	4
#define 	DTL_PLC_PLC3_LONG_SIZ	4
#define 	DTL_PLC_PLC3_FLOAT_SIZ	4
#define 	DTL_PLC_DECIMAL_SIZ	2
#define 	DTL_PLC_RAW_SIZ		2
#define		DTL_PLC_SLC500_FLOAT_SIZ 4

/*---- plc command protocols ----*/
#define		DTL_PROTO_NONE		0
#define		DTL_PROTO_PCCC		1
#define		DTL_PROTO_CIP		2

/*---- module id bit masks ----*/
#define 	MODID_MOD_TYPE	   0x000000FF	/* module type		*/
#define 	MODID_MEM_SIZE	   0x0000FF00	/* module memory size	*/
#define 	MODID_FLAGS	   0x00FF0000	/* module flags		*/
#define 	MODID_STATUS	   0xFF000000	/* module status	*/
#define 	MODID_MEM_SIZE_OS  8	        /* size bit offset	*/
#define 	MODID_ID_LONG	   0x00800000   /* ID Prom arrangement  */
#define 	MODID_POWERUP	   0x00200000	/* PWR UP Participation */
#define 	MODID_SMART	   0x00100000	/* Intelligent module	*/
#define 	MODID_32BACK	   0x00080000	/* 32bit backplane	*/
#define 	MODID_SYSCLASS	   0x00040000	/* system class		*/
#define 	MODID_COMCLASS	   0x00020000	/* communication class	*/
#define 	MODID_PROCLASS	   0x00010000	/* Processor class	*/

#define 	MODID_EXCLUDED	   0x01000000	/* excluded @power-up	*/
#define 	MODID_PWRUPERR	   0x02000000	/* power-up problem	*/
#define 	MODID_MEMBAD	   0x04000000	/* module memory invalid*/
#define 	MODID_REQUIRED	   0x08000000	/* Critical module	*/

/* PLC image types */
#define	DTL_ACH_X5	1	/* X5 archive file */
#define	DTL_ACH_AF5	2	/* AF5 archive file */
#define	DTL_ACH_PLC	3	/* PLC */
#define	DTL_ACH_APS	4	/* APS archive file */

/* PLC image access modes */
#define	DTL_PI_READ	1	/* read only */
#define	DTL_PI_WRITE	2	/* write only */

/*---- address types (suitable for DTSA_TYPE) -------------*/
#define	DTSA_TYP_DH	2	/* data highway / data highway plus */
#define	DTSA_TYP_BKPLN	3	/* local backplane access */
#define	DTSA_TYP_FILE	4	/* archive file (default type) access */
#define	DTSA_TYP_DH_R	5	/* remote DH/DH+ */
#define	DTSA_TYP_ARCH	6	/* archive file (specific type) access */
#define	DTSA_TYP_AB_DH_LOCAL		100	/* AB DH local			*/
#define	DTSA_TYP_AB_DH_OFFLINK_OBSOLETE	101	/* AB DH offlink Obsolete	*/
#define	DTSA_TYP_AB_PIGATEWAY_OBSOLETE	102	/* AB PI Gateway Obsolete	*/
#define	DTSA_TYP_AB_DF1MASTER		103	/* AB DF1 Master		*/
#define	DTSA_TYP_AB_DH_OFFLINK		104	/* AB DH offlink		*/
#define	DTSA_TYP_AB_PIGATEWAY		105	/* AB PI Gateway		*/
#define	DTSA_TYP_AB_DH_LONG_LOCAL	106	/* AB DH local 4-byte addr	*/
#define	DTSA_TYP_AB_NAME			107	/* AB ASCII			*/
#define	DTSA_TYP_AB_PIGATEWAY_IP	108	/* AB PI Gateway IP addr	*/
#define	DTSA_TYP_AB_PIGATEWAY_NAME	109	/* AB PI Gateway hostname	*/
#define	DTSA_TYP_AB_CIP_PATH		110	/* AB Path			*/
#define	DTSA_TYP_AB_CIP_CONN		111	/* AB Connection		*/
#define	DTSA_TYP_AB_DH_CIP_PATH		112	/* AB Path to DH+ Interface	*/

/*---- communications channels (suitable for DTSA_TYPE) ----*/
#define	DTL_CHANNEL_MASK	0x0f

#define DTL_CHAN_2_PRI  0x02
#define DTL_CHAN_2_ALT  0x12
#define DTL_CHAN_2      DTL_CHAN_2_PRI

#define DTL_CHAN_3_PRI  0x03
#define DTL_CHAN_3_ALT  0x13
#define DTL_CHAN_3      DTL_CHAN_3_PRI

/*---- Supported communications modules (suitable for DTSA_TYPE) ----*/
#define	DTL_MODULE_RM		0x09
#define	DTL_MODULE_KA		0x40
#define	DTL_MODULE_UAMS		0x60
#define	DTL_MODULE_UAME		0x61
#define	DTL_MODULE_KT		0xF8

#define	DTL_ROUTE_AB_NAME			DTSA_TYP_AB_NAME
#define	DTL_ROUTE_AB_DH_LOCAL		DTSA_TYP_AB_DH_LOCAL
#define	DTL_ROUTE_AB_DH_LONG_LOCAL	DTSA_TYP_AB_DH_LONG_LOCAL
#define	DTL_ROUTE_AB_DH_OFFLINK		DTSA_TYP_AB_DH_OFFLINK
#define	DTL_ROUTE_AB_PIGATEWAY		DTSA_TYP_AB_PIGATEWAY
#define	DTL_ROUTE_AB_PIGATEWAY_IP	DTSA_TYP_AB_PIGATEWAY_IP
#define	DTL_ROUTE_AB_PIGATEWAY_NAME	DTSA_TYP_AB_PIGATEWAY_NAME
#define	DTL_ROUTE_AB_DF1MASTER		DTSA_TYP_AB_DF1MASTER
#define	DTL_ROUTE_AB_CIP_PATH		DTSA_TYP_AB_CIP_PATH
#define	DTL_ROUTE_AB_CIP_CONN		DTSA_TYP_AB_CIP_CONN
#define	DTL_ROUTE_AB_DH_CIP_PATH	DTSA_TYP_AB_DH_CIP_PATH

/*---- Supported manufacturer types (suitable for DTSA_TYPE) ----*/
#define DTL_MANUFACTURER_AB	0xAB

/*---- Defined connection status events ----*/
#define	DTL_CONN_ESTABLISHED	1	/* connection successfully opened */
#define	DTL_CONN_ERROR		2	/* error establishing connection */
#define	DTL_CONN_FAILED		3	/* connection failed */
#define	DTL_CONN_TIMEOUT	4	/* connection timed out */
#define	DTL_CONN_CLOSED		5	/* connection successfully closed */
#define	DTL_CONN_PKT_DUP	6	/* duplicate packet received */
#define	DTL_CONN_PKT_LOST	7	/* packet lost */
#define	DTL_CONN_ACK		8	/* ACK received */
#define	DTL_CONN_NAK_GENERAL	9	/* NAK - unspecified type received */
#define	DTL_CONN_NAK_BAD_CMD	10	/* NAK - "Bad Command" received */
#define	DTL_CONN_NAK_SEQ_ERR	11	/* NAK - "Sequence Error" received */
#define	DTL_CONN_NAK_NO_MEM	12	/* NAK - "Not Enough Memory" received */

/*---- Supported connection types ----*/
#define	DTL_CONN_CIP		0x100	/* basic CIP connection */

/*---- CIP connection parameters ----*/
#define	DTL_CIP_CONN_MODE_IS_SERVER          0x00	/* RSLinx node is connection server */
#define	DTL_CIP_CONN_MODE_IS_CLIENT          0x01	/* RSLinx node is connection client */

#define	DTL_CIP_CONN_MODE_FILTER_DUPLICATES  0x00	/* Filter out duplicate packets */
#define	DTL_CIP_CONN_MODE_FILTER_NONE	     0x02	/* Don't filter out duplicate packets */
#define	DTL_CIP_CONN_MODE_FILTER_SAME	     0x04	/* Filter out unchanged packets */

#define	DTL_CIP_CONN_MODE_NOTIFY_NAKS        0x08	/* notify app about NAKs received */
#define	DTL_CIP_CONN_MODE_NOTIFY_ACKS        0x10	/* notify app about ACKs received */
#define	DTL_CIP_CONN_MODE_NOTIFY_DUPLICATES  0x20	/* notify app about duplicates received */
#define	DTL_CIP_CONN_MODE_NOTIFY_LOST        0x40	/* notify app about lost packets */

#define	DTL_CIP_CONN_TRIGGER_CYCLIC             0	/* cyclic trigger */
#define	DTL_CIP_CONN_TRIGGER_CHANGE_OF_STATE	1	/* change-of-state trigger */
#define	DTL_CIP_CONN_TRIGGER_APPLICATION        2	/* application trigger */

#define	DTL_CIP_CONN_TYPE_MULTICAST             1	/* multicast connection */
#define	DTL_CIP_CONN_TYPE_POINT_TO_POINT        2	/* point-to-point connection */

#define	DTL_CIP_CONN_PACKET_SIZE_FIXED          0	/* fixed-size packets */
#define	DTL_CIP_CONN_PACKET_SIZE_VARIABLE	1	/* variable-size packets */

/*---- Additional CIP values ----*/
#define DTL_CIP_MAX_MESSAGE_SIZE              502	/* maximum CIP message size */
#define	DTL_CIP_MAX_PACKET_SIZE               504	/* maximum CIP connected packet size */

#define	DTL_CIP_PRIORITY_LOW                    0	/* low-priority message or connection */
#define	DTL_CIP_PRIORITY_HIGH                   1	/* high-priority message or connection */
#define	DTL_CIP_PRIORITY_SCHEDULED              2	/* scheduled-priority connection */

/*---- CIP symbol segment formats ----*/
#define DTL_CIP_SYMBOL_ASCII                 0x00	/* ASCII symbol */
#define DTL_CIP_SYMBOL_2BYTE                 0x20	/* Double-byte symbol */
#define DTL_CIP_SYMBOL_3BYTE                 0x40	/* Triple-byte symbol */
#define DTL_CIP_SYMBOL_UNICODE               0x80	/* Unicode symbol */

/*---- CIP RSI-specific class codes ----*/
#define DTL_CIP_CLASS_RSI_SOFTWARE_REGISTRATION   0x77	/* RSI Software Registration Object */

⌨️ 快捷键说明

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