How to configure multiple PDOs through Host Application for Anybus CompcatCom 40 EtherCAT

21 Feb 2024

This article described How to configure multiple PDOs through driver programmer for Anybus CompcatCom 40 EtherCAT. Firstly, the principle was introduced, followed by the method.

 

APPLICABLE PRODUCTS

AB6607-C, Anybus CompactCom for EtherCAT M40
AB6639-C, Anybus CompactCom for EtherCAT M40 with Transparent Ethernet
AB6645-C, Anybus CompactCom for EtherCAT M40 with M12 connectors
AB6677-C, Anybus CompactCom for EtherCAT B40
AB6707-C, Anybus CompactCom for EtherCAT M40 without housing
AB6739-C, Anybus CompactCom for EtherCAT M40 with Transparent Ethernet without housing
AB6745-C, Anybus CompactCom for EtherCAT M40 with M12 connectors without housing
AB6779-C, Anybus CompactCom for EtherCAT B40 with Transparent Ethernet

 

PRE-REQUISITES

This article simply introduces how to configurate Ethernet parameters. More information about ethernet parameters can refer to user manual.

《Anybus CompactCom 40 - Software Design Guide》

《Anybus CompactCom 40 - Host Application Implementation Guide》

《Anybus CompactCom 40 - EtherCAT Network Guide》

This article based to enable host application \example_app\appl_adimap_asm.c ADI define example.

IN THIS ARTICLE

  • The principle of define multiple PDOs for Anybus CompactCom 40 EtherCAT
  • To configure Host Application to define multiple PDOs. 
  • Regenerate Anybus CompactCom 40 EtherCAT ESI file.

 

The principle of define multiple PDOs of Anybus CompactCom 40 EtherCAT

  1. Every PDO corresponding to a set of periodic data combinations,In host application, Every PDO corresponding a APPL_asAsmObjWrite/ReadMap*[] in code file "appl_adimap_asm.c",The number of PDOs is up to 6 in each dirction.
  2. More information can refer to 《Anybus CompactCom 40 - EtherCAT Network Guide》 section 4 of unit 3,At the same time,Remap function and Assembly Mapping Object (EBh) should be enabled.

 

To configure Host Application to define multiple PDOs

  1. SetABCC_CFG_REMAP_SUPPORT_ENABLED to TRUE in \abcc_adapt\abcc_drv_cfg.h
    • /*------------------------------------------------------------------------------
      ** Remap support configuration
      **
      ** Check the descriptions in "./abcc_drv/inc/abcc_cfg.h" for more information
      ** about the purpose of each separate 'define'.
      **------------------------------------------------------------------------------
      */
      #ifndef ABCC_CFG_REMAP_SUPPORT_ENABLED
      #define ABCC_CFG_REMAP_SUPPORT_ENABLED ( TRUE )
      #endif
  2. Set ASM_OBJ_ENABLEASM_IA_NAME_ENABLE to TRUE in  \abcc_adapt\abcc_obj_cfg.h


    • #ifndef ASM_OBJ_ENABLE
      #define ASM_OBJ_ENABLE TRUE
      #endif

      #if ASM_OBJ_ENABLE
      /*
      ** Attribute 13: Name (Array of CHAR - {0x00-0xFF))
      */
      #ifndef ASM_IA_NAME_ENABLE
      #define ASM_IA_NAME_ENABLE TRUE
      #endif
  3. Set  APPL_ACTIVE_ADI_SETUP to APPL_ADI_SETUP_ASM in \example_app\appl_adi_config.h
    • #ifndef APPL_ACTIVE_ADI_SETUP
      #ifdef USE_BOARD_SPECIFIC_ADI_SETUP
      #define APPL_ACTIVE_ADI_SETUP APPL_ADI_SETUP_SIMPLE_16
      #else
      #define APPL_ACTIVE_ADI_SETUP APPL_ADI_SETUP_ASM
      #endif
      #endif
  4. Open \example_app\appl_adimap_asm.c file,Add ADI to APPL_asAsmObjWrite/ReadMap*[] as process data,it's equal to modify PDO.
    • const AD_MapType APPL_asAsmObjWriteMap1[] = //TPDO 0x1A00 Input Data
      {
      { 1, PD_WRITE, AD_MAP_ALL_ELEM, 0 },
      { 3, PD_WRITE, AD_MAP_ALL_ELEM, 0 },
      { AD_MAP_END_ENTRY }
      };

      const AD_MapType APPL_asAsmObjWriteMap2[] = //TPDO 0x1A01
      {
      { 1, PD_WRITE, AD_MAP_ALL_ELEM, 0 },
      { AD_MAP_END_ENTRY }
      };

      const AD_MapType APPL_asAsmObjWriteMap3[] = //TPDO 0x1A02
      {
      { 3, PD_WRITE, AD_MAP_ALL_ELEM, 0 },
      { AD_MAP_END_ENTRY }
      };

      /*------------------------------------------------------------------------------
      ** Example read maps.
      **------------------------------------------------------------------------------
      */
      const AD_MapType APPL_asAsmObjReadMap1[] = //RPDO 0x1600 Output data
      {
      { 2, PD_READ, AD_MAP_ALL_ELEM, 0 },
      { 4, PD_READ, AD_MAP_ALL_ELEM, 0 },
      { AD_MAP_END_ENTRY }
      };

      const AD_MapType APPL_asAsmObjReadMap2[] = //RPDO 0x1601
      {
      { 2, PD_READ, AD_MAP_ALL_ELEM, 0 },
      { AD_MAP_END_ENTRY }
      };
  5. Add  a RPDO 0x1602
    1. Copy a APPL_asAsmObjReadMap* array,Rename to APPL_asAsmObjReadMap3
      • const AD_MapType APPL_asAsmObjReadMap3[] = //RPDO 0x1601
        {
        { 2, PD_READ, AD_MAP_ALL_ELEM, 0 },
        { AD_MAP_END_ENTRY }
        };
    2. Copy a APPL_sAsmReadMapInst* struct,Rename to APPL_sAsmReadMapInst3,Modify parameter to corresponding APPL_asAsmObjReadMap3.The parameter value of APPL_asAsmObjReadMap3. can refer section 7 of unit 13 《Anybus CompactCom 40 - Software Design Guide》

      • const ASM_InstanceType APPL_sAsmReadMapInst3 =
        {
        ABP_ASM_IA_DESC_READ | ABP_ASM_IA_DESC_STATIC | ABP_ASM_IA_DESC_PD_MAPPABLE,
        APPL_asAsmObjReadMap3,
        "Read mappable assembly 3"
        };

    3. Add the pointer of APPL_sAsmReadMapInst3 to APPL_aasAsmInstances[].
      • const ASM_InstanceType* APPL_aasAsmInstances[] =
        {
        &APPL_sAsmWriteMapInst1, /* Instance 1 */
        &APPL_sAsmWriteMapInst2, /* Instance 2 */
        &APPL_sAsmWriteMapInst3, /* Instance 3 */
        &APPL_sAsmWriteNonMapInst, /* Instance 4 */
        &APPL_sAsmReadMapInst1, /* Instance 5 */
        &APPL_sAsmReadMapInst2, /* Instance 6 */
        &APPL_sAsmReadMapInst3, /* Instance 7 */
        &APPL_sAsmReadNonMapInst /* Instance 8 */
        };
  6. Rebuild the Host Application.

 

Regenerate Anybus CompactCom 40 EtherCAT ESI file.

  1. Regenerate Anybus CompactCom 40 EtherCAT ESI file through HMS EtherCAT ESI Generator.
  2. Add ESI file to EtherCAT Main device configration tools  to replace old version ESI file

 

ADDITIONAL INFO

The example code are for reference only,not as the final functional implementation standard.More information can refer to user maunal.


The user manual download link:

Anybus Files and Documentation