ConvertDcTimeToPathPos

Under construction...

ConvertDcTimeToPathPos 1:

This function block converts a 32 bit Distributed Clock System Time into an associated NC axis position (i.e. the axis position that was – or will be – present at exactly that time).

VAR_INPUT

VAR_INPUT
    nGrpId      : UDINT;
    nSubIdx     : UDINT;
    dcTime      : T_DCTIME32;(* 32 bit distributed clock time *)
END_VAR

nGrpId

Group ID of the corresponding Nci channel

nSubIdx

This 32-bit input value contains two different items of information and is therefore divided into two 16-bit values:
The LowWord (the least significant 16 bits) contains the subindex for relative addressing of an encoder subelement at an axis. The subindex is counted upwards from zero. For the typical case of an axis with exactly one encoder the null subindex is correct.
The HighWord (the most significant 16 bits) contains a control word (bit mask) that influences the type of position calculation (e.g. the interpolation or extrapolation type).
The bit mask 0x0001 means that the set acceleration of the axis is to be included in the calculation.
Bit mask 0x0010 means that the calculation is relative and is currently mandatory. Otherwise the call is rejected with an error.

dcTime

32-bit distributed clock system time (T_DCTIME32). This input value is converted to the corresponding relative Nci path distance on the contour.
This 32-bit time may only be used in the close time range of ± 2,147 seconds around the current system time, as it is only unique here. This requirement cannot be checked within the FB.

VAR_OUTPUT

VAR_OUTPUT
    fPosition   : LREAL;
    iErr        : UDINT;
END_VAR

fPosition

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

iErr

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).

Requirements

Development Environment

Target System

PLC Libraries to include

TwinCAT v2.11.0 Build > 2214 or higher

PC or CX (x86, ARM)

TcEtherCAT.Lib
( Standard.Lib; TcBase.Lib; TcSystem.Lib, TcUtilities.Lib are included automatically   )