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

📄 ab_trbl.h

📁 基于EthernetIP协议的应用程序,可以读取AB公司Controllogix系列Ethernetip协议PLC数据. 此软件代码可用于工业控制.
💻 H
📖 第 1 页 / 共 2 页
字号:
/****************************************************************************
*****************************************************************************
**
** File name
** ---------
**
** AB_TRBL.H
**
*****************************************************************************
*****************************************************************************
**
** Description
** -----------
**
** This interface file contains an enumeration that defines the all of the
** standard tribble request codes used in the example code.
** The user defined tribble request codes are contained in the file
** ABU_TRBL.H (which is included by this file...)
**
*****************************************************************************
*****************************************************************************
**
** Source Change Indices
** ---------------------
**
** Porting: <none>0----<major>         Customization: <none>0----<major>
**
*****************************************************************************
*****************************************************************************
**                                                                         **
** 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 AB_TRBL_H
#define AB_TRBL_H



/****************************************************************************
**
** Tribble Request Codes Enumeration.
**
*****************************************************************************
*/

typedef enum TrrblRequestType
{
/*---------------------------------------------------------------------------
** General use codes
**---------------------------------------------------------------------------
*/

   /*
   ** No-op
   **
   ** Indicates "do nothing".  Useful in certain contexts.
   **
   ** Tribble Type:
   **
   **    GS_TrrblType
   */

   TREQ_NOP = 0,


   /*
   ** Bit Message.
   **
   ** Used in message queues to bypass all linked messages and cause the
   ** bit message tribble resident in the dummy head node to be returned
   ** instead.  All bit messages return a fixed format tribble that
   ** contains a single 16-bit word as the only data parameter.  This word
   ** can be used to transfer any combination of bits that can be encoded
   ** in the word.  As always, multiple tasks may "Put" bit messages into
   ** a queue, but only the task which "owns" the queue may "Take" bit
   ** messages from a queue.
   **
   ** Tribble Type:
   **
   **    GS_BitMsgTrrblType
   */

   TREQ_BIT_MSG,


   /*
   ** General use timer expiration.
   **
   ** This tribble request code indicates that a timer has expired.
   ** It is normally used for indicating a locally scoped timeout of
   ** one kind or another.  There are no data parameters associated
   ** with this tribble, so it is of default type.
   **
   ** Tribble Type:
   **
   **    GS_TrrblType
   */

   TREQ_TIMER_EXPIRED,


   /*
   ** General use object reset request.
   **
   ** Used to request a reset of an object.
   ** Currently the ControlNet Object and the Identity Object use this.
   **
   ** Tribble Type:
   **
   **    GS_TrrblType
   */

   TREQ_RESET,


/*---------------------------------------------------------------------------
** Communications Device specific codes
**
** These tribbles are accepted by the CD configuration task queue:
** CD_s.xConfigQid
**---------------------------------------------------------------------------
*/

   /*
   ** Communications device (ASIC) initialization.
   **
   ** These trbbl request codes indicate that the Communications
   ** Device needs to be started, given its initial configuration,
   ** (which is established via compile time defines), and brought online.
   ** For the case of a dynamic MacId change (after the device has already
   ** been on-line), the new MacId must be loaded via a tribble toss to the
   ** CD_ConfigTask() while the device is not attached to the network.
   **
   ** A full reset of a running CD consists of the following sequence:
   **
   **    1a) Issue a TREQ_UCMM_HALT to the UCMM.
   **    1b) Wait for completion.
   **
   **    2a) Issue a TREQ_CLOSE_ALL_CONNECTIONS request tribble
   **        to the connection manager object (CM)
   **    2b) Wait for completion.
   **
   **    3a) Issue a TREQ_RESET_AND_GO_ONLINE request tribble
   **        to the communications device object (CD)
   **    3b) Wait for completion.
   **
   **    4)  Issue a TREQ_ALLOW_CONNECTIONS request tribble
   **        to the connection manager object (CM)
   **
   **    5a) Issue a TREQ_UCMM_RESTART to the UCMM.
   **    5b) Wait for completion.
   **
   **    If an MacId change is being performed, add the following steps
   **    after 2b):
   **
   **    2c) Issue a TREQ_RESET_TO_OFFLINE request tribble
   **        to the communications device object (CD)
   **    2d) Wait for completion.
   **    2e) Issue a TREQ_SET_MAC_ID request tribble
   **        to the communications device object (CD)
   **    2f) Wait for completion.

   **
   ** Tribble Types:
   **
   **    GS_TrrblType
   */

   TREQ_RESET_TO_OFFLINE,
   TREQ_RESET_AND_GO_ONLINE,
   TREQ_GO_ONLINE,


   /*
   ** Set MAC ID.
   **
   ** Used to request a change in the current MAC ID of the device.
   **
   ** Tribble Type:
   **
   **    CD_TimeoutTrrblType
   */

   TREQ_SET_MAC_ID,

   /*
   ** Enter forced listen-only mode.
   **
   ** ControlNet object mode for diagnostic purposes.
   **
   ** Tribble Type:
   **
   **    GS_TrrblType
   */

   TREQ_FORCED_LISTEN_ONLY,


   /*
   ** Fetch the current network parameters and TUI from the ASIC.
   ** Fetch the current error log from the ASIC.
   **
   ** Tribble Type:
   **
   **    GS_TrrblType
   */

   TREQ_UPDATE_NET_PARAMS,
   TREQ_UPDATE_ERROR_LOG,


   /*
   ** Flush the transmit fifo(s) in the ASIC.
   **
   ** Tribble Type:
   **
   **    GS_TrrblType
   */

   TREQ_FLUSH_TX,

#ifdef CD_EN_OBJECTS
   TREQ_ADD_API_ENTRY,
   TREQ_ADJ_API_ENTRY,
   TREQ_DELETE_API_ENTRY,
#endif

   /*
   ** Node attached notification.
   **
   ** Trrbl sent to an object to notify it that the node is now
   ** attached to the network.
   */

   TREQ_ATTACHED,


   /*
   ** Node detached notification.
   **
   ** Trrbl sent to an object to notify it that the node is now
   ** no longer attached to the network.
   */

   TREQ_DETACHED,


   /*
   ** T-Minus notification.
   **
   ** Used to request notification of the completion of a t-minus countdown.
   ** Primarily used by the keeper.
   **
   ** Tribble Type:
   **
   **    GS_TrrblType
   */

   TREQ_TMINUS_NOTIFY,


   /*
   ** NUT timer.
   **
   ** Start a one shot timer to run for a given number of NUTs.
   ** The TUI_RX variation gets retriggered whenever a TUI packet is received
   ** and, when active, informs the ASIC driver to discard duplicate TUI
   ** packets. Only one timer is supported. Subsequent requests delete
   ** a previously running timer.
   ** Used only by the keeper.
   **
   ** Tribble Type:
   **
   **    CD_TimeoutTrrblType
   */

   TREQ_NUT_TIMEOUT,
   TREQ_TUI_RX_TIMEOUT,


   /*
   ** TUI packet transmission.
   **
   ** These tribble request codes are used by the keeper object to
   ** specify a TUI packet to transmit (and start transmission if it
   ** is not already being done) or stop transmission of a previously
   ** specified TUI packet.  The complete TUI packet must be provided
   ** in the attached combuf.
   ** The TUI packet is transmitted every 4th NUT starting on NUT 0
   ** or as close to these NUTS if the node is not allowed to transmit
   ** scheduled packets (mac id > smax).
   **
   ** Tribble type:
   **
   **    CD_PacketTrrblType
   */

   TREQ_WRITE_TUI,
   TREQ_STOP_TUI,

/*---------------------------------------------------------------------------
** Assorted packet reception codes
**---------------------------------------------------------------------------
*/

   /*
   ** General fixed tag packet reception.
   **
   ** Indicates that one of the ASIC native fixed tag packets
   ** (generally a response to a request) has been received.
   **
   ** Tribble Type:
   **
   **    CD_PacketTrrblType
   */

   TREQ_RX_FIXED_TAG_PACKET,


   /*
   ** I'm Alive! packet reception.
   **
   ** Indicates that an "I'm Alive!" packet has been received from
   ** another node on the network that has just powered up and come
   ** on line. We use this indication to close any existing connections
   ** with that node. A connection may exist if the connection timeout
   ** is longer than the power cycle time of the other node. These are
   ** the world famous "Radioactive Connections".
   **
   ** Tribble Type:
   **
   **    CD_PacketTrrblType
   */

   TREQ_RX_IM_ALIVE,


   /*
   ** TUI packet reception.
   **
   ** Indicates that a TUI packet has been received from a keeper node.
   **
   ** Tribble Type:
   **
   **    CD_PacketTrrblType
   */

   TREQ_RX_TUI,


   /*
   ** Unscheduled packet reception.
   **
   ** Indicates that the attached ComBuf contains a partially digested
   ** unscheduled packet. The packet could be either a UCMM packet after
   ** the UCMM header has been stripped off, or a class 3 packet after
   ** the transport header has been stripped off.
   ** In either case, the application object that receives this packet
   ** doesn't care how the packet got there. It simply uses the packet,
   ** optionally puts a reply in the attached combuf, and returns the
   ** tribble. The reply (if any) magically gets returned to the appropriate
   ** place for further processing.
   **
   ** Tribble Type:
   **
   **    CD_PacketTrrblType
   */

   TREQ_RX_UNSCHEDULED_PACKET,


   /*
   ** WAMI (Where am I?) request initiation and packet reception.
   **
   ** Initiates a WAMI request.
   ** Indicates that a WAMI request packet has been received from a
   ** node attached to the NAP port of this device. An appropriate
   ** response WAMI packet should be transmitted in reply.
   **
   ** Tribble Type:
   **
   **    CD_PacketTrrblType
   */

   TREQ_WAMI,
   TREQ_RX_WAMI,


/*---------------------------------------------------------------------------
** Assorted packet transmission codes
**
** These tribbles are accepted by the CD unscheduled Tx task queues:
** CD_s.xTxUnschedHiQid & CD_s.xTxUnschedLoQid
**---------------------------------------------------------------------------
*/

   /*
   ** Fixed tag packet transmission.
   **
   ** These tribble request codes indicate that a fixed tag packet, in
   ** an attached ComBuf, is to be transmitted.  The packet in the combuf
   ** should not contain the ControlNet header or fixed tag.  These are
   ** added in by the communications device transmit routine prior to
   ** transmission of the packet.
   ** The ComBuf IS NOT MODIFIED by this transmit service.
   **
   ** TREQ_TX_CONFIG        transmit config packet
   ** TREQ_TX_FIXED_TAG     transmit normal fixed tag packet
   **
   ** Tribble Type:
   **
   **    CD_PacketTrrblType
   */

   TREQ_TX_CONFIG,
   TREQ_TX_FIXED_TAG,


/*---------------------------------------------------------------------------
** Identity object specific codes
**---------------------------------------------------------------------------
*/

   /*
   ** Identity object status update request.
   **
   ** This tribble request code is used by the identity object to
   ** make changes in the device status.
   **
   ** Tribble Type:
   **
   **    ID_TrrblType
   */

   TREQ_UPDATE_STATUS,


/*---------------------------------------------------------------------------
** UCMM specific codes
**---------------------------------------------------------------------------
*/

   /*
   ** UCMM client request.
   **
   ** These tribble request codes indicate that a request ComBuf is attached
   ** to a tribble that originated with a source object and will be submitted
   ** to the client side of the UCMM.  The request ComBuf will be transmitted
   ** to the indicated destination and the tribble will not be returned until

⌨️ 快捷键说明

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