XFC_TimeToPathPosition

XFC_TimeToPathPosition 1:

The function block XFC_TimeToPathPosition calculates the time period within which an Nci group has traveled a relative path or which has elapsed since then.

The function extrapolates the time in relation to the current path position and dynamics. Precise extrapolation is only possible over a short interval, since the group dynamics may change.

The function block requires precisely one call in order to provide the result. It can therefore be used similar to a function, although as well as the time it may also return an error. This error must be analyzed in order to ensure that the calculated time duration is valid.

XFC_TimeToPathPosition 2: Inputs

VAR_INPUT
    GrpId        : UDINT;
    PathId       : UDINT;
    PathPosition : LREAL;
    Options      : ST_NcTimeConversionOptions;
END_VAR

Name

Type

Description

GrpId

UDINT

Group ID of the Nci group. This clearly identifies the requested Nci group in the system.

PathId

UDINT

Unique ID that continually increases over the path course and belongs to the relative path.

PathPosition

LREAL

Relative path

Options

ST_NcTimeConversionOptions

Data structure with options for the extrapolation of the relative path.

XFC_TimeToPathPosition 3: Outputs

VAR_OUTPUT
    Duration       : DINT; 
    TimeOfPosition : T_DCTIME32; 
    Error          : BOOL;
    ErrorID        : UDINT;  
END_VAR

Name

Type

Description

Duration

DINT

Time period in nanoseconds after which the relative path will have been travelled (>0) or which has elapsed since then (<0).

Duration is a differential value from two variables of the type T_DCTIME32

TimeOfPosition

T_DCTIME32

Distributed clock system time at which the relative path distance was or will have been be travelled.

DcTime contains the lower 32 bits of the complete DcTime and covers a time range of +/- 2 seconds around the current time.

Error

BOOL

Becomes TRUE if an error occurs.

ErrorID

UDINT

If the error output is set, this parameter supplies the error number.