F_GetCurDcTickTime

F_GetCurDcTickTime 1:

F_GetCurDcTickTime 2:

Outdated function

The function is outdated. Use the function F_GetCurDcTickTime64 instead.

The function returns the time of the current (last) tick in TwinCAT distributed clock system time format (T_DCTIME).

FUNCTION F_GetCurDcTickTime: T_DCTIME

F_GetCurDcTickTime 3: Inputs

VAR_INPUT
(*none*)
END_VAR

Sample:

PROGRAM MAIN
VAR
    tDC : T_DCTIME;
    sDC : STRING;
    tDCBack : T_DCTIME;

    sDCZero : STRING;(* DCTIME = zero time starts on 01.01.2000 *)
    tDCBackFromZero : T_DCTIME;

    tDCFromString : T_DCTIME;
    sDCBackFromString : STRING;
END_VAR

tDC := F_GetCurDcTickTime();
sDC := DCTIME_TO_STRING( tDC );
tDCBack := STRING_TO_DCTIME( sDC );

sDCZero := DCTIME_TO_STRING( ULARGE_INTEGER(0, 0) );
tDCBackFromZero := STRING_TO_DCTIME( sDCZero );

tDCFromString := STRING_TO_DCTIME( '2007-03-09-11:31:09.223456789' );
sDCBackFromString := DCTIME_TO_STRING( tDCFromString );

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_EtherCAT