Questions about Assembly Mapping Object

Hello,

After managing to successfully map all ADIs during runtime (filling out APPL_asAdObjDefaultMap[] array), I am struggling to map those in the Assembly Object and exchange I/O data with the PLC. Initially I am using a NP40 EtherNet/IP module, but soon others will be supported as well.

If I set ASM_OBJ_ENABLE to TRUE (abcc_obj_cfg.h file), module does not start up correctly, indicating of course there’s something wrong with my code. I am trying to blend the example code with mine but it’s not working.

Please find below basic settings, considering 2 input and 2 output words are going to be exchanged between Anybus and the PLC. Later on the number of words will be also set by the user.

image

image

image

I can’t quite figure out what’s wrong with my settings, so any help will be appreciated.

PS: Not using the REMAP calls. My approach is to set everything before calling AD_Init.

Best Regards.

Hello @lsilva ,

What errors are you getting when the device starts? I would recommend enabling additional debug messages in the abcc_drv_cfg.h if you have not already. Reviewing these may point towards the issue.

Have you reviewed and got the Appl_adimap_asm.c example provided running?

Also EIP has a few additional requirements described in asm_obj.c


** -----------------------------------------------------------------------------
** EtherNet/IP specific requirements
** -----------------------------------------------------------------------------
** If there is at least one mappable assembly mapping instance defined, make
** sure that the following definition is set in abcc_obj_cfg.h:
** EIP_OBJ_ENABLE              ( TRUE )
**
** If there is at least one write mappable assembly mapping instance defined,
** make sure that the following definitions are set in abcc_obj_cfg.h
** EIP_IA_PROD_INSTANCE_ENABLE ( TRUE )
**
** The array defined by EIP_IA_PROD_INSTANCE_VALUE must have the same size as
** the number of process data mappable write assemblies.
** EIP_IA_PROD_INSTANCE_ARRAY_SIZE must be set to this size.
**
** If there is at least one read mappable assembly mapping instance defined,
** make sure that the following definitions are set in abcc_obj_cfg.h
** EIP_IA_CONS_INSTANCE_ENABLE ( TRUE )
**
** The array defined by EIP_IA_CONST_INSTANCE_VALUE must have the same size as
** the number of process data mappable read assemblies.
** EIP_IA_CONS_INSTANCE_ARRAY_SIZE must be set to this size.
********************************************************************************
********************************************************************************

Hello Deryck,

In the current stage of development, enabling the debug messages is a bit tricky. But this afternoon I managed to make it work. It turns out that, without enabling ABCC_CFG_REMAP_SUPPORT_ENABLED define, initial mapping does not work or is “incomplete”. Or the “binding” between Assembly instances and the EIP instances does not happen; don’t know for sure. Like I mentioned in my previous message, I am trying to avoid any dynamic configuration. It worked when building the APPL_asAdObjDefaultMap[] array. Tried to do the same thing here, unsuccessfully.

And yes Deryck, have used those examples as starting point; it helped a lot.

So, for the record, Remmaping Support must be set to TRUE in order to have I/O communication.

Thank you, Luciano.

Hi,

Indeed, when reading the specific doc file for EtherNet/IP (SCM-1202-031) I noticed that as well. That led me to check other parts of the code, and fix the problem. :slightly_smiling_face:

Thank you!

Sorry, I had over looked that you already included the EIP objects at the bottom of your example.

Glad to hear it is working. I would recommended opening related cases on support.hms-networks.com for more in-depth questions like this it allows us to involve additional people.