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
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
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm a beginner to codesys and I have been trying to gain access to the
AXIS_REF_SM3
i.e.Axis
ofSM3_Basic.MC_MoveAbsolute
in order to return thewDriveId
of the axis.Since
Axis
is declared as aVAR_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 aerror 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 theAxis
in the PRG callingFB_MoveAbsolute
but I am getting the following compiler errorinstead.
Does anyone know of a better way to get the
wDriveId
value of theAxis
fromSM3_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