ComputeMasterPositions

ComputeMasterPositions 1:

Finds the master position(s) for a given slave position.

Syntax

Definition:

METHOD ComputeMasterPositions : UDINT
VAR_INPUT
    SlavePosition                : LREAL;
    SlavePositionPrecision       : LREAL;
    MasterMinPosition            : LREAL;
    MasterMaxPosition            : LREAL;
    MasterPositionTolerance      : LREAL;
    DestinationAddress           : Pointer To LREAL;
    NumberOfMasterPositions      : UDINT;
END_VAR
VAR_OUTPUT
    NumberOfMasterPositionsFound : UDINT;
END_VAR

ComputeMasterPositions 2: Inputs

Name

Type

Description

SlavePosition

LREAL

Position of the slave axis for which the master positions are to be determined.

SlavePositionPrecision

LREAL

Absolute precision for which a slave position at a certain master position is considered equal to the SlavePosition input (must be larger than 0, e.g. 1E-3).

MasterMinPosition

LREAL

Leftmost limit of the cam profile range to be evaluated.

MasterMaxPosition

LREAL

Rightmost limit of the cam profile range to be evaluated.

MasterPositionTolerance

LREAL

Minimum distance between distinct master positions found (must be larger than 0, e.g. 1E-3).

DestinationAddress

Pointer To LREAL

Pointer to the destination array for found master positions.

NumberOfMasterPositions

UDINT

Capacity of the DestinationAddress array.

ComputeMasterPositions 3: Outputs

Name

Type

Description

NumberOfMasterPositionsFound

UDINT

Number of master positions found matching the given slave position and master position range.

ComputeMasterPositions 4: Return value

UDINT