In Anybus CompactCom applications, how can I print out a message log?

25 Mar 2025

With the ABCC driver package "Host Application Example Code" you can print out the messages that are exchanged between the Anybus CompactCom (ABCC) and your host controller.  This can be important for debugging.  This article described what changes have to be made.

 

APPLICABLE PRODUCTS

Anybus CompactCom 40 or 30 series

 

In Anybus CompactCom applications, how can I print out a message log?

  1. In abcc_adapt/abcc_drv_cfg.h, set at least the define ABCC_CFG_DEBUG_MESSAGING to TRUE:
    /*------------------------------------------------------------------------------
    ** Debug and error macro configuration
    **
    ** Check the descriptions in "./abcc_drv/inc/abcc_cfg.h" for more information
    ** about the purpose of each separate 'define'.
    **------------------------------------------------------------------------------
    */
    #ifndef ABCC_CFG_ERR_REPORTING_ENABLED
    #define ABCC_CFG_ERR_REPORTING_ENABLED ( TRUE )
    #endif
    #ifndef ABCC_CFG_DEBUG_EVENT_ENABLED
    #define ABCC_CFG_DEBUG_EVENT_ENABLED ( TRUE )
    #endif
    #ifndef ABCC_CFG_DEBUG_ERR_ENABLED
    #define ABCC_CFG_DEBUG_ERR_ENABLED ( FALSE )
    #endif
    #ifndef ABCC_CFG_DEBUG_MESSAGING
    #define ABCC_CFG_DEBUG_MESSAGING ( TRUE )
    #endif
    #ifndef ABCC_CFG_DEBUG_CMD_SEQ_ENABLED
    #define ABCC_CFG_DEBUG_CMD_SEQ_ENABLED ( FALSE )
    #endif
    #ifndef ABCC_CFG_DEBUG_HEXDUMP_MSG
    #define ABCC_CFG_DEBUG_HEXDUMP_MSG ( FALSE )
    #endif
    #ifndef ABCC_CFG_DEBUG_HEXDUMP_SPI
    #define ABCC_CFG_DEBUG_HEXDUMP_SPI ( FALSE )
    #endif
    #ifndef ABCC_CFG_DEBUG_HEXDUMP_UART
    #define ABCC_CFG_DEBUG_HEXDUMP_UART ( FALSE )
    #endif
    #ifndef ABCC_CFG_DEBUG_CRC_ERROR_CNT
    #define ABCC_CFG_DEBUG_CRC_ERROR_CNT ( FALSE )
    #endif
  2. In abcc_adapt/abcc_sw_port.h adapt the define ABCC_PORT_DebugPrint() to where the messages should be routed to.  This can be the output window of your IDE, a file in your controller's file system, or an unused UART.

    Example:
    #define ABCC_PORT_DebugPrint( args ) printf args

 

ADDITIONAL INFO (Optional)

Download the Anybus Host Application Example Code