Questions about how MpCom is used

Hello.

Could you please help me clarify a doubt I have about MpCom?

What is the practical difference between directly using the global MpLink variable automatically generated for a mapp component (e.g., MpRecipeXml) and retrieving the link using the MpComGetLink function block? In which cases is it recommended to use one method over the other?

Thansk in advance.

Regards.

Hi,

in most cases, the usage of the global variables holding the mapp link of a component is suitable and mpCom functions aren’t needed.

But in some variants of software architectures, maybe when you need to write code that is independent of using global variables (for example when developing a universal, project independent library, where access to mapp functions should be used internally), mpComGetLink gives you the possibility to determine the mapp link by only knowing the components name.

Best regards.

1 Like

Hi Alexander.

Thank you very much for reply!

Excuse me, do you have a project on how to use MpCom to understand it better?

Thansk in davance for your support.

Regards.

Hi,

I haven’t a code sample available right now, I’m sorry… today I started in holiday, so I even haven’t access to my notebook :wink:
But maybe some other community member has a example, if not I’ll try to prepare something when I’m back (but to be honest, it will take a couple of weeks).
Let’s see, maybe someone else has already a prepared sample…

Best regards!

1 Like

Hi Alexander.

Ok, enjoy your vacation and thanks for your support.

Regards.