SMC_FreeEncoder (FB)

FUNCTION_BLOCK SMC_FreeEncoder

the need to add it to the device tree.

Use the output variable Encoder of type FREE_ENCODER_REF as the encoder

axis.

If the function block is restarted, the free encoder is reinitialized.

Note that instances of this function block must not be assigned to other instances of the same function block. If you create your own function block containing this function block, it is recommended to add the attribute ‘no_assign’ to your function block as well.

InOut:

Scope

Name

Type

Initial

Comment

Input

Execute

BOOL

Starts the execution of the function block.

diEncoderPosition

DINT

The encoder position in increments.

bDelayActivation

BOOL

During startup, communication state 90 will not be reached as long as this value is TRUE.

wDriveID

WORD

1

Identifier of the drive.

iMovementType

SMC_AXIS_TYPE

SMC_AXIS_TYPE.modulo

The type (finite or modulo) of axis.

fPositionPeriod

LREAL

360.0

Length of period for modulo drives in technical units [u].

dwRatioTechUnitsDenom

DWORD

16#10000

The number of encoder increments per iRatioTechUnitsNum.

iRatioTechUnitsNum

DINT

360

The number of technical units [u] per dwRatioTechUnitsDenom.

usiEncoderBitWidth

USINT

32

The bit width of the encoder signal.

Output

Initialized

BOOL

The encoder axis is intialized and can be used.

Error

BOOL

There is an error.

Encoder

FREE_ENCODER_REF

The encoder axis.