MC_ConvertPosToIncPos

MC_ConvertPosToIncPos 1:

The function block MC_ConvertPosToIncPos converts an NC axis position into a corresponding incremental encoder 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. If the NC axis position is too far away from the actual position of the NC axis, the function block returns an error.

MC_ConvertPosToIncPos 2: Inputs

VAR_INPUT
    Axis     : AXIS_REF;
    Position : LREAL;
    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.

Position

LREAL

Position of the NC axis

Options

ST_NcPositionConversionOptions

Optional parameters

MC_ConvertPosToIncPos 3: Outputs

VAR_OUTPUT
    Valid   : BOOL;
    IncPos  : UDINT;
    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.

InPos

UDINT

Incremental encoder position

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