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

📄 el_obj.h

📁 基于EthernetIP协议的应用程序,可以读取AB公司Controllogix系列Ethernetip协议PLC数据. 此软件代码可用于工业控制.
💻 H
字号:
/****************************************************************************
*****************************************************************************
**
** File Name
** ---------
**
** EL_OBJ.H
**
*****************************************************************************
*****************************************************************************
**
** Description
** -----------
**
** This module contains the private interfaces for the TCP/IP Interface Object.
**
*****************************************************************************
*****************************************************************************
**
** Source Change Indices
** ---------------------
**
** Porting: <none>0----<major>         Customization: <none>0----<major>
**
*****************************************************************************
*****************************************************************************
**
** Services List
** -------------
**
** el_GetLeInterfaceCountersAttribute() - Get Interface Counters Attribute
** el_GetLeMediaCountersAttribute()  - Get Media Counters Attribute
** el_ProcessAppOpen()               - Process an app open message
** el_ProcessClassRequest()          - Process a request to the object class
** el_ProcessGetAttrAllClass()       - Get Class Attr All request
** el_ProcessGetAttrAllInstance()    - Process a Get Attrributes All request
** el_ProcessGetAttrSingleClass()    - Get Class Attr Single req
** el_ProcessGetAttrSingleInstance() - Process a Get Attributes Single req
** el_ProcessInstanceRequest()       - Process a request to object instance 1
**
*****************************************************************************
*****************************************************************************
**                                                                         **
** ETHERNET/IP EXAMPLE CODE                                                **
** COPYRIGHT (c) 2000-2005 ODVA (Open DeviceNet Vendor Association)		   **
**						   & ControlNet International Ltd.                 **
**                                                                         **
** All rights reserved, except as specifically licensed in writing.        **
** Use of the Ethernet/IP Example Protocol Software is subject to          **
** ODVA's and ControlNet International's Terms of Use Agreement.           **
** The following work constitutes example program code and is intended     **
** merely to illustrate useful programming techniques.  The user is        **
** responsible for applying the code correctly.  The code is provided      **
** AS IS without warranty and is in no way guaranteed to be error-free.    **
**                                                                         **
*****************************************************************************
*****************************************************************************
*/

/****************************************************************************
*****************************************************************************
**
** Change Log
** ----------
**
**  
**
*****************************************************************************
*****************************************************************************
*/

#ifndef EL_OBJ_H
#define EL_OBJ_H


/*
** See if this code is to be included.
*/

#ifdef ETHERNET_LINK_OBJECT


/****************************************************************************
**
** Typedefs
**
*****************************************************************************
*/

/*---------------------------------------------------------------------------
**
** Private object data.
**
**---------------------------------------------------------------------------
*/


/*---------------------------------------------------------------------------
**
** el_DataType
**
** Ethernet Link object instance attribute data
**
**---------------------------------------------------------------------------
*/

typedef struct el_DataType
{
   UINT32   lInterfaceSpeed;
   UINT32   lInterfaceFlags;
   UINT8    achEnetAddr[EL_MAC_ADDR_LENGTH];

}
el_DataType;


/*---------------------------------------------------------------------------
**
** el_upsTrrblType
**
** Union of pointers to all tribble types used by the Enet-Tcp/Ip Link object.
** Helps to eliminate those unsightly type casts.
**
**---------------------------------------------------------------------------
*/

typedef union el_upsTrrblType
{
   GS_TrrblType             *Generic;
   CD_PacketTrrblType       *Packet;
   CM_AppOpenCloseTrrblType *AppOpenClose;
   MR_RegistrationTrrblType *Register;
}
el_upsTrrblType;



/****************************************************************************
**
** Private data
**
*****************************************************************************
*/

/*---------------------------------------------------------------------------
**
** el_s
**
** Private object data.
**
**---------------------------------------------------------------------------
*/

extern el_DataType el_s;



/****************************************************************************
**
** Services
**
*****************************************************************************
*/

