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

📄 dtl.h

📁 AB_5000_PLC以太网通讯动态连接库
💻 H
📖 第 1 页 / 共 5 页
字号:

//---- Valid options for DTL_SETOPT
//	DTL_OPT_BACKLOG		Change the number of unsolicited messages that the driver will hold on behalf of the application
//				before the driver will begin to reject further packets. INTERCHANGE only.
//	DTL_OPT_PEEK_MESSAGE	Determine whether the DLL should call PeekMessage() while blocked. INTERCHANGE only.
//	DTL_OPT_ENET_UNSOL_DTSA	Select the DTSA type the the DLL should return to the application for unsolicited requests coming
//				from Ethernet targets and Ethernet gateways. RSLinx only.
//	DTL_OPT_MULTI_SYNC_IO	Determine whether the DLL should permit simultaneous synchronous operations. RSLinx only.
//	DTL_OPT_RETRY_NAK_RD	Determine whether the DLL should retry NAKed DTL_READ packets.
//	DTL_OPT_RETRY_NAK_WR	Determine whether the DLL should retry NAKed DTL_WRITE packets.
//	DTL_OPT_RETRY_NAK_RMW	Determine whether the DLL should retry NAKed DTL_RMW packets.
#define	DTL_OPT_BACKLOG		(1)
#define	DTL_OPT_PEEK_MESSAGE	(2)
#define	DTL_OPT_ENET_UNSOL_DTSA	(3)
// NOTE: Before you use DTL_SETOPT with this DTL_OPT_ENET_UNSOL_DTSA option please see the descriptions
// for the functions DTL_SET_ENET_DIRECT_DTSA_TYPE and DTL_SET_ENET_PIGW_DTSA_TYPE below.
// Those functions will do the same thing as DTL_SETOPT(DTL_OPT_ENET_UNSOL_DTSA,...) but are more convenient.
#define	DTL_OPTNAME_ENET_UNSOL_DTSA_TARGET	(1)
#define	DTL_OPTNAME_ENET_UNSOL_DTSA_GATEWAY	(2)
#define	DTL_OPT_MULTI_SYNC_IO	(4)
#define	DTL_OPT_RETRY_NAK_RD	(5)
#define	DTL_OPT_RETRY_NAK_WR	(6)
#define	DTL_OPT_RETRY_NAK_RMW	(7)

/*---- Access Machine states ----*/
#define DTL_NOCONNECT           0

/*---- DTL_UNSOL_DEF constants for DTL_REJECT and DTL_ACCEPT ----*/
#define	DTL_ACCEPT	((unsigned long (DTL_CALLBACK *)())1)
#define	DTL_REJECT	((unsigned long (DTL_CALLBACK *)())2)

/*---- structures ----*/
#pragma pack(push,1)

#define 	MODID_TYPE	struct modid_type

    MODID_TYPE 	{
		long		status;
		long		slot;
		long		pushwheel;
		char		idstr[ 20 ];
    		};

typedef struct {
	unsigned char	conn_type;	/* network connection type	*/
	unsigned char	priority;	/* network connection priority	*/
	unsigned char	pkt_type;	/* fixed/variable packets	*/
	unsigned short	pkt_size;	/* fixed/maximum packet size	*/
	unsigned long	rpi;		/* requested packet interval	*/
	unsigned long	api;		/* actual packet interval	*/
} DTL_CIP_NETWORK_CONNECTION;

typedef struct {
	unsigned long	ctype;		/* connection structure type	*/
	unsigned char	mode;		/* client/server mode		*/
	unsigned char	trigger;	/* trigger mode			*/
	unsigned char	transport;	/* transport type		*/
	unsigned char	tmo_mult;	/* timeout multiplier		*/
	DTL_CIP_NETWORK_CONNECTION OT;	/* originator-to-target net conn*/
	DTL_CIP_NETWORK_CONNECTION TO;	/* target-to-originator net conn*/
} DTL_CIP_TRANSPORT_CONNECTION;

typedef struct {
	unsigned short	vendor;		/* CIP vendor ID		*/
	unsigned short	prod_type;	/* CIP product type		*/
	unsigned short	prod_code;	/* CIP product code		*/
	unsigned char	major_rev;	/* major revision		*/
	unsigned char	minor_rev;	/* minor revision		*/
	unsigned short	status;		/* should be zero		*/
	unsigned long	serial_num;	/* CIP serial number		*/
	unsigned char	name_len;	/* # of bytes in product name	*/
	char		name[32];	/* product name/description	*/
} DTL_CIP_IDENTITY;

