MpLink/ mcAxisTyp access inside IEC Library

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 :frowning:

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 :slight_smile:

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

image

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

image

image

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

image

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

2 Likes

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

image

4 Likes