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

📄 bf.h

📁 基于EthernetIP协议的应用程序,可以读取AB公司Controllogix系列Ethernetip协议PLC数据. 此软件代码可用于工业控制.
💻 H
📖 第 1 页 / 共 2 页
字号:
**
** Tribble used to activate a mapping entry. This adds it to the active
** transport list and associates it with a transport, allowing the mapping
** to take part in resync operations.
**
**---------------------------------------------------------------------------
**
** Tribble request code(s):
**    TREQ_ACTIVATE_MAPPING
**
**---------------------------------------------------------------------------
*/

typedef struct BF_ActivateTrrblType
{
   GS_TRRBL_HEADER;                 /* the standard tribble header         */

   UINT16          iClass;          /* Used to identify mapping entry      */
   UINT16          iInstance;
   BOOL            fCon;            /* Consumer (Write to app data)        */

   FD_pFuncPIIType pAddStatus;      /* Callback function to add status     */
                                    /*  in tx transport buffer             */
   UINT16          iTransportId;    /* Associated transport                */
   void           *pTranBuf;        /* Start of transport buffer           */
   UINT16          iTranBufOffset;  /* Offset of data in transport buffer  */
   UINT16          iResyncSize;     /* Portion of entry to copy @ resync   */
   UINT16          iRate;           /* Update rate in milliseconds         */
   UINT16          iPort;           /* Port number for transport           */
}
BF_ActivateTrrblType;



/*---------------------------------------------------------------------------
**
** BF_AddTrrblType
**
** Tribble used to add a mapping entry.  Entry added to the mapping entry
** list but is not activated.  It will not take part in resync operations
** until it is activated, but may take part in messaging access requests.
**
**---------------------------------------------------------------------------
**
** Tribble request code(s):
**    TREQ_ADD_MAPPING
**
**---------------------------------------------------------------------------
*/

typedef struct BF_AddTrrblType
{
   GS_TRRBL_HEADER;                 /* the standard tribble header         */

   UINT16               iClass;     /* Used to identify mapping entry      */
   UINT16               iInstance;
   BOOL                 fCon;       /* Consumer (Write to app data)        */

   AD_AppDataAreaIdType eAppDataAreaId; /* Which app data area to map to   */
   UINT16               iAppDataOffset; /* Offset of data in app data area */
   UINT16               iMaxSize;       /* Max size of entry (in bytes)    */

   UINT16  iStatusBit;              /* Connection good/bad/run/idle bit #  */
   UINT16  iStatusStyle;            /* Consumed run/idle status style      */
}
BF_AddTrrblType;



/*---------------------------------------------------------------------------
**
** BF_DeTrrblType
**
** Tribble used to deactivate or delete mapping entries.
** Deactivating reverses the activation process and deleting reverses
** the adding process.  Deleting and active entry will first deactivate it.
**
**---------------------------------------------------------------------------
**
** Tribble request code(s):
**    TREQ_DEACTIVATE_MAPPING
**    TREQ_DELETE_MAPPING
**
**---------------------------------------------------------------------------
*/

typedef struct BF_DeTrrblType
{
   GS_TRRBL_HEADER;                 /* the standard tribble header         */

   UINT16          iClass;          /* Used to identify mapping entry      */
   UINT16          iInstance;
   BOOL            fCon;            /* Consumer (Write to app data)        */

   void           *xUserHandle;     /* Handle for this access request      */
}
BF_DeTrrblType;



/*---------------------------------------------------------------------------
**
** BF_InquireTrrblType
**
** Tribble used to inquire about or reserve 1 or 2 mapping entries.
** Used to help determine if a connection should be accepted or rejected.
** Pass class of 0 to skip either the producer or consumer inquiry.
**
**---------------------------------------------------------------------------
**
** Tribble request code(s):
**    TREQ_INQUIRE_MAPPINGS
**    TREQ_RESERVE_MAPPINGS
**
**---------------------------------------------------------------------------
*/

typedef struct BF_InquireTrrblType
{
   GS_TRRBL_HEADER;                 /* the standard tribble header         */

   void           *xUserHandle;     /* Handle for task issuing request     */

   BF_InquireType  sPro;            /* Producer mapping information        */
   BF_InquireType  sCon;            /* Consumer mapping information        */
}
BF_InquireTrrblType;



/*---------------------------------------------------------------------------
**
** BF_RegisterTrrblType
**
** Tribble used to register an application data area with the
** buffer fragment mapper.
**
** Note: The base address is only needed for data areas that are
**       required to support class 1 connections.
** Note: The notification method used when data is received for an
**       app data area are determied by the notify settings.  Separate
**       notification methods may be configured for messaging requests
**       and class 1 data reception as follows:
** Note: The CPU times used for throttling are measured in nanoseconds.
**
** Queue        BitMsg    Semaphore        Notification behavior
** -----------  ------    ---------------  ----------------------------------
** GS_NO_QUEUE  DontCare  GS_NO_SEMAPHORE  No notification.
** DontCare     DontCare  Valid semaphore  Semaphore set.
** Valid queue  0         GS_NO_SEMAPHORE  Forward tribble (messaging only).
** Valid queue  1-0xFFFF  GS_NO_SEMAPHORE  Issue bit message to queue.
**
** For messaging requests, unless tribble forwarding is selected, the request
** tribble will be added to the list kept in the app data area structure
** in BF prior to notification.
**
**---------------------------------------------------------------------------
**
** Tribble request code(s):
**    TREQ_REGISTER
**
**---------------------------------------------------------------------------
*/

