Using an external encoder as the encoder source

A position value, e.g. from an EtherCAT® encoder, can be used as the source for the encoder axis.

To use the 2nd encoder as the source for the encoder axis, select the option "Encoder 2" as the "Encoder source" in the configuration menu Encoder axis settings, or set the EncoderSource parameter to "Encoder 2" via the function block MC_SEW_ConfigEncoderAxis.

Call the MC_SEW_EncoderAxis function block and link the address of the source of the encoder position (e.g. %ID012) to the PointerToPosition input as follows. If the external encoder provides speed information, link the address of the source of the encoder speed (e.g. %ID016) to the PointerToVelocity input.

VAR

EncoderAxis : MC_SEW_EncoderAxis;

END_VAR

// Use of the function block to connect an external encoder

EncoderAxis( Enable:= TRUE, Axis := NameOfLogDevEncoderAxis,
PointerToPosition := ADR(%ID12));