F_GetCurDcTickTime64

F_GetCurDcTickTime64 1:

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

FUNCTION F_GetCurDcTickTime64: T_DCTIME64

F_GetCurDcTickTime64 2: Inputs

VAR_INPUT
(*none*)
END_VAR

Sample:

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

    sDCZero : STRING;(* DCTIME64 = zero time starts on 01.01.2000 *)
    tDCBackFromZero : T_DCTIME64;

    tDCFromString : T_DCTIME64;
    sDCBackFromString : STRING;
END_VAR

tDC := F_GetCurDcTickTime64();
sDC := DCTIME64_TO_STRING( tDC );
tDCBack := STRING_TO_DCTIME64( sDC );

sDCZero := DCTIME64_TO_STRING( ULARGE_INTEGER(0, 0) );
tDCBackFromZero := STRING_TO_DCTIME64( sDCZero );

tDCFromString := STRING_TO_DCTIME64( '2007-03-09-11:31:09.223456789' );
sDCBackFromString := DCTIME64_TO_STRING( tDCFromString );

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_EtherCAT