/* In the INTERCHANGE API the maximum size of a DTSA structure was 24 bytes and remained constant.
 * In the RSLinx API it is currently 64 bytes and will grow as required.
 * There is a potential mismatch between the largest DTSA known to your application
 * when you built and the largest DTSA supported by the running RSLinx API.
 * To help manage this potential your application can make use of the following two aids:
 * 1. Your application can use the DTL_DTSA_SIZE_MAX define below
 *    to determine the compile-time size of the largest DTSA structure.
 * 2. Your application can use the DTL_GET_DTSA_SIZE_MAX() function
 *    to determine the run-time size of the largest DTSA structure.
 */
#define DTL_DTSA_SIZE_MAX	(64)

/* This is the largest name a DTSA can have.
 * Such DTSAs include:
 *	DTSA_AB_NAME
 *	DTSA_AB_PIGATEWAY_NAME
 */
#define	DTL_DTSA_NAME_MAX	(32)

/* Applications that use DTL_C_CONNECT/DTL_DISCONNECT instead of using
 * DTL_DRIVER_OPEN/DTL_DRIVER_CLOSE should use the following DTSA types:
 *	DTSA_ARCH
 *	DTSA_BKPLN
 *	DTSA_DH
 *	DTSA_DH_R
 *	DTSA_FILE
 * NOTE: The DTSA types DTSA_ARCH and DTSA_FILE are only used by the
 * upload, download, and compare functions which are not supported by RSLinx.
 *
 * Applications that use DTL_DRIVER_OPEN/DTL_DRIVER_CLOSE instead of
 * using DTL_C_CONNECT/DTL_DISCONNECT should use the following DTSA types:
 *	DTSA_AB_DH_LOCAL
 *	DTSA_AB_DH_LONG_LOCAL
 *	DTSA_AB_DH_OFFLINK
 *	DTSA_AB_NAME
 *	DTSA_AB_PIGATEWAY
 *	DTSA_AB_PIGATEWAY_IP
 *	DTSA_AB_PIGATEWAY_NAME
 *	DTSA_AB_DF1MASTER
 */
#define DTSA_TYPE  struct dtsa_type
DTSA_TYPE {
	unsigned long	atype;		/* Address type			*/
	char		pad[DTL_DTSA_SIZE_MAX - 4];
};

#define DTSA_DH  struct dtsa_dh
DTSA_DH {
	unsigned long	atype;		/* Address type			*/
	unsigned long	ni_id;		/* Network Interface id		*/
	unsigned long	module;		/* DTL_MODULE_XX		*/
	unsigned long	pushwheel;	/* pushwheel			*/
	unsigned long	channel;	/* DTL_CHAN_xx			*/
	unsigned long	stn_addr;	/* Data Highway [Plus] sta addr	*/
	char		pad[DTL_DTSA_SIZE_MAX - 24];
};

#define DTSA_BKPLN  struct dtsa_bkpln
DTSA_BKPLN {
	unsigned long	atype;		/* Address type			*/
	unsigned long	ni_id;		/* Network Interface id		*/
	unsigned long	module;		/* DTL_MODULE_XX		*/
	unsigned long	pushwheel;	/* pushwheel			*/
	unsigned long	channel;	/* DTL_CHAN_xx			*/
	char		pad[DTL_DTSA_SIZE_MAX - 20];
};

#define DTSA_FILE  struct dtsa_file
DTSA_FILE {
	unsigned long	atype;		/* Address type			*/
	char LIBPTR *fname;		/* File Name 			*/
	unsigned long	length;		/* Length of file name		*/
	char		pad[DTL_DTSA_SIZE_MAX - 12];
};

#define DTSA_ARCH  struct dtsa_arch
DTSA_ARCH {
	unsigned long	atype;		/* Address type			*/
	char LIBPTR	*fname;		/* File Name 			*/
	unsigned long	length;		/* Length of file name		*/
	unsigned long 	file_type; 	/* File type */
	char		pad[DTL_DTSA_SIZE_MAX - 16];
};