typedef struct BF_RegisterTrrblType
{
   GS_TRRBL_HEADER;                    /* the standard tribble header      */

   AD_AppDataAreaIdType eAppDataAreaId;/* App data area to register        */
   void*             pBaseAddress;     /* Base address of app data area    */
   UINT16            iSize;            /* Total size of app data area      */
   GS_MsgQueueType   xMNotifyQueue;    /* Messaging Rx notification method */
   UINT16            iMNotifyBitMsg;
   GS_SemaphoreType  xMNotifySemaphore;
   GS_MsgQueueType   xSNotifyQueue;    /* Scheduled Rx notification method */
   UINT16            iSNotifyBitMsg;
   GS_SemaphoreType  xSNotifySemaphore;
   UINT32 lCpuTimePerMessage;          /* Cpu time overhead per message    */
   UINT32 lCpuTimePerEntry;            /* Cpu time overhead per map entry  */
   UINT32 lCpuTimePerByte;             /* Cpu time to copy 1 byte          */
   UINT32 lCpuTimeMaxResync;           /* Max resync time allowed for area */
   UINT32 lCpuTimeMaxPerSecArea;       /* Max per second allowed for area  */
   UINT32 lCpuTimeMaxPerSecSystem;     /* Max per second allowed overall   */
}
BF_RegisterTrrblType;



/****************************************************************************
*****************************************************************************
**
** Public internal object interface - Globals
**
*****************************************************************************
****************************************************************************/

/*
** Task request queue id.
*/

extern GS_MsgQueueType BF_xQid;



/****************************************************************************
*****************************************************************************
**
** Public internal object interface - Services
**
*****************************************************************************
****************************************************************************/

/*---------------------------------------------------------------------------
**
** BF_GetAccessRequest()
**
** Get a messagging access request tribble associated with a specific
** application data area, if any exist, and if the first one in the list
** has an estimated processing time less than the specified cpu time.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    eAppDataAreaId          - Which app data area
**    lCpuTimeMax             - Max cpu time for request
**
** Outputs:
**    Return                  - Pointer to access tribble
**                              NULL if none in list for this app data area
**
** Usage:
**    pTrrbl = BF_GetAccessRequest( AD_APP_DATA_AREA_R, 1000L );
**
**---------------------------------------------------------------------------
*/

EXTFUNC BF_AccessTrrblType* BF_GetAccessRequest( AD_AppDataAreaIdType eAppDataAreaId,
                                                 UINT32 lMaxCpuTime );



/*---------------------------------------------------------------------------
**
** BF_GetActiveSubList()
**
** Get the starting address of one of the sub-lists of active mapping
** entries associated with a specific application data area.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    eAppDataAreaId          - Which app data area
**    fCon                    - Which direction
**    fFirst                  - First sub-list or subsequent
**    ppasActiveEntry         - Place to return pointer to retrieved sub-list
**    piEntries               - Place to return number of entries in sub-list
**
** Outputs:
**    Return                  - Success/failure status
**
** Usage:
**    BF_GetActiveSubList( AD_APP_DATA_AREA_R, TRUE, TRUE, &pasActiveEntry, &iEntries );
**
**---------------------------------------------------------------------------
*/

EXTFUNC StatusType BF_GetActiveSubList( AD_AppDataAreaIdType eAppDataAreaId,
                                        BOOL fCon,
                                        BOOL fFirst,
                                        volatile BF_ActiveEntryType **ppasActiveEntry,
                                        UINT16 *piEntries );



/*---------------------------------------------------------------------------
**
** BF_Init()
**
** Initialization.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    iOptions                - Bit mask of initialization options
**
** Outputs:
**    Return                  - Success/failure of operation
**
** Usage:
**    eStatus = BF_Init( AB_COLD_START_RESOURCE );
**
**---------------------------------------------------------------------------
*/

EXTFUNC StatusType BF_Init( UINT16 iOptions );



/*---------------------------------------------------------------------------
**
** BF_UpdateMapping()
**
** Update the transport buffer pointer for an existing mapping entry.
** The mapping entry is selected via the transport ID associated with the
** mapping entry when the entry was activated.
**
**---------------------------------------------------------------------------
**
** Inputs:
**    iTransportId      - Transport number
**    pBuffer           - New buffer pointer to use
**
** Outputs:
**    None
**
** Usage:
**    BF_UpdateMapping( psTransport->iId, psTransport->pBufferA );
**
**---------------------------------------------------------------------------
*/

EXTFUNC BOOL BF_UpdateMapping( UINT16 iTransportId, void *pBuffer );



#endif  /* BUFFER_FRAGMENT_MAPPER */
#endif  /* inclusion lock */

/****************************************************************************
*****************************************************************************
**
** End of BF.H
**
*****************************************************************************
****************************************************************************/

⌨️ 快捷键说明

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