void - 2021-11-05

Hello,

I'm a beginner to codesys and I have been trying to gain access to the AXIS_REF_SM3 i.e. Axis of SM3_Basic.MC_MoveAbsolute in order to return the wDriveId of the axis.

Since Axis is declared as a VAR_IN_OUT variable, I am unable to access it outside of the FB using the .Axis syntax since it will cause the compiler to throw a

C0178:  No external access to VAR_IN_OUT parameter 'Axis' of 'MC_MOVEABSOLUTE'."

error which makes sense since VAR_IN_OUT variables are not supposed to be remotely accessible.

I then tried to extend the FB with FUNCTION_BLOCK FB_MoveAbsolute EXTENDS SM3_Basic.MC_MoveAbsolute and write my own method to return the Axis in the PRG calling FB_MoveAbsolute but I am getting the following compiler error

C0283:  Function block 'FB_MoveAbsolute': No override possible on Method MC_MoveAbsolute.FB_Init with access specifier FINAL

instead.

Does anyone know of a better way to get the wDriveId value of the Axis from SM3_Basic.MC_MoveAbsolute?
Or some other way of checking which axis the FB is using?
I am using codesys v3.5 sp16 patch 4 with the codesys softmotion 4.10.0.0 package