Anybus CompactCom B40 Setting Incorrect MAC Address

Hello Anybus Support,

I have been trying to set a custom MAC address to CompactCom B40 EtherNet IP module using the Ethernet Object (0xF9) attribute 1.

I have the following edit in abcc_identification.h file:

#if ETN_OBJ_ENABLE
/*
** Attribute 1: MAC Address (Array[6] of UINT8)
*/
#ifndef ETN_IA_MAC_ADDRESS_ENABLE
#define ETN_IA_MAC_ADDRESS_ENABLE TRUE
#define ETN_IA_MAC_ADDRESS_VALUE “\x00\x30\x11\x12\x34\x56
#endif

#endif /* #if ETN_OBJ_ENABLE */

ETN_OBJ_ENABLE is also enabled in abcc_obj_cfg.h file.

Pre-programmed MAC address on EIP Module: 00-30-11-3A-6E-FD

After uploading the above changes to host application the MAC address comes out to be: 00-30-11-00-94-00 everytime irrespective of what I set for ETN_IA_MAC_ADDRESS_VALUE

Is there anything that I am missing in configuring the MAC address of Anybus CC40 module?

Hi @pdesai,

What Network type are you using. Profibus does get a bit more complicated, requiring consecutive MAC addresses.

Deryck

Hi @deryck_hms,

I am using EtherNetIP. I read the above document and understand the consecutive mac address requirement for RPOFINET.

I looked further into the host application code provided by hms and found an error in etn_obj.c in the following code:

#if ETN_IA_MAC_ADDRESS_ENABLE
      case ABP_ETN_IA_MAC_ADDRESS:
      {
         UINT16 i;
         UINT8  abMac[ 6 ];
         char  abMac1[ 6 ];

         /*
         ** Copy the 1st Instance 1 attribute (MAC Address) to the message.
         */

         ABCC_PORT_MemCpy( abMac, ETN_IA_MAC_ADDRESS_VALUE, ABP_ETN_IA_MAC_ADDRESS_DS );

         for( i = 0; i < ABP_ETN_IA_MAC_ADDRESS_DS; i++ )
         {
            ABCC_SetMsgData8( psNewMessage, abMac[ i ], i );
         }
         ABP_SetMsgResponse( psNewMessage, ABP_ETN_IA_MAC_ADDRESS_DS );
         break;
      }
#endif

ABP_ETN_IA_MAC_ADDRESS_DS is defined as ( 6 * ABP_UINT8_SIZEOF ) but for a TI processor, size of Uint8 (ABP_UINT8_SIZEOF) is 2 bytes while Anybus implementation considers it to be 1 byte. Hence only the top three octets of MAC (00-30-11) are copied over to abMac. I addressed that bug by changing the MemCpy implementation for my application to copy all six octets.

Further, I am facing an issue where the module doesn’t connect to the network (Network Status LED OFF) if I change the first three octets of the MAC address (00-30-11) which I believe is the OUI for HMS, which is strange. I believe the end-user should have the freedom to update the MAC address as per their implementation for Embedded Anybus CC.

Can you point out an example where a user was successful in reassigning a MAC address?

Thanks.

Any update on the above-mentioned issue?

Further digging into the MAC address assignment I found that Anybus Module doesn’t like when LSB (least significant bit) of the first octet of an address is set to one(meaning 01-xx-xx-xx-xx-xx). This bit represents Multicast MAC addressing.

Anybus accepts all other MAC addresses in Unicast format (the least significant bit of first octet of an address is set to zero). Can you please validate the above statement? If not are there any settings/flags that would allow me to set a Multicast MAC address for anybus module?

Thans.

Hi @pdesai,

My apologies, we switched to a new ticketing system last week and I lost track of this issue.

Can you provide more details on why you are trying to set a Multicast MAC address? It seems a bit unusual to use a multicast address.

Hi @pdesai ,
Discussing the bug with a colleague at our headquarters this seems more related to the memcopy used which is causing issues. Can you try the following function and let me know if it resolved the issue.

case ABP_ETN_IA_MAC_ADDRESS:
{
/*
** Copy the 1st Instance 1 attribute (MAC Address) to the message.
*/

ABCC_SetMsgString( psNewMessage, ETN_IA_MAC_ADDRESS_VALUE, ABP_ETN_IA_MAC_ADDRESS_DS, 0 );
ABP_SetMsgResponse( psNewMessage, ABP_ETN_IA_MAC_ADDRESS_DS );

break;
}

I also brought up the use of multicast address, we are thinking there could be an internal check to prevent multicast addresses from being used. Are you able to provide further details on your use case here?

Deryck

Hi @deryck_hms ,

I tried using your code snippet for setting MAC address, and it worked as expected. It resolved the following issue:

ABP_ETN_IA_MAC_ADDRESS_DS is defined as ( 6 * ABP_UINT8_SIZEOF ) but for a TI processor, size of Uint8 (ABP_UINT8_SIZEOF) is 2 bytes while Anybus implementation considers it to be 1 byte . Hence only the top three octets of MAC (00-30-11) are copied over to abMac. I addressed that bug by changing the MemCpy implementation for my application to copy all six octets.

Do you plan to release a new version of the host application source code with this fix in near future? We currently use ABCC Starter Kit version 3.07.02 (2020-12-09).

I do believe that there could be an internal check to prevent multicast addresses from being used. I consulted my team and figured it was a legacy error, and we do not need to have a Multicast MAC address for those modules.

Thanks for your timely help!

There has been a bug report filed for this issue but I am not sure when this issue would be resolved. It will most likely be a little while for new source code is released once the bug is fixed it still takes some time for a new release to come out.