DCTIMESTRUCT_TO_DCTIME64

DCTIMESTRUCT_TO_DCTIME64 1:

The function converts a structured variable of type of type DCTIMESTRUCT to a 64-bit distributed clock system time variable T_DCTIME64. The structure components wDayofWeek is ignored in the conversion. The structure components wYear must be greater than or equal to 2000 and less than 2584. For invalid values of the structure components the function returns the value zero.

FUNCTION DCTIMESTRUCT_TO_DCTIME64: T_DCTIME64

DCTIMESTRUCT_TO_DCTIME64 2: Inputs

VAR_INPUT
    in : DCTIMESTRUCT;
END_VAR

Name

Type

Description

in

DCTIMESTRUCT

The structured variable to be converted

Sample:

PROGRAM P_TEST
VAR
    dcStruct : DCTIMESTRUCT := ( wYear := 2008, wMonth := 3, wDay := 13,
                    wHour := 1, wMinute := 2, wSecond :=3,
                    wMilliseconds := 123, wMicroseconds := 456, wNanoseconds := 789 );
    dc64 : T_DCTIME64;
END_VAR

dc64 := DCTIMESTRUCT_TO_DCTIME64( dcStruct );

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_EtherCAT