# MpLink/ mcAxisTyp access inside IEC Library

**URL:** <https://community.br-automation.com/t/mplink-mcaxistyp-access-inside-iec-library/2348>\
**Category:** Mechatronics & Motion\
**Tags:** mapp-motion\
**Created:** [February 26, 2024, 9:57am UTC](https://community.br-automation.com/t/mplink-mcaxistyp-access-inside-iec-library/2348 "2024-02-26T09:57:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![whyleys](https://avatars.discourse-cdn.com/v4/letter/w/FF8800/32.png) [@whyleys](https://community.br-automation.com/u/whyleys)\
**Post date:** [February 26, 2024, 9:57am UTC](https://community.br-automation.com/t/mplink-mcaxistyp-access-inside-iec-library/2348/1 "2024-02-26T09:57:18Z")

</div>

Hello,

I’m creating a custom IEC function block (ST) and want to use the following function blocks which require my axis link mpAxisBasic, MC\_BR\_VelocityControl & MC\_BR\_CommandError. But I can’t figure out how to pass the ADR() &mcAxisTyp into the function block without causing service mode and Page fault.

I have read the help on dynamic variables and have tried the ACCESS call multiple ways but still scratching my head ☹

I’m assuming this is possible, is anyone able to give me an example of passing this variable inside with program call and datatype?

Thanks  
Shaun 🙂

---

<div class="post-metadata">

**Author:** ![christoph.hilchenbac](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/christoph.hilchenbac/32/423_2.png) [@christoph.hilchenbac](https://community.br-automation.com/u/christoph.hilchenbac)\
**Post date:** [February 26, 2024, 12:15pm UTC](https://community.br-automation.com/t/mplink-mcaxistyp-access-inside-iec-library/2348/2 "2024-02-26T12:15:25Z")

</div>

actually the MC\_ function block require a pointer to a McAxisType so you can just use an UDINT instead a REFERENCE TO McAxixType:

![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/4/4ad6af305f39a7dd2818dc6e91dd716dc6a165d7.png)

this can then simply be passed to the system function blocks:

![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/0/0011de77519950b1c2f7471aa2c0a9ff4fd7b4d3.png)

![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/7/7452a84f74d40334badd9a24b38257cddb133ad4.png)

With C or C++ you can alternatively use a REFERENCE TO McAxisType:

![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/5/5e10fc6d2c974686e2a4d27df7e7cfa23e3c1af7.png)

I’m very curious to see if someone can make it look nicer with ST.

---

<div class="post-metadata">

**Author:** ![whyleys](https://avatars.discourse-cdn.com/v4/letter/w/FF8800/32.png) [@whyleys](https://community.br-automation.com/u/whyleys)\
**Post date:** [February 26, 2024, 1:46pm UTC](https://community.br-automation.com/t/mplink-mcaxistyp-access-inside-iec-library/2348/3 "2024-02-26T13:46:58Z")

</div>

Thank you Christoph!! I jumped straight past the simplest form and over complicated this for myself! Solution solved… I love this platform 😃

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/3/3c1bb7e9b2183d6adbb20bd9d9d3c4335fd8aec7.png)

![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/d/dcb01d0e3d9df851e2b17d8fd283e4f3bdc635f9.png)