#define DTSA_DH_R struct dtsa_dh_r
DTSA_DH_R {
	unsigned long	atype;		/* Address type		*/
	unsigned long	ni_id;		/* Network Interface id	*/
	unsigned short	module;		/* DTL_MODULE_XX	*/
	unsigned short	pushwheel;
	unsigned short	channel;	/* DTL_CHAN_XX		*/
	unsigned char	dst;
	unsigned char	flags;
	unsigned short	rsrc_link;
	unsigned short	rsrc_stn;
	unsigned short	rdst_link;
	unsigned short	rdst_stn;
	char		pad[DTL_DTSA_SIZE_MAX - 36];
};

#define	DTSA_AB_DH_LOCAL struct dtsa_ab_dh_local
DTSA_AB_DH_LOCAL
{
	unsigned long	atype;
	long		driver_id;
	unsigned char	bStation;
};

#define	DTSA_AB_DH_LONG_LOCAL	struct dtsa_ab_dh_long_local
DTSA_AB_DH_LONG_LOCAL
{
	unsigned long	atype;
	long		driver_id;
	unsigned long	dwStation;
};

#define	DTSA_AB_NAME	struct dtsa_ab_name
DTSA_AB_NAME
{
	unsigned long	atype;
	long		driver_id;
	unsigned long	dwLength;
	char		szName[DTL_DTSA_NAME_MAX];
};

#define DTSA_AB_DH_OFFLINK struct dtsa_ab_dh_offlink
DTSA_AB_DH_OFFLINK
{
	unsigned long	atype;
	long		driver_id;
	unsigned short  wControl;
	unsigned char   bLocalDST;
	unsigned char   bDLSAP;
	unsigned short	wDLink;
	unsigned short	wDStn;
	unsigned char	bSLSAP;
	unsigned short	wSLink;
	unsigned short	wSStn;
	unsigned char	bLftm;
};

#define DTSA_AB_PIGATEWAY struct dtsa_ab_pigateway
DTSA_AB_PIGATEWAY
{
	unsigned long	atype;		// NOTE: This begins a DTSA_AB_DH_OFFLINK.
	long		driver_id;
	unsigned short  wControl;
	unsigned char   bLocalDST;
	unsigned char   bDLSAP;
	unsigned short	wDLink;
	unsigned short	wDStn;
	unsigned char	bSLSAP;
	unsigned short	wSLink;
	unsigned short	wSStn;
	unsigned char	bLftm;		// NOTE: This ends a DTSA_AB_DH_OFFLINK.
	unsigned char	bEIStn;		// PI Gateway mapped station number.
	unsigned char	bModuleType;	// PI Gateway module (KA or RM).
	unsigned char	bPushwheel;	// PI Gateway pushwheel (0-4).
	unsigned char	bChannel;	// PI Gateway channel (2-3).
};

#define	DTSA_AB_PIGATEWAY_IP	struct dtsa_ab_pigateway_ip
DTSA_AB_PIGATEWAY_IP
{
	unsigned long	atype;		// NOTE: This begins a DTSA_AB_DH_OFFLINK.
	long		driver_id;
	unsigned short  wControl;
	unsigned char   bLocalDST;
	unsigned char   bDLSAP;
	unsigned short	wDLink;
	unsigned short	wDStn;
	unsigned char	bSLSAP;
	unsigned short	wSLink;
	unsigned short	wSStn;
	unsigned char	bLftm;		// NOTE: This ends a DTSA_AB_DH_OFFLINK.
	unsigned char	bModuleType;	// PI Gateway module (KA or RM).
	unsigned char	bPushwheel;	// PI Gateway pushwheel (0-4).
	unsigned char	bChannel;	// PI Gateway channel (2-3).
	unsigned long	dwIPAddress;	// PI Gateway IP address.
};

#define	DTSA_AB_PIGATEWAY_NAME	struct dtsa_ab_pigateway_name
DTSA_AB_PIGATEWAY_NAME
{
	unsigned long	atype;		// NOTE: This begins a DTSA_AB_DH_OFFLINK.
	long		driver_id;
	unsigned short  wControl;
	unsigned char   bLocalDST;
	unsigned char   bDLSAP;
	unsigned short	wDLink;
	unsigned short	wDStn;
	unsigned char	bSLSAP;
	unsigned short	wSLink;
	unsigned short	wSStn;
	unsigned char	bLftm;		// NOTE: This ends a DTSA_AB_DH_OFFLINK.
	unsigned char	bModuleType;	// PI Gateway module (KA or RM).

⌨️ 快捷键说明

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