ConvertDcTimeToPathPos
This function block converts a 32-bit distributed clock system time variable of type T_DCTIME32 to a relative Nci path distance on the contour of the currently active Nci program (i.e. the function block returns a positive or negative relative interval, depending on the timing).
Inputs
VAR_INPUT
nGrpId : UDINT;
nSubIdx : UDINT;
dcTime : T_DCTIME32;(* 32 bit distributed clock time *)
END_VAR
Name | Type | Description |
---|---|---|
nGrpId | UDINT | Group ID of the corresponding Nci channel |
nSubIdx | UDINT | This 32-bit input variable contains two different items of information, and is therefore divided into two 16-bit values:
|
dcTime | T_DCTIME32 | 32-bit "Distributed Clock System Time" variable. This input variable is converted to the corresponding relative Nci path distance on the contour. |
The 32-bit time may only be used in the narrow range of ± 2,147 seconds around the current system time, to ensure that it is unambiguous. Within the function block this prerequisite cannot be checked. |
Outputs
VAR_OUTPUT
fPosition : LREAL;
iErr : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
fPosition | LREAL | Returns the relative Nci path distance on the contour that corresponds to the dcTime. |
iErr | UDINT | Returns an error number in the event of an error |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.0 | PC or CX (x86, x64, ARM) | Tc2_EtherCAT |