MC_ConvertIncPosToPos

MC_ConvertIncPosToPos 1:

The function block MC_ConvertIncPosToPos converts incremental encoder positions into a corresponding NC axis position.

The incremental position is scaled with the scaling factor and the currently valid position offset is applied. The determined NC axis position is in the same coordinate system as the actual position of the axis.

Please note: For the incremental position, bear in mind that the incremental encoder position regularly overflows. The conversion does not take past or future overflows into account and the result is based on current encoder feedback.

MC_ConvertIncPosToPos 2: Inputs

VAR_INPUT
    Axis    : AXIS_REF;
    IncPos  : UDINT;
    Options : ST_NcPositionConversionOptions;
END_VAR

Name

Type

Description

Axis

AXIS_REF

Axis data structure that unambiguously addresses an axis in the system. It contains the current axis status, including position, velocity or error state, among other parameters.

InPos

UDINT

Incremental encoder position

Options

ST_NcPositionConversionOptions

Optional parameters

MC_ConvertIncPosToPos 3: Outputs

VAR_OUTPUT
    Valid    : BOOL;
    Position : LREAL;
    Error    : BOOL;
    ErrorID  : UDINT;
END_VAR

Name

Type

Description

Valid

BOOL

Supplies the NC axis position corresponding to dcTime. This is an NC axis position that has been scaled and provided with an offset, with, for instance, physical units: degrees or millimeters.

Position

LREAL

Position of the NC axis

Error

BOOL

TRUE, if an error occurs.

ErrorID 

UDINT

Returns the error number if an error occurs, e.g. error 0x4012 (axis ID is not allowed, or axis does not exist within the system).

Prerequisites

Library

Version

Tc2_MC2

3.3.59