Building ADI list during runtime for 40-series comm cards

Hello there,

I have built a communication card for an industrial equipment around Anybus 40-series. Using the Starter Kit as starting point to my software, I managed to make it work. Have also tested all those examples for ADI mapping and successfully exchanged cyclic and acyclic data.

But the trouble is, in the real product that will be released to the market, the number of exchanged IOs (therefore ADIs) will be selected by the end user. He will be able to program the equipment using the HMI, and we are planning to support up to 50 words for input and another 50 words for output.

The code expects that those arrays for ADIs are known during compilation-time (APPL_asAdiEntryList and APPL_asAdObjDefaultMap). Besides, all C functions that manipulate these arrays are also supposing they have fixed size.

I am scratching my head to figure out a solution for this case where one cannot tell the size for those data structs beforehand. Any ideas?

Thanks a lot,
Luciano.

Hi Isilva,

This might be something you can achieve by remapping the ADI’s at runtime. This would allow you to change what ADI’s are mapped depending on the current requirements.
There are details in section 13.4 of the software guide. https://www.anybus.com/docs/librariesprovider7/default-document-library/manuals-design-guides/hms-hmsi-216-125.pdf?sfvrsn=39f8a9d6_79

Hi Deryck,

Thanks for the quick reply!

Right, so the remapping is the resource to achieve what I need. Remember seeing something when I read the Host Application Implementation Guide, but wasn’t completely sure. Now in practical terms, how do I do that? Do you happen to have an example? File “abcc_remap.c” has two functions, which I guess should be called somewhere during the main loop.

Kind Regards,
Luciano.

The example application is designed for remapping. The separate16 may be a good example to take a look at as it requires ADI remapping to be enabled.
What network types are you targeting? The remapping is generally done from the network side. Think profinet modules or PDO mapping in CANopen, it help to be familiar with this process to understand what is happening in the abcc. setting this up, and looking at the setup from the PLC side should give you a good idea on how you would need to setup your ADI’s to reach your expectation.

Hi Deryck,

Ok, will take a better look at that example. Concerning the targets, the plan is to support EtherNet/IP, Profinet IRT, Profibus and EtherCAT cards.

On top of that, I have another question. The equipment where this accessory is going to be installed has more than a thousand parameters. Some of them will be selected (it’s up to the end user to select which ones) for cyclic data, but most of them, however, will be read/written in acyclic way only. Those are typically for configuration.

What I would like to achieve. In the webpage of the Anybus module, Parameters section, I would like to see all parameters available in the equipment. It’s convenient for the operator to use this page to fine tune some parameters. But this long list won’t be mappable. How can I get this working? I guess I don’t need to build a huge array with every possible parameter supported by the equipment. We have this feature for 30-series based devices, but in that case we process every ADI request on the fly.

Thanks a lot,
Luciano.

Hi Luciano,

The webpage will allow access to all the ADI’s so they should be able to access them here to set parameters as needed. Unless I am overlooking or misunderstanding your question you will need to setup/define all the ADI’s.

Hi Deryck,

Apologies for the delay in replying to you; was trying to speed up the things over here.

Concerning your assumption, you are right, I will have to setup/define/map all parameters as ADI’s. Actually, have done that already… So now I have a huge APPL_asAdiEntryList[] array, over thousand lines long. Not a big deal though.

Regarding the mapping, APPL_asAdObjDefaultMap[] array, decided to take a different path. Rather than relying on Remap_ADI_[Read,Write]_Area calls, I am filling out this array during runtime, right after power up, and based on the quantity of words selected by the customer. When this is done, I simply call AD_Init(). It works perfectly.

Thanks a lot for your assistance.