MC_SEW_ConfigEncoderAxis

This function block configures an encoder axis. The configuration can also be carried out via the configuration menu of the logical device.

VAR_IN_OUT

Variable name

Data type

Description

Axis

AXIS_REF

Reference to a logical device
(name of the logical device)

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

Start execution of the function block.

EncoderSource

E_EncoderSource

Select the source of the encoder:

  • When the encoder is connected to a MOVI-C® axis:
  • E_EncoderSource.Encoder2
  • When using an external encoder, e.g. via EtherCAT®:
  • E_EncoderSource.eExternalSource

EncoderMinValue

DINT

Minimum value of the encoder position

Only required if EncoderSource is E_EncoderSource.eExternalSource. The encoder position is processed as a DINT value. If the encoder position covers the entire DINT range (-2147483648 to 2147483647), EncoderMinValue and EncoderMaxValue must be set to 0. In all other cases, the two values must be set according to the encoder configuration.

EncoderMaxValue

DINT

Maximum value of the encoder position

Only required if EncoderSource is E_EncoderSource.eExternalSource. The encoder position is processed as a DINT value. If the encoder position covers the entire DINT range (-2147483648 to 2147483647), EncoderMinValue and EncoderMaxValue must be set to 0. In all other cases, the two values must be set according to the encoder configuration.

PositionWindow

LREAL

Position window for a consistency check between the saved position on the MOVI-C® CONTROLLER and the actual position of the encoder. If the saved position on the MOVI-C® CONTROLLER (RETAIN) and the actual position of the encoder are outside the PositionWindow, a warning is issued. If PositionWindow is 0, the consistency check is switched off.

FilterType

E_FilterType

Select the filter type for the encoder position:

  • E_FilterType.eNoFilter
  • E_FilterType.eAverageFilter
  • E_FilterType.ePT1Filter

FilterTime

DINT

Filter time for encoder position in [ms]

(maximum value 1000 ms)

DeadTimeCompensation

LREAL

Delay of the encoder position in [ms]

(maximum value 1000 ms)

VAR_OUTPUT

Variable name

Data type

Description

Done

BOOL

Function block successfully completed

Busy

BOOL

Function block is active

Error

BOOL

An error has occurred in the function block

ErrorID

WORD

Error number