FB_EncoderPreset_M262: Preset the Encoder

Function Block Description

This function block is used to preset the encoder, in incremental or SSI mode.

Graphical Representation

G-SE-0075060.1.gif-high.gif

 

 

IL and ST Representation

To see the general representation in IL or ST language, refer to the chapter Function and Function Block Representation.

I/O Variable Description

This table describes the input variables:

Input

Type

Default

Comments

ENC_REF_M262

ENC_REF_M262

Reference of the encoder instance.

xEnable

BOOL

FALSE

TRUE enables the encoder preset function, via:

oThe preset mode using REF on I0 and Z on the encoder

oThe xForce input of the function block

xForce

BOOL

FALSE

On rising edge, presets and starts the counter if xEnable is TRUE.

etREF_Input

ET_ENC_INPUT_M262

ENC_INPUT_REF_I0

Defines the REF input. The only valid value is I0.

etMode

ET_ENC_PRESET_MODE_M262

ENC_PRESET_NO

Selects the conditions to preset the counting function with REF and Z inputs.

diPresetValue

DINT

0

Defines the value loaded in the encoder actual value at preset event.

This table describes the output variables:

Output

Type

Default

Comment

xValid

BOOL

FALSE

TRUE indicates that the output values on the function block are valid.

xError

BOOL

FALSE

TRUE indicates that an error is detected.

etErrorId

ET_ENC_ERROR_M262

ENC_ERROR_NO

Indicates the code of the detected error when xError is TRUE.

xPresetFlag

BOOL

FALSE

Set to TRUE for one cycle by the preset of the encoder.