/*---------------------------------------------------------------------------
**
** el_ProcessAppOpen()
**
** Connection belng established.
** Process an app open message from the connection manager.
** Return our yes/no decision on accepting the offer.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    psTrrbl              - Pointer to tribble/combuf with details
**
** Outputs:
**    None
**
** Usage:
**    el_ProcessAppOpen( psTrrbl );
**
**---------------------------------------------------------------------------
*/

EXTFUNC void el_ProcessAppOpen( CM_AppOpenCloseTrrblType *psTrrbl );



/*---------------------------------------------------------------------------
**
** el_ProcessClassRequest()
**
** Process a request packet to object class.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    pTrrbl            - Pointer to request trrbl/combuf
**
** Outputs:
**    None
**
** Usage:
**    el_ProcessClassRequest( pTrrbl );
**
**---------------------------------------------------------------------------
*/

EXTFUNC void el_ProcessClassRequest( CD_PacketTrrblType  *pTrrbl );



/*---------------------------------------------------------------------------
**
** el_ProcessGetAttrAllClass()
**
** Process a packet for Get_Attrributes_All to class of the object.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    pTrrbl            - Pointer to request trrbl/combuf
**
** Outputs:
**    Return            - UINT16 iStatus
**
** Usage:
**    iStatus = el_ProcessGetAttrAllClass( pTrrbl );
**
**---------------------------------------------------------------------------
*/

EXTFUNC UINT16 el_ProcessGetAttrAllClass( CD_PacketTrrblType  *pTrrbl );


/*---------------------------------------------------------------------------
**
** el_ProcessGetAttrAllInstance()
**
** Process a packet for Get_Attrributes_All to instance 1 of the object.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    pTrrbl            - Pointer to request trrbl/combuf
**
** Outputs:
**    Return            - UINT16 iStatus
**
** Usage:
**    iStatus = el_ProcessGetAttrAllInstance( pTrrbl );
**
**---------------------------------------------------------------------------
*/

EXTFUNC UINT16 el_ProcessGetAttrAllInstance( CD_PacketTrrblType  *pTrrbl );


/*---------------------------------------------------------------------------
**
** el_ProcessGetAttrSingleClass()
**
** Process a packet for Get_Attrributes_Single to class of the object.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    pTrrbl            - Pointer to request trrbl/combuf
**
** Outputs:
**    Return            - UINT16 iStatus
**
** Usage:
**    iStatus = el_ProcessGetAttrSingleClass( pTrrbl );
**
**---------------------------------------------------------------------------
*/

EXTFUNC UINT16 el_ProcessGetAttrSingleClass( CD_PacketTrrblType  *pTrrbl );


/*---------------------------------------------------------------------------
**
** el_ProcessGetAttrSingleInstance()
**
** Process a packet for Get_Attrributes_Single to instance 1 of the object.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    pTrrbl            - Pointer to request trrbl/combuf
**    bService          - Service code
**
** Outputs:
**    Return            - UINT16 iStatus
**
** Usage:
**    iStatus = el_ProcessGetAttrSingleInstance( pTrrbl, bService );
**
**---------------------------------------------------------------------------
*/

EXTFUNC UINT16 el_ProcessGetAttrSingleInstance( CD_PacketTrrblType  *pTrrbl,
                                                UINT8 bService );


/*---------------------------------------------------------------------------
**
** el_ProcessInstanceRequest()
**
** Process a request packet to instance 1 of the object.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    pTrrbl            - Pointer to request trrbl/combuf
**
** Outputs:
**    None
**
**
** Usage:
**    if( el_ProcessInstanceRequest( pTrrbl ) )...
**
**---------------------------------------------------------------------------
*/

EXTFUNC void el_ProcessInstanceRequest( CD_PacketTrrblType  *pTrrbl );


#endif  /* #ifdef ETHERNET_LINK_OBJECT */
#endif  /* inclusion lock */

/****************************************************************************
**
** End of EL_OBJ.H
**
*****************************************************************************
*/

⌨️ 快捷键说明